path
stringlengths
5
300
repo_name
stringlengths
6
76
content
stringlengths
26
1.05M
node_modules/bs-recipes/recipes/webpack.react-hot-loader/app/js/main.js
EgemenErol/angular2
import React from 'react'; import { render } from 'react-dom'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; render(<HelloWorld />, document.getElementById('react-root'));
src/index.js
Theadd/endless-chartist
import React from 'react' import App from './app' React.render(<App />, document.getElementById('root'))
node_modules/material-ui/svg-icons/av/skip-next.js
yaolei/Samoyed
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _SvgIcon = require('../../SvgIcon'); var _SvgIcon2 = _interopRequireDefault(_SvgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var AvSkipNext = function AvSkipNext(props) { return _react2.default.createElement( _SvgIcon2.default, props, _react2.default.createElement('path', { d: 'M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z' }) ); }; AvSkipNext = (0, _pure2.default)(AvSkipNext); AvSkipNext.displayName = 'AvSkipNext'; AvSkipNext.muiName = 'SvgIcon'; exports.default = AvSkipNext;
webpack.config.js
jerelmiller/react-motion
var webpack = require('webpack'); var loaders = ['babel']; var port = process.env.PORT || 3000; var plugins = [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }) ]; var entry = { demo0: './demos/demo0/index.jsx', demo1: './demos/demo1/index.jsx', demo2: './demos/demo2/index.jsx', demo3: './demos/demo3/index.jsx', demo4: './demos/demo4/index.jsx', demo5: './demos/demo5/index.jsx', demo6: './demos/demo6/index.jsx', demo7: './demos/demo7/index.jsx', demo8: './demos/demo8/index.jsx', }; if (process.env.NODE_ENV === 'development') { devtool = 'eval-source-map'; loaders = ['react-hot'].concat(loaders); plugins = plugins.concat([ new webpack.HotModuleReplacementPlugin() ]); entry = Object.keys(entry).reduce(function (result, key) { result[key] = [ 'webpack-dev-server/client?http://0.0.0.0:' + port, 'webpack/hot/only-dev-server', entry[key] ]; return result; }, {}); } else { plugins = plugins.concat([ new webpack.optimize.OccurenceOrderPlugin() ]); } module.exports = { entry: entry, output: { filename: '[name]/all.js', publicPath: '/demos/', path: __dirname + '/demos/' }, module: { loaders: [{ test: /\.jsx?$/, exclude: /build|lib|bower_components|node_modules/, loaders: loaders }], preLoaders: [ {test: /\.jsx?$/, loader: 'eslint', exclude: /build|lib|bower_components|node_modules/}, ], }, resolve: { extensions: ['', '.js', '.jsx'] }, plugins: plugins, eslint: {configFile: '.eslintrc'} };
src/containers/TrafficFine/DesTFRow.js
nyaayaIN/frontend
import React from 'react'; import Row from 'react-bootstrap/lib/Row'; import Col from 'react-bootstrap/lib/Col'; import DesTFRowFine from './DesTFRowFine'; import NyHR from '../../components/utils/NyHR'; import './TFRow.css'; export default class DesTFRow extends React.Component { render() { let targetBlank = '_blank'; const simplified = this.props.dataRow.simplified.replace(/(?:\r\n|\r|\n)/g, '<br />'); if(this.props.dataRow.hyperlink.substring(0,16) ==='http://nyaaya.in') { targetBlank = ''; } return ( <div> <Row className="tfrow"> <Col xs={6} sm={6} lg={6} md={6}> <b>{this.props.dataRow.traffic_offense}</b> <div className="text-muted" dangerouslySetInnerHTML={ {__html: simplified }} /> <div className="hyperlink" > <a href={this.props.dataRow.hyperlink} target={targetBlank}> {this.props.dataRow.text_of_hyperlink} </a> </div> </Col> <Col xs={3} sm={3} lg={3} md={3}> <DesTFRowFine whichTime="1st Time" fineOffense={this.props.dataRow.fine_first_offense} jailOffense={this.props.dataRow.jail_first_offense} /> </Col> <Col xs={3} sm={3} lg={3} md={3}> <DesTFRowFine whichTime="2nd Time" fineOffense={this.props.dataRow.fine_second_offense} jailOffense={this.props.dataRow.jail_second_offense} /> </Col> </Row> <NyHR margin="5px auto" height="1px"/> </div> ); } } DesTFRow.propTypes = { dataRow: React.PropTypes.object.isRequired, };
test/MenuItemSpec.js
andrew-d/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import MenuItem from '../src/MenuItem'; describe('MenuItem', function () { it('should output an li', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem> Title </MenuItem> ); assert.equal(React.findDOMNode(instance).nodeName, 'LI'); assert.equal(React.findDOMNode(instance).getAttribute('role'), 'presentation'); }); it('should pass through props', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem className="test-class" href="#hi-mom!" title="hi mom!" active={true}> Title </MenuItem> ); let node = React.findDOMNode(instance); assert(node.className.match(/\btest-class\b/)); assert.equal(node.getAttribute('href'), null); assert.equal(node.getAttribute('title'), null); assert.ok(node.className.match(/\bactive\b/)); let anchorNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a')); assert.notOk(anchorNode.className.match(/\btest-class\b/)); assert.equal(anchorNode.getAttribute('href'), '#hi-mom!'); assert.equal(anchorNode.getAttribute('title'), 'hi mom!'); }); it('should have an anchor', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem> Title </MenuItem> ); let anchor = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a'); assert.equal(React.findDOMNode(anchor).getAttribute('tabIndex'), '-1'); }); it('should fire callback on click of link', function (done) { let selectOp = function (selectedKey) { assert.equal(selectedKey, '1'); done(); }; let instance = ReactTestUtils.renderIntoDocument( <MenuItem eventKey='1' onSelect={selectOp}> Title </MenuItem> ); let anchor = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a'); ReactTestUtils.Simulate.click(anchor); }); it('should be a divider with no children', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem divider> Title </MenuItem> ); assert(React.findDOMNode(instance).className.match(/\bdivider\b/), 'Has no divider class'); assert.equal(React.findDOMNode(instance).innerText, ''); }); it('should be a header with no anchor', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem header> Title </MenuItem> ); assert(React.findDOMNode(instance).className.match(/\bdropdown-header\b/), 'Has no header class'); assert.equal(React.findDOMNode(instance).innerHTML, 'Title'); }); it('Should set target attribute on anchor', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem target="_blank"> Title </MenuItem> ); let anchor = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a'); assert.equal(React.findDOMNode(anchor).getAttribute('target'), '_blank'); }); it('Should call `onSelect` with target attribute', function (done) { function handleSelect(key, href, target) { assert.equal(href, 'link'); assert.equal(target, '_blank'); done(); } let instance = ReactTestUtils.renderIntoDocument( <MenuItem onSelect={handleSelect} target="_blank" href="link"> Title </MenuItem> ); ReactTestUtils.Simulate.click(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a')); }); it('Should be `disabled` link', function () { let instance = ReactTestUtils.renderIntoDocument( <MenuItem disabled> Title </MenuItem> ); assert.ok(React.findDOMNode(instance).className.match(/\bdisabled\b/)); }); });
demo/app.js
ctco/rosemary-ui
import 'assets/scss/_page.scss'; // test rebuild - all in the dev mode import '../src/assets/scss/_all.scss'; import React from 'react'; import ReactDOM from 'react-dom'; import {Provider} from 'react-redux'; import {createStore,applyMiddleware, compose} from 'redux'; import reducers from './reducers'; import Store from './state/main-store'; import routConfig from './config/route-config'; const store = createStore(reducers, Store, compose( applyMiddleware(), window.devToolsExtension ? window.devToolsExtension() : (f) => f )); function main() { const root = document.querySelector('#app'); // TODO: explain magic ReactDOM.unmountComponentAtNode(root); ReactDOM.render( <Provider store={store}> {routConfig} </Provider> , root); } main(); /* HOT Reload from webpack dev server */ if (module && module.hot) { module.hot.accept(); module.hot.accept('./reducers', () => { const nextRootReducer = require('./reducers'); store.replaceReducer(nextRootReducer); }); module.hot.accept('./app.js', main); }
app/containers/LanguageProvider/index.js
alexsmartman/weather-react
/* * * LanguageProvider * * this component connects the redux state language locale to the * IntlProvider component and i18n messages (loaded from `app/translations`) */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { IntlProvider } from 'react-intl'; import { makeSelectLocale } from './selectors'; export class LanguageProvider extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function render() { return ( <IntlProvider locale={this.props.locale} key={this.props.locale} messages={this.props.messages[this.props.locale]}> {React.Children.only(this.props.children)} </IntlProvider> ); } } LanguageProvider.propTypes = { locale: PropTypes.string, messages: PropTypes.object, children: PropTypes.element.isRequired, }; const mapStateToProps = createSelector( makeSelectLocale(), (locale) => ({ locale }) ); export default connect(mapStateToProps)(LanguageProvider);
episode-023/priv/static/js/app.js
thaterikperson/elmseeds
(function() { 'use strict'; var globals = typeof window === 'undefined' ? global : window; if (typeof globals.require === 'function') return; var modules = {}; var cache = {}; var aliases = {}; var has = ({}).hasOwnProperty; var expRe = /^\.\.?(\/|$)/; var expand = function(root, name) { var results = [], part; var parts = (expRe.test(name) ? root + '/' + name : name).split('/'); for (var i = 0, length = parts.length; i < length; i++) { part = parts[i]; if (part === '..') { results.pop(); } else if (part !== '.' && part !== '') { results.push(part); } } return results.join('/'); }; var dirname = function(path) { return path.split('/').slice(0, -1).join('/'); }; var localRequire = function(path) { return function expanded(name) { var absolute = expand(dirname(path), name); return globals.require(absolute, path); }; }; var initModule = function(name, definition) { var hot = null; hot = hmr && hmr.createHot(name); var module = {id: name, exports: {}, hot: hot}; cache[name] = module; definition(module.exports, localRequire(name), module); return module.exports; }; var expandAlias = function(name) { return aliases[name] ? expandAlias(aliases[name]) : name; }; var _resolve = function(name, dep) { return expandAlias(expand(dirname(name), dep)); }; var require = function(name, loaderPath) { if (loaderPath == null) loaderPath = '/'; var path = expandAlias(name); if (has.call(cache, path)) return cache[path].exports; if (has.call(modules, path)) return initModule(path, modules[path]); throw new Error("Cannot find module '" + name + "' from '" + loaderPath + "'"); }; require.alias = function(from, to) { aliases[to] = from; }; var extRe = /\.[^.\/]+$/; var indexRe = /\/index(\.[^\/]+)?$/; var addExtensions = function(bundle) { if (extRe.test(bundle)) { var alias = bundle.replace(extRe, ''); if (!has.call(aliases, alias) || aliases[alias].replace(extRe, '') === alias + '/index') { aliases[alias] = bundle; } } if (indexRe.test(bundle)) { var iAlias = bundle.replace(indexRe, ''); if (!has.call(aliases, iAlias)) { aliases[iAlias] = bundle; } } }; require.register = require.define = function(bundle, fn) { if (typeof bundle === 'object') { for (var key in bundle) { if (has.call(bundle, key)) { require.register(key, bundle[key]); } } } else { modules[bundle] = fn; delete cache[bundle]; addExtensions(bundle); } }; require.list = function() { var list = []; for (var item in modules) { if (has.call(modules, item)) { list.push(item); } } return list; }; var hmr = globals._hmr && new globals._hmr(_resolve, require, modules, cache); require._cache = cache; require.hmr = hmr && hmr.wrap; require.brunch = true; globals.require = require; })(); (function() { var global = window; var process; var __makeRelativeRequire = function(require, mappings, pref) { var none = {}; var tryReq = function(name, pref) { var val; try { val = require(pref + '/node_modules/' + name); return val; } catch (e) { if (e.toString().indexOf('Cannot find module') === -1) { throw e; } if (pref.indexOf('node_modules') !== -1) { var s = pref.split('/'); var i = s.lastIndexOf('node_modules'); var newPref = s.slice(0, i).join('/'); return tryReq(name, newPref); } } return none; }; return function(name) { if (name in mappings) name = mappings[name]; if (!name) return; if (name[0] !== '.' && pref) { var val = tryReq(name, pref); if (val !== none) return val; } return require(name); } }; require.register("phoenix/priv/static/phoenix.js", function(exports, require, module) { require = __makeRelativeRequire(require, {}, "phoenix"); (function() { (function(exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; 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; }; }(); Object.defineProperty(exports, "__esModule", { value: true }); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Phoenix Channels JavaScript client // // ## Socket Connection // // A single connection is established to the server and // channels are multiplexed over the connection. // Connect to the server using the `Socket` class: // // let socket = new Socket("/ws", {params: {userToken: "123"}}) // socket.connect() // // The `Socket` constructor takes the mount point of the socket, // the authentication params, as well as options that can be found in // the Socket docs, such as configuring the `LongPoll` transport, and // heartbeat. // // ## Channels // // Channels are isolated, concurrent processes on the server that // subscribe to topics and broker events between the client and server. // To join a channel, you must provide the topic, and channel params for // authorization. Here's an example chat room example where `"new_msg"` // events are listened for, messages are pushed to the server, and // the channel is joined with ok/error/timeout matches: // // let channel = socket.channel("room:123", {token: roomToken}) // channel.on("new_msg", msg => console.log("Got message", msg) ) // $input.onEnter( e => { // channel.push("new_msg", {body: e.target.val}, 10000) // .receive("ok", (msg) => console.log("created message", msg) ) // .receive("error", (reasons) => console.log("create failed", reasons) ) // .receive("timeout", () => console.log("Networking issue...") ) // }) // channel.join() // .receive("ok", ({messages}) => console.log("catching up", messages) ) // .receive("error", ({reason}) => console.log("failed join", reason) ) // .receive("timeout", () => console.log("Networking issue. Still waiting...") ) // // // ## Joining // // Creating a channel with `socket.channel(topic, params)`, binds the params to // `channel.params`, which are sent up on `channel.join()`. // Subsequent rejoins will send up the modified params for // updating authorization params, or passing up last_message_id information. // Successful joins receive an "ok" status, while unsuccessful joins // receive "error". // // ## Duplicate Join Subscriptions // // While the client may join any number of topics on any number of channels, // the client may only hold a single subscription for each unique topic at any // given time. When attempting to create a duplicate subscription, // the server will close the existing channel, log a warning, and // spawn a new channel for the topic. The client will have their // `channel.onClose` callbacks fired for the existing channel, and the new // channel join will have its receive hooks processed as normal. // // ## Pushing Messages // // From the previous example, we can see that pushing messages to the server // can be done with `channel.push(eventName, payload)` and we can optionally // receive responses from the push. Additionally, we can use // `receive("timeout", callback)` to abort waiting for our other `receive` hooks // and take action after some period of waiting. The default timeout is 5000ms. // // // ## Socket Hooks // // Lifecycle events of the multiplexed connection can be hooked into via // `socket.onError()` and `socket.onClose()` events, ie: // // socket.onError( () => console.log("there was an error with the connection!") ) // socket.onClose( () => console.log("the connection dropped") ) // // // ## Channel Hooks // // For each joined channel, you can bind to `onError` and `onClose` events // to monitor the channel lifecycle, ie: // // channel.onError( () => console.log("there was an error!") ) // channel.onClose( () => console.log("the channel has gone away gracefully") ) // // ### onError hooks // // `onError` hooks are invoked if the socket connection drops, or the channel // crashes on the server. In either case, a channel rejoin is attempted // automatically in an exponential backoff manner. // // ### onClose hooks // // `onClose` hooks are invoked only in two cases. 1) the channel explicitly // closed on the server, or 2). The client explicitly closed, by calling // `channel.leave()` // // // ## Presence // // The `Presence` object provides features for syncing presence information // from the server with the client and handling presences joining and leaving. // // ### Syncing initial state from the server // // `Presence.syncState` is used to sync the list of presences on the server // with the client's state. An optional `onJoin` and `onLeave` callback can // be provided to react to changes in the client's local presences across // disconnects and reconnects with the server. // // `Presence.syncDiff` is used to sync a diff of presence join and leave // events from the server, as they happen. Like `syncState`, `syncDiff` // accepts optional `onJoin` and `onLeave` callbacks to react to a user // joining or leaving from a device. // // ### Listing Presences // // `Presence.list` is used to return a list of presence information // based on the local state of metadata. By default, all presence // metadata is returned, but a `listBy` function can be supplied to // allow the client to select which metadata to use for a given presence. // For example, you may have a user online from different devices with a // a metadata status of "online", but they have set themselves to "away" // on another device. In this case, they app may choose to use the "away" // status for what appears on the UI. The example below defines a `listBy` // function which prioritizes the first metadata which was registered for // each user. This could be the first tab they opened, or the first device // they came online from: // // let state = {} // state = Presence.syncState(state, stateFromServer) // let listBy = (id, {metas: [first, ...rest]}) => { // first.count = rest.length + 1 // count of this user's presences // first.id = id // return first // } // let onlineUsers = Presence.list(state, listBy) // // // ### Example Usage // // // detect if user has joined for the 1st time or from another tab/device // let onJoin = (id, current, newPres) => { // if(!current){ // console.log("user has entered for the first time", newPres) // } else { // console.log("user additional presence", newPres) // } // } // // detect if user has left from all tabs/devices, or is still present // let onLeave = (id, current, leftPres) => { // if(current.metas.length === 0){ // console.log("user has left from all devices", leftPres) // } else { // console.log("user left from a device", leftPres) // } // } // let presences = {} // client's initial empty presence state // // receive initial presence data from server, sent after join // myChannel.on("presences", state => { // presences = Presence.syncState(presences, state, onJoin, onLeave) // displayUsers(Presence.list(presences)) // }) // // receive "presence_diff" from server, containing join/leave events // myChannel.on("presence_diff", diff => { // presences = Presence.syncDiff(presences, diff, onJoin, onLeave) // this.setState({users: Presence.list(room.presences, listBy)}) // }) // var VSN = "1.0.0"; var SOCKET_STATES = { connecting: 0, open: 1, closing: 2, closed: 3 }; var DEFAULT_TIMEOUT = 10000; var CHANNEL_STATES = { closed: "closed", errored: "errored", joined: "joined", joining: "joining", leaving: "leaving" }; var CHANNEL_EVENTS = { close: "phx_close", error: "phx_error", join: "phx_join", reply: "phx_reply", leave: "phx_leave" }; var TRANSPORTS = { longpoll: "longpoll", websocket: "websocket" }; var Push = function () { // Initializes the Push // // channel - The Channel // event - The event, for example `"phx_join"` // payload - The payload, for example `{user_id: 123}` // timeout - The push timeout in milliseconds // function Push(channel, event, payload, timeout) { _classCallCheck(this, Push); this.channel = channel; this.event = event; this.payload = payload || {}; this.receivedResp = null; this.timeout = timeout; this.timeoutTimer = null; this.recHooks = []; this.sent = false; } _createClass(Push, [{ key: "resend", value: function resend(timeout) { this.timeout = timeout; this.cancelRefEvent(); this.ref = null; this.refEvent = null; this.receivedResp = null; this.sent = false; this.send(); } }, { key: "send", value: function send() { if (this.hasReceived("timeout")) { return; } this.startTimeout(); this.sent = true; this.channel.socket.push({ topic: this.channel.topic, event: this.event, payload: this.payload, ref: this.ref }); } }, { key: "receive", value: function receive(status, callback) { if (this.hasReceived(status)) { callback(this.receivedResp.response); } this.recHooks.push({ status: status, callback: callback }); return this; } // private }, { key: "matchReceive", value: function matchReceive(_ref) { var status = _ref.status; var response = _ref.response; var ref = _ref.ref; this.recHooks.filter(function (h) { return h.status === status; }).forEach(function (h) { return h.callback(response); }); } }, { key: "cancelRefEvent", value: function cancelRefEvent() { if (!this.refEvent) { return; } this.channel.off(this.refEvent); } }, { key: "cancelTimeout", value: function cancelTimeout() { clearTimeout(this.timeoutTimer); this.timeoutTimer = null; } }, { key: "startTimeout", value: function startTimeout() { var _this = this; if (this.timeoutTimer) { return; } this.ref = this.channel.socket.makeRef(); this.refEvent = this.channel.replyEventName(this.ref); this.channel.on(this.refEvent, function (payload) { _this.cancelRefEvent(); _this.cancelTimeout(); _this.receivedResp = payload; _this.matchReceive(payload); }); this.timeoutTimer = setTimeout(function () { _this.trigger("timeout", {}); }, this.timeout); } }, { key: "hasReceived", value: function hasReceived(status) { return this.receivedResp && this.receivedResp.status === status; } }, { key: "trigger", value: function trigger(status, response) { this.channel.trigger(this.refEvent, { status: status, response: response }); } }]); return Push; }(); var Channel = exports.Channel = function () { function Channel(topic, params, socket) { var _this2 = this; _classCallCheck(this, Channel); this.state = CHANNEL_STATES.closed; this.topic = topic; this.params = params || {}; this.socket = socket; this.bindings = []; this.timeout = this.socket.timeout; this.joinedOnce = false; this.joinPush = new Push(this, CHANNEL_EVENTS.join, this.params, this.timeout); this.pushBuffer = []; this.rejoinTimer = new Timer(function () { return _this2.rejoinUntilConnected(); }, this.socket.reconnectAfterMs); this.joinPush.receive("ok", function () { _this2.state = CHANNEL_STATES.joined; _this2.rejoinTimer.reset(); _this2.pushBuffer.forEach(function (pushEvent) { return pushEvent.send(); }); _this2.pushBuffer = []; }); this.onClose(function () { _this2.rejoinTimer.reset(); _this2.socket.log("channel", "close " + _this2.topic + " " + _this2.joinRef()); _this2.state = CHANNEL_STATES.closed; _this2.socket.remove(_this2); }); this.onError(function (reason) { if (_this2.isLeaving() || _this2.isClosed()) { return; } _this2.socket.log("channel", "error " + _this2.topic, reason); _this2.state = CHANNEL_STATES.errored; _this2.rejoinTimer.scheduleTimeout(); }); this.joinPush.receive("timeout", function () { if (!_this2.isJoining()) { return; } _this2.socket.log("channel", "timeout " + _this2.topic, _this2.joinPush.timeout); _this2.state = CHANNEL_STATES.errored; _this2.rejoinTimer.scheduleTimeout(); }); this.on(CHANNEL_EVENTS.reply, function (payload, ref) { _this2.trigger(_this2.replyEventName(ref), payload); }); } _createClass(Channel, [{ key: "rejoinUntilConnected", value: function rejoinUntilConnected() { this.rejoinTimer.scheduleTimeout(); if (this.socket.isConnected()) { this.rejoin(); } } }, { key: "join", value: function join() { var timeout = arguments.length <= 0 || arguments[0] === undefined ? this.timeout : arguments[0]; if (this.joinedOnce) { throw "tried to join multiple times. 'join' can only be called a single time per channel instance"; } else { this.joinedOnce = true; this.rejoin(timeout); return this.joinPush; } } }, { key: "onClose", value: function onClose(callback) { this.on(CHANNEL_EVENTS.close, callback); } }, { key: "onError", value: function onError(callback) { this.on(CHANNEL_EVENTS.error, function (reason) { return callback(reason); }); } }, { key: "on", value: function on(event, callback) { this.bindings.push({ event: event, callback: callback }); } }, { key: "off", value: function off(event) { this.bindings = this.bindings.filter(function (bind) { return bind.event !== event; }); } }, { key: "canPush", value: function canPush() { return this.socket.isConnected() && this.isJoined(); } }, { key: "push", value: function push(event, payload) { var timeout = arguments.length <= 2 || arguments[2] === undefined ? this.timeout : arguments[2]; if (!this.joinedOnce) { throw "tried to push '" + event + "' to '" + this.topic + "' before joining. Use channel.join() before pushing events"; } var pushEvent = new Push(this, event, payload, timeout); if (this.canPush()) { pushEvent.send(); } else { pushEvent.startTimeout(); this.pushBuffer.push(pushEvent); } return pushEvent; } // Leaves the channel // // Unsubscribes from server events, and // instructs channel to terminate on server // // Triggers onClose() hooks // // To receive leave acknowledgements, use the a `receive` // hook to bind to the server ack, ie: // // channel.leave().receive("ok", () => alert("left!") ) // }, { key: "leave", value: function leave() { var _this3 = this; var timeout = arguments.length <= 0 || arguments[0] === undefined ? this.timeout : arguments[0]; this.state = CHANNEL_STATES.leaving; var onClose = function onClose() { _this3.socket.log("channel", "leave " + _this3.topic); _this3.trigger(CHANNEL_EVENTS.close, "leave", _this3.joinRef()); }; var leavePush = new Push(this, CHANNEL_EVENTS.leave, {}, timeout); leavePush.receive("ok", function () { return onClose(); }).receive("timeout", function () { return onClose(); }); leavePush.send(); if (!this.canPush()) { leavePush.trigger("ok", {}); } return leavePush; } // Overridable message hook // // Receives all events for specialized message handling // before dispatching to the channel callbacks. // // Must return the payload, modified or unmodified }, { key: "onMessage", value: function onMessage(event, payload, ref) { return payload; } // private }, { key: "isMember", value: function isMember(topic) { return this.topic === topic; } }, { key: "joinRef", value: function joinRef() { return this.joinPush.ref; } }, { key: "sendJoin", value: function sendJoin(timeout) { this.state = CHANNEL_STATES.joining; this.joinPush.resend(timeout); } }, { key: "rejoin", value: function rejoin() { var timeout = arguments.length <= 0 || arguments[0] === undefined ? this.timeout : arguments[0]; if (this.isLeaving()) { return; } this.sendJoin(timeout); } }, { key: "trigger", value: function trigger(event, payload, ref) { var close = CHANNEL_EVENTS.close; var error = CHANNEL_EVENTS.error; var leave = CHANNEL_EVENTS.leave; var join = CHANNEL_EVENTS.join; if (ref && [close, error, leave, join].indexOf(event) >= 0 && ref !== this.joinRef()) { return; } var handledPayload = this.onMessage(event, payload, ref); if (payload && !handledPayload) { throw "channel onMessage callbacks must return the payload, modified or unmodified"; } this.bindings.filter(function (bind) { return bind.event === event; }).map(function (bind) { return bind.callback(handledPayload, ref); }); } }, { key: "replyEventName", value: function replyEventName(ref) { return "chan_reply_" + ref; } }, { key: "isClosed", value: function isClosed() { return this.state === CHANNEL_STATES.closed; } }, { key: "isErrored", value: function isErrored() { return this.state === CHANNEL_STATES.errored; } }, { key: "isJoined", value: function isJoined() { return this.state === CHANNEL_STATES.joined; } }, { key: "isJoining", value: function isJoining() { return this.state === CHANNEL_STATES.joining; } }, { key: "isLeaving", value: function isLeaving() { return this.state === CHANNEL_STATES.leaving; } }]); return Channel; }(); var Socket = exports.Socket = function () { // Initializes the Socket // // endPoint - The string WebSocket endpoint, ie, "ws://example.com/ws", // "wss://example.com" // "/ws" (inherited host & protocol) // opts - Optional configuration // transport - The Websocket Transport, for example WebSocket or Phoenix.LongPoll. // Defaults to WebSocket with automatic LongPoll fallback. // timeout - The default timeout in milliseconds to trigger push timeouts. // Defaults `DEFAULT_TIMEOUT` // heartbeatIntervalMs - The millisec interval to send a heartbeat message // reconnectAfterMs - The optional function that returns the millsec // reconnect interval. Defaults to stepped backoff of: // // function(tries){ // return [1000, 5000, 10000][tries - 1] || 10000 // } // // logger - The optional function for specialized logging, ie: // `logger: (kind, msg, data) => { console.log(`${kind}: ${msg}`, data) } // // longpollerTimeout - The maximum timeout of a long poll AJAX request. // Defaults to 20s (double the server long poll timer). // // params - The optional params to pass when connecting // // For IE8 support use an ES5-shim (https://github.com/es-shims/es5-shim) // function Socket(endPoint) { var _this4 = this; var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; _classCallCheck(this, Socket); this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] }; this.channels = []; this.sendBuffer = []; this.ref = 0; this.timeout = opts.timeout || DEFAULT_TIMEOUT; this.transport = opts.transport || window.WebSocket || LongPoll; this.heartbeatIntervalMs = opts.heartbeatIntervalMs || 30000; this.reconnectAfterMs = opts.reconnectAfterMs || function (tries) { return [1000, 2000, 5000, 10000][tries - 1] || 10000; }; this.logger = opts.logger || function () {}; // noop this.longpollerTimeout = opts.longpollerTimeout || 20000; this.params = opts.params || {}; this.endPoint = endPoint + "/" + TRANSPORTS.websocket; this.reconnectTimer = new Timer(function () { _this4.disconnect(function () { return _this4.connect(); }); }, this.reconnectAfterMs); } _createClass(Socket, [{ key: "protocol", value: function protocol() { return location.protocol.match(/^https/) ? "wss" : "ws"; } }, { key: "endPointURL", value: function endPointURL() { var uri = Ajax.appendParams(Ajax.appendParams(this.endPoint, this.params), { vsn: VSN }); if (uri.charAt(0) !== "/") { return uri; } if (uri.charAt(1) === "/") { return this.protocol() + ":" + uri; } return this.protocol() + "://" + location.host + uri; } }, { key: "disconnect", value: function disconnect(callback, code, reason) { if (this.conn) { this.conn.onclose = function () {}; // noop if (code) { this.conn.close(code, reason || ""); } else { this.conn.close(); } this.conn = null; } callback && callback(); } // params - The params to send when connecting, for example `{user_id: userToken}` }, { key: "connect", value: function connect(params) { var _this5 = this; if (params) { console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"); this.params = params; } if (this.conn) { return; } this.conn = new this.transport(this.endPointURL()); this.conn.timeout = this.longpollerTimeout; this.conn.onopen = function () { return _this5.onConnOpen(); }; this.conn.onerror = function (error) { return _this5.onConnError(error); }; this.conn.onmessage = function (event) { return _this5.onConnMessage(event); }; this.conn.onclose = function (event) { return _this5.onConnClose(event); }; } // Logs the message. Override `this.logger` for specialized logging. noops by default }, { key: "log", value: function log(kind, msg, data) { this.logger(kind, msg, data); } // Registers callbacks for connection state change events // // Examples // // socket.onError(function(error){ alert("An error occurred") }) // }, { key: "onOpen", value: function onOpen(callback) { this.stateChangeCallbacks.open.push(callback); } }, { key: "onClose", value: function onClose(callback) { this.stateChangeCallbacks.close.push(callback); } }, { key: "onError", value: function onError(callback) { this.stateChangeCallbacks.error.push(callback); } }, { key: "onMessage", value: function onMessage(callback) { this.stateChangeCallbacks.message.push(callback); } }, { key: "onConnOpen", value: function onConnOpen() { var _this6 = this; this.log("transport", "connected to " + this.endPointURL(), this.transport.prototype); this.flushSendBuffer(); this.reconnectTimer.reset(); if (!this.conn.skipHeartbeat) { clearInterval(this.heartbeatTimer); this.heartbeatTimer = setInterval(function () { return _this6.sendHeartbeat(); }, this.heartbeatIntervalMs); } this.stateChangeCallbacks.open.forEach(function (callback) { return callback(); }); } }, { key: "onConnClose", value: function onConnClose(event) { this.log("transport", "close", event); this.triggerChanError(); clearInterval(this.heartbeatTimer); this.reconnectTimer.scheduleTimeout(); this.stateChangeCallbacks.close.forEach(function (callback) { return callback(event); }); } }, { key: "onConnError", value: function onConnError(error) { this.log("transport", error); this.triggerChanError(); this.stateChangeCallbacks.error.forEach(function (callback) { return callback(error); }); } }, { key: "triggerChanError", value: function triggerChanError() { this.channels.forEach(function (channel) { return channel.trigger(CHANNEL_EVENTS.error); }); } }, { key: "connectionState", value: function connectionState() { switch (this.conn && this.conn.readyState) { case SOCKET_STATES.connecting: return "connecting"; case SOCKET_STATES.open: return "open"; case SOCKET_STATES.closing: return "closing"; default: return "closed"; } } }, { key: "isConnected", value: function isConnected() { return this.connectionState() === "open"; } }, { key: "remove", value: function remove(channel) { this.channels = this.channels.filter(function (c) { return c.joinRef() !== channel.joinRef(); }); } }, { key: "channel", value: function channel(topic) { var chanParams = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var chan = new Channel(topic, chanParams, this); this.channels.push(chan); return chan; } }, { key: "push", value: function push(data) { var _this7 = this; var topic = data.topic; var event = data.event; var payload = data.payload; var ref = data.ref; var callback = function callback() { return _this7.conn.send(JSON.stringify(data)); }; this.log("push", topic + " " + event + " (" + ref + ")", payload); if (this.isConnected()) { callback(); } else { this.sendBuffer.push(callback); } } // Return the next message ref, accounting for overflows }, { key: "makeRef", value: function makeRef() { var newRef = this.ref + 1; if (newRef === this.ref) { this.ref = 0; } else { this.ref = newRef; } return this.ref.toString(); } }, { key: "sendHeartbeat", value: function sendHeartbeat() { if (!this.isConnected()) { return; } this.push({ topic: "phoenix", event: "heartbeat", payload: {}, ref: this.makeRef() }); } }, { key: "flushSendBuffer", value: function flushSendBuffer() { if (this.isConnected() && this.sendBuffer.length > 0) { this.sendBuffer.forEach(function (callback) { return callback(); }); this.sendBuffer = []; } } }, { key: "onConnMessage", value: function onConnMessage(rawMessage) { var msg = JSON.parse(rawMessage.data); var topic = msg.topic; var event = msg.event; var payload = msg.payload; var ref = msg.ref; this.log("receive", (payload.status || "") + " " + topic + " " + event + " " + (ref && "(" + ref + ")" || ""), payload); this.channels.filter(function (channel) { return channel.isMember(topic); }).forEach(function (channel) { return channel.trigger(event, payload, ref); }); this.stateChangeCallbacks.message.forEach(function (callback) { return callback(msg); }); } }]); return Socket; }(); var LongPoll = exports.LongPoll = function () { function LongPoll(endPoint) { _classCallCheck(this, LongPoll); this.endPoint = null; this.token = null; this.skipHeartbeat = true; this.onopen = function () {}; // noop this.onerror = function () {}; // noop this.onmessage = function () {}; // noop this.onclose = function () {}; // noop this.pollEndpoint = this.normalizeEndpoint(endPoint); this.readyState = SOCKET_STATES.connecting; this.poll(); } _createClass(LongPoll, [{ key: "normalizeEndpoint", value: function normalizeEndpoint(endPoint) { return endPoint.replace("ws://", "http://").replace("wss://", "https://").replace(new RegExp("(.*)\/" + TRANSPORTS.websocket), "$1/" + TRANSPORTS.longpoll); } }, { key: "endpointURL", value: function endpointURL() { return Ajax.appendParams(this.pollEndpoint, { token: this.token }); } }, { key: "closeAndRetry", value: function closeAndRetry() { this.close(); this.readyState = SOCKET_STATES.connecting; } }, { key: "ontimeout", value: function ontimeout() { this.onerror("timeout"); this.closeAndRetry(); } }, { key: "poll", value: function poll() { var _this8 = this; if (!(this.readyState === SOCKET_STATES.open || this.readyState === SOCKET_STATES.connecting)) { return; } Ajax.request("GET", this.endpointURL(), "application/json", null, this.timeout, this.ontimeout.bind(this), function (resp) { if (resp) { var status = resp.status; var token = resp.token; var messages = resp.messages; _this8.token = token; } else { var status = 0; } switch (status) { case 200: messages.forEach(function (msg) { return _this8.onmessage({ data: JSON.stringify(msg) }); }); _this8.poll(); break; case 204: _this8.poll(); break; case 410: _this8.readyState = SOCKET_STATES.open; _this8.onopen(); _this8.poll(); break; case 0: case 500: _this8.onerror(); _this8.closeAndRetry(); break; default: throw "unhandled poll status " + status; } }); } }, { key: "send", value: function send(body) { var _this9 = this; Ajax.request("POST", this.endpointURL(), "application/json", body, this.timeout, this.onerror.bind(this, "timeout"), function (resp) { if (!resp || resp.status !== 200) { _this9.onerror(status); _this9.closeAndRetry(); } }); } }, { key: "close", value: function close(code, reason) { this.readyState = SOCKET_STATES.closed; this.onclose(); } }]); return LongPoll; }(); var Ajax = exports.Ajax = function () { function Ajax() { _classCallCheck(this, Ajax); } _createClass(Ajax, null, [{ key: "request", value: function request(method, endPoint, accept, body, timeout, ontimeout, callback) { if (window.XDomainRequest) { var req = new XDomainRequest(); // IE8, IE9 this.xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback); } else { var req = window.XMLHttpRequest ? new XMLHttpRequest() : // IE7+, Firefox, Chrome, Opera, Safari new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5 this.xhrRequest(req, method, endPoint, accept, body, timeout, ontimeout, callback); } } }, { key: "xdomainRequest", value: function xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback) { var _this10 = this; req.timeout = timeout; req.open(method, endPoint); req.onload = function () { var response = _this10.parseJSON(req.responseText); callback && callback(response); }; if (ontimeout) { req.ontimeout = ontimeout; } // Work around bug in IE9 that requires an attached onprogress handler req.onprogress = function () {}; req.send(body); } }, { key: "xhrRequest", value: function xhrRequest(req, method, endPoint, accept, body, timeout, ontimeout, callback) { var _this11 = this; req.timeout = timeout; req.open(method, endPoint, true); req.setRequestHeader("Content-Type", accept); req.onerror = function () { callback && callback(null); }; req.onreadystatechange = function () { if (req.readyState === _this11.states.complete && callback) { var response = _this11.parseJSON(req.responseText); callback(response); } }; if (ontimeout) { req.ontimeout = ontimeout; } req.send(body); } }, { key: "parseJSON", value: function parseJSON(resp) { return resp && resp !== "" ? JSON.parse(resp) : null; } }, { key: "serialize", value: function serialize(obj, parentKey) { var queryStr = []; for (var key in obj) { if (!obj.hasOwnProperty(key)) { continue; } var paramKey = parentKey ? parentKey + "[" + key + "]" : key; var paramVal = obj[key]; if ((typeof paramVal === "undefined" ? "undefined" : _typeof(paramVal)) === "object") { queryStr.push(this.serialize(paramVal, paramKey)); } else { queryStr.push(encodeURIComponent(paramKey) + "=" + encodeURIComponent(paramVal)); } } return queryStr.join("&"); } }, { key: "appendParams", value: function appendParams(url, params) { if (Object.keys(params).length === 0) { return url; } var prefix = url.match(/\?/) ? "&" : "?"; return "" + url + prefix + this.serialize(params); } }]); return Ajax; }(); Ajax.states = { complete: 4 }; var Presence = exports.Presence = { syncState: function syncState(currentState, newState, onJoin, onLeave) { var _this12 = this; var state = this.clone(currentState); var joins = {}; var leaves = {}; this.map(state, function (key, presence) { if (!newState[key]) { leaves[key] = presence; } }); this.map(newState, function (key, newPresence) { var currentPresence = state[key]; if (currentPresence) { (function () { var newRefs = newPresence.metas.map(function (m) { return m.phx_ref; }); var curRefs = currentPresence.metas.map(function (m) { return m.phx_ref; }); var joinedMetas = newPresence.metas.filter(function (m) { return curRefs.indexOf(m.phx_ref) < 0; }); var leftMetas = currentPresence.metas.filter(function (m) { return newRefs.indexOf(m.phx_ref) < 0; }); if (joinedMetas.length > 0) { joins[key] = newPresence; joins[key].metas = joinedMetas; } if (leftMetas.length > 0) { leaves[key] = _this12.clone(currentPresence); leaves[key].metas = leftMetas; } })(); } else { joins[key] = newPresence; } }); return this.syncDiff(state, { joins: joins, leaves: leaves }, onJoin, onLeave); }, syncDiff: function syncDiff(currentState, _ref2, onJoin, onLeave) { var joins = _ref2.joins; var leaves = _ref2.leaves; var state = this.clone(currentState); if (!onJoin) { onJoin = function onJoin() {}; } if (!onLeave) { onLeave = function onLeave() {}; } this.map(joins, function (key, newPresence) { var currentPresence = state[key]; state[key] = newPresence; if (currentPresence) { var _state$key$metas; (_state$key$metas = state[key].metas).unshift.apply(_state$key$metas, _toConsumableArray(currentPresence.metas)); } onJoin(key, currentPresence, newPresence); }); this.map(leaves, function (key, leftPresence) { var currentPresence = state[key]; if (!currentPresence) { return; } var refsToRemove = leftPresence.metas.map(function (m) { return m.phx_ref; }); currentPresence.metas = currentPresence.metas.filter(function (p) { return refsToRemove.indexOf(p.phx_ref) < 0; }); onLeave(key, currentPresence, leftPresence); if (currentPresence.metas.length === 0) { delete state[key]; } }); return state; }, list: function list(presences, chooser) { if (!chooser) { chooser = function chooser(key, pres) { return pres; }; } return this.map(presences, function (key, presence) { return chooser(key, presence); }); }, // private map: function map(obj, func) { return Object.getOwnPropertyNames(obj).map(function (key) { return func(key, obj[key]); }); }, clone: function clone(obj) { return JSON.parse(JSON.stringify(obj)); } }; // Creates a timer that accepts a `timerCalc` function to perform // calculated timeout retries, such as exponential backoff. // // ## Examples // // let reconnectTimer = new Timer(() => this.connect(), function(tries){ // return [1000, 5000, 10000][tries - 1] || 10000 // }) // reconnectTimer.scheduleTimeout() // fires after 1000 // reconnectTimer.scheduleTimeout() // fires after 5000 // reconnectTimer.reset() // reconnectTimer.scheduleTimeout() // fires after 1000 // var Timer = function () { function Timer(callback, timerCalc) { _classCallCheck(this, Timer); this.callback = callback; this.timerCalc = timerCalc; this.timer = null; this.tries = 0; } _createClass(Timer, [{ key: "reset", value: function reset() { this.tries = 0; clearTimeout(this.timer); } // Cancels any previous scheduleTimeout and schedules callback }, { key: "scheduleTimeout", value: function scheduleTimeout() { var _this13 = this; clearTimeout(this.timer); this.timer = setTimeout(function () { _this13.tries = _this13.tries + 1; _this13.callback(); }, this.timerCalc(this.tries + 1)); } }]); return Timer; }(); })(typeof(exports) === "undefined" ? window.Phoenix = window.Phoenix || {} : exports); })(); }); require.register("phoenix_html/priv/static/phoenix_html.js", function(exports, require, module) { require = __makeRelativeRequire(require, {}, "phoenix_html"); (function() { 'use strict'; function isLinkToSubmitParent(element) { var isLinkTag = element.tagName === 'A'; var shouldSubmitParent = element.getAttribute('data-submit') === 'parent'; return isLinkTag && shouldSubmitParent; } function didHandleSubmitLinkClick(element) { while (element && element.getAttribute) { if (isLinkToSubmitParent(element)) { var message = element.getAttribute('data-confirm'); if (message === null || confirm(message)) { element.parentNode.submit(); }; return true; } else { element = element.parentNode; } } return false; } // for links with HTTP methods other than GET window.addEventListener('click', function (event) { if (event.target && didHandleSubmitLinkClick(event.target)) { event.preventDefault(); return false; } }, false); })(); }); require.register("process/browser.js", function(exports, require, module) { require = __makeRelativeRequire(require, {}, "process"); (function() { // 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.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; }; })(); }); require.register("web/static/elm/Main.elm", function(exports, require, module) { }); ;require.register("web/static/elm/Model.elm", function(exports, require, module) { }); ;require.register("web/static/elm/Routes.elm", function(exports, require, module) { }); ;require.register("web/static/elm/StarWars.elm", function(exports, require, module) { }); ;require.register("web/static/elm/View.elm", function(exports, require, module) { }); ;require.register("web/static/elm/ViewHelper.elm", function(exports, require, module) { }); ;require.register("web/static/js/app.js", function(exports, require, module) { 'use strict'; require('phoenix_html'); var _main = require('./main'); var _main2 = _interopRequireDefault(_main); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Brunch automatically concatenates all files in your // watched paths. Those paths can be configured at // config.paths.watched in "brunch-config.js". // // However, those files will only be executed if // explicitly imported. The only exception are files // in vendor, which are never wrapped in imports and // therefore are always executed. // Import dependencies // // If you no longer want to use a dependency, remember // to also remove its path from "config.paths.watched". var div = document.getElementById('main'); // Import local files // // Local files can be imported directly using relative // paths "./socket" or full ones "web/static/js/socket". // import socket from "./socket" div.innerHTML = ''; _main2.default.Main.embed(div); }); ;require.register("web/static/js/main.js", function(exports, require, module) { 'use strict'; 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; }; (function () { 'use strict'; function F2(fun) { function wrapper(a) { return function (b) { return fun(a, b); }; } wrapper.arity = 2; wrapper.func = fun; return wrapper; } function F3(fun) { function wrapper(a) { return function (b) { return function (c) { return fun(a, b, c); }; }; } wrapper.arity = 3; wrapper.func = fun; return wrapper; } function F4(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return fun(a, b, c, d); }; }; }; } wrapper.arity = 4; wrapper.func = fun; return wrapper; } function F5(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return function (e) { return fun(a, b, c, d, e); }; }; }; }; } wrapper.arity = 5; wrapper.func = fun; return wrapper; } function F6(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return fun(a, b, c, d, e, f); }; }; }; }; }; } wrapper.arity = 6; wrapper.func = fun; return wrapper; } function F7(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return function (g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; }; } wrapper.arity = 7; wrapper.func = fun; return wrapper; } function F8(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return function (g) { return function (h) { return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; }; } wrapper.arity = 8; wrapper.func = fun; return wrapper; } function F9(fun) { function wrapper(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return function (g) { return function (h) { return function (i) { return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; }; } wrapper.arity = 9; wrapper.func = fun; return wrapper; } function A2(fun, a, b) { return fun.arity === 2 ? fun.func(a, b) : fun(a)(b); } function A3(fun, a, b, c) { return fun.arity === 3 ? fun.func(a, b, c) : fun(a)(b)(c); } function A4(fun, a, b, c, d) { return fun.arity === 4 ? fun.func(a, b, c, d) : fun(a)(b)(c)(d); } function A5(fun, a, b, c, d, e) { return fun.arity === 5 ? fun.func(a, b, c, d, e) : fun(a)(b)(c)(d)(e); } function A6(fun, a, b, c, d, e, f) { return fun.arity === 6 ? fun.func(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f); } function A7(fun, a, b, c, d, e, f, g) { return fun.arity === 7 ? fun.func(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g); } function A8(fun, a, b, c, d, e, f, g, h) { return fun.arity === 8 ? fun.func(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h); } function A9(fun, a, b, c, d, e, f, g, h, i) { return fun.arity === 9 ? fun.func(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i); } //import Native.List // var _elm_lang$core$Native_Array = function () { // A RRB-Tree has two distinct data types. // Leaf -> "height" is always 0 // "table" is an array of elements // Node -> "height" is always greater than 0 // "table" is an array of child nodes // "lengths" is an array of accumulated lengths of the child nodes // M is the maximal table size. 32 seems fast. E is the allowed increase // of search steps when concatting to find an index. Lower values will // decrease balancing, but will increase search steps. var M = 32; var E = 2; // An empty array. var empty = { ctor: '_Array', height: 0, table: [] }; function get(i, array) { if (i < 0 || i >= length(array)) { throw new Error('Index ' + i + ' is out of range. Check the length of ' + 'your array first or use getMaybe or getWithDefault.'); } return unsafeGet(i, array); } function unsafeGet(i, array) { for (var x = array.height; x > 0; x--) { var slot = i >> x * 5; while (array.lengths[slot] <= i) { slot++; } if (slot > 0) { i -= array.lengths[slot - 1]; } array = array.table[slot]; } return array.table[i]; } // Sets the value at the index i. Only the nodes leading to i will get // copied and updated. function set(i, item, array) { if (i < 0 || length(array) <= i) { return array; } return unsafeSet(i, item, array); } function unsafeSet(i, item, array) { array = nodeCopy(array); if (array.height === 0) { array.table[i] = item; } else { var slot = getSlot(i, array); if (slot > 0) { i -= array.lengths[slot - 1]; } array.table[slot] = unsafeSet(i, item, array.table[slot]); } return array; } function initialize(len, f) { if (len <= 0) { return empty; } var h = Math.floor(Math.log(len) / Math.log(M)); return initialize_(f, h, 0, len); } function initialize_(f, h, from, to) { if (h === 0) { var table = new Array((to - from) % (M + 1)); for (var i = 0; i < table.length; i++) { table[i] = f(from + i); } return { ctor: '_Array', height: 0, table: table }; } var step = Math.pow(M, h); var table = new Array(Math.ceil((to - from) / step)); var lengths = new Array(table.length); for (var i = 0; i < table.length; i++) { table[i] = initialize_(f, h - 1, from + i * step, Math.min(from + (i + 1) * step, to)); lengths[i] = length(table[i]) + (i > 0 ? lengths[i - 1] : 0); } return { ctor: '_Array', height: h, table: table, lengths: lengths }; } function fromList(list) { if (list.ctor === '[]') { return empty; } // Allocate M sized blocks (table) and write list elements to it. var table = new Array(M); var nodes = []; var i = 0; while (list.ctor !== '[]') { table[i] = list._0; list = list._1; i++; // table is full, so we can push a leaf containing it into the // next node. if (i === M) { var leaf = { ctor: '_Array', height: 0, table: table }; fromListPush(leaf, nodes); table = new Array(M); i = 0; } } // Maybe there is something left on the table. if (i > 0) { var leaf = { ctor: '_Array', height: 0, table: table.splice(0, i) }; fromListPush(leaf, nodes); } // Go through all of the nodes and eventually push them into higher nodes. for (var h = 0; h < nodes.length - 1; h++) { if (nodes[h].table.length > 0) { fromListPush(nodes[h], nodes); } } var head = nodes[nodes.length - 1]; if (head.height > 0 && head.table.length === 1) { return head.table[0]; } else { return head; } } // Push a node into a higher node as a child. function fromListPush(toPush, nodes) { var h = toPush.height; // Maybe the node on this height does not exist. if (nodes.length === h) { var node = { ctor: '_Array', height: h + 1, table: [], lengths: [] }; nodes.push(node); } nodes[h].table.push(toPush); var len = length(toPush); if (nodes[h].lengths.length > 0) { len += nodes[h].lengths[nodes[h].lengths.length - 1]; } nodes[h].lengths.push(len); if (nodes[h].table.length === M) { fromListPush(nodes[h], nodes); nodes[h] = { ctor: '_Array', height: h + 1, table: [], lengths: [] }; } } // Pushes an item via push_ to the bottom right of a tree. function push(item, a) { var pushed = push_(item, a); if (pushed !== null) { return pushed; } var newTree = create(item, a.height); return siblise(a, newTree); } // Recursively tries to push an item to the bottom-right most // tree possible. If there is no space left for the item, // null will be returned. function push_(item, a) { // Handle resursion stop at leaf level. if (a.height === 0) { if (a.table.length < M) { var newA = { ctor: '_Array', height: 0, table: a.table.slice() }; newA.table.push(item); return newA; } else { return null; } } // Recursively push var pushed = push_(item, botRight(a)); // There was space in the bottom right tree, so the slot will // be updated. if (pushed !== null) { var newA = nodeCopy(a); newA.table[newA.table.length - 1] = pushed; newA.lengths[newA.lengths.length - 1]++; return newA; } // When there was no space left, check if there is space left // for a new slot with a tree which contains only the item // at the bottom. if (a.table.length < M) { var newSlot = create(item, a.height - 1); var newA = nodeCopy(a); newA.table.push(newSlot); newA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot)); return newA; } else { return null; } } // Converts an array into a list of elements. function toList(a) { return toList_(_elm_lang$core$Native_List.Nil, a); } function toList_(list, a) { for (var i = a.table.length - 1; i >= 0; i--) { list = a.height === 0 ? _elm_lang$core$Native_List.Cons(a.table[i], list) : toList_(list, a.table[i]); } return list; } // Maps a function over the elements of an array. function map(f, a) { var newA = { ctor: '_Array', height: a.height, table: new Array(a.table.length) }; if (a.height > 0) { newA.lengths = a.lengths; } for (var i = 0; i < a.table.length; i++) { newA.table[i] = a.height === 0 ? f(a.table[i]) : map(f, a.table[i]); } return newA; } // Maps a function over the elements with their index as first argument. function indexedMap(f, a) { return indexedMap_(f, a, 0); } function indexedMap_(f, a, from) { var newA = { ctor: '_Array', height: a.height, table: new Array(a.table.length) }; if (a.height > 0) { newA.lengths = a.lengths; } for (var i = 0; i < a.table.length; i++) { newA.table[i] = a.height === 0 ? A2(f, from + i, a.table[i]) : indexedMap_(f, a.table[i], i == 0 ? from : from + a.lengths[i - 1]); } return newA; } function foldl(f, b, a) { if (a.height === 0) { for (var i = 0; i < a.table.length; i++) { b = A2(f, a.table[i], b); } } else { for (var i = 0; i < a.table.length; i++) { b = foldl(f, b, a.table[i]); } } return b; } function foldr(f, b, a) { if (a.height === 0) { for (var i = a.table.length; i--;) { b = A2(f, a.table[i], b); } } else { for (var i = a.table.length; i--;) { b = foldr(f, b, a.table[i]); } } return b; } // TODO: currently, it slices the right, then the left. This can be // optimized. function slice(from, to, a) { if (from < 0) { from += length(a); } if (to < 0) { to += length(a); } return sliceLeft(from, sliceRight(to, a)); } function sliceRight(to, a) { if (to === length(a)) { return a; } // Handle leaf level. if (a.height === 0) { var newA = { ctor: '_Array', height: 0 }; newA.table = a.table.slice(0, to); return newA; } // Slice the right recursively. var right = getSlot(to, a); var sliced = sliceRight(to - (right > 0 ? a.lengths[right - 1] : 0), a.table[right]); // Maybe the a node is not even needed, as sliced contains the whole slice. if (right === 0) { return sliced; } // Create new node. var newA = { ctor: '_Array', height: a.height, table: a.table.slice(0, right), lengths: a.lengths.slice(0, right) }; if (sliced.table.length > 0) { newA.table[right] = sliced; newA.lengths[right] = length(sliced) + (right > 0 ? newA.lengths[right - 1] : 0); } return newA; } function sliceLeft(from, a) { if (from === 0) { return a; } // Handle leaf level. if (a.height === 0) { var newA = { ctor: '_Array', height: 0 }; newA.table = a.table.slice(from, a.table.length + 1); return newA; } // Slice the left recursively. var left = getSlot(from, a); var sliced = sliceLeft(from - (left > 0 ? a.lengths[left - 1] : 0), a.table[left]); // Maybe the a node is not even needed, as sliced contains the whole slice. if (left === a.table.length - 1) { return sliced; } // Create new node. var newA = { ctor: '_Array', height: a.height, table: a.table.slice(left, a.table.length + 1), lengths: new Array(a.table.length - left) }; newA.table[0] = sliced; var len = 0; for (var i = 0; i < newA.table.length; i++) { len += length(newA.table[i]); newA.lengths[i] = len; } return newA; } // Appends two trees. function append(a, b) { if (a.table.length === 0) { return b; } if (b.table.length === 0) { return a; } var c = append_(a, b); // Check if both nodes can be crunshed together. if (c[0].table.length + c[1].table.length <= M) { if (c[0].table.length === 0) { return c[1]; } if (c[1].table.length === 0) { return c[0]; } // Adjust .table and .lengths c[0].table = c[0].table.concat(c[1].table); if (c[0].height > 0) { var len = length(c[0]); for (var i = 0; i < c[1].lengths.length; i++) { c[1].lengths[i] += len; } c[0].lengths = c[0].lengths.concat(c[1].lengths); } return c[0]; } if (c[0].height > 0) { var toRemove = calcToRemove(a, b); if (toRemove > E) { c = shuffle(c[0], c[1], toRemove); } } return siblise(c[0], c[1]); } // Returns an array of two nodes; right and left. One node _may_ be empty. function append_(a, b) { if (a.height === 0 && b.height === 0) { return [a, b]; } if (a.height !== 1 || b.height !== 1) { if (a.height === b.height) { a = nodeCopy(a); b = nodeCopy(b); var appended = append_(botRight(a), botLeft(b)); insertRight(a, appended[1]); insertLeft(b, appended[0]); } else if (a.height > b.height) { a = nodeCopy(a); var appended = append_(botRight(a), b); insertRight(a, appended[0]); b = parentise(appended[1], appended[1].height + 1); } else { b = nodeCopy(b); var appended = append_(a, botLeft(b)); var left = appended[0].table.length === 0 ? 0 : 1; var right = left === 0 ? 1 : 0; insertLeft(b, appended[left]); a = parentise(appended[right], appended[right].height + 1); } } // Check if balancing is needed and return based on that. if (a.table.length === 0 || b.table.length === 0) { return [a, b]; } var toRemove = calcToRemove(a, b); if (toRemove <= E) { return [a, b]; } return shuffle(a, b, toRemove); } // Helperfunctions for append_. Replaces a child node at the side of the parent. function insertRight(parent, node) { var index = parent.table.length - 1; parent.table[index] = node; parent.lengths[index] = length(node); parent.lengths[index] += index > 0 ? parent.lengths[index - 1] : 0; } function insertLeft(parent, node) { if (node.table.length > 0) { parent.table[0] = node; parent.lengths[0] = length(node); var len = length(parent.table[0]); for (var i = 1; i < parent.lengths.length; i++) { len += length(parent.table[i]); parent.lengths[i] = len; } } else { parent.table.shift(); for (var i = 1; i < parent.lengths.length; i++) { parent.lengths[i] = parent.lengths[i] - parent.lengths[0]; } parent.lengths.shift(); } } // Returns the extra search steps for E. Refer to the paper. function calcToRemove(a, b) { var subLengths = 0; for (var i = 0; i < a.table.length; i++) { subLengths += a.table[i].table.length; } for (var i = 0; i < b.table.length; i++) { subLengths += b.table[i].table.length; } var toRemove = a.table.length + b.table.length; return toRemove - (Math.floor((subLengths - 1) / M) + 1); } // get2, set2 and saveSlot are helpers for accessing elements over two arrays. function get2(a, b, index) { return index < a.length ? a[index] : b[index - a.length]; } function set2(a, b, index, value) { if (index < a.length) { a[index] = value; } else { b[index - a.length] = value; } } function saveSlot(a, b, index, slot) { set2(a.table, b.table, index, slot); var l = index === 0 || index === a.lengths.length ? 0 : get2(a.lengths, a.lengths, index - 1); set2(a.lengths, b.lengths, index, l + length(slot)); } // Creates a node or leaf with a given length at their arrays for perfomance. // Is only used by shuffle. function createNode(h, length) { if (length < 0) { length = 0; } var a = { ctor: '_Array', height: h, table: new Array(length) }; if (h > 0) { a.lengths = new Array(length); } return a; } // Returns an array of two balanced nodes. function shuffle(a, b, toRemove) { var newA = createNode(a.height, Math.min(M, a.table.length + b.table.length - toRemove)); var newB = createNode(a.height, newA.table.length - (a.table.length + b.table.length - toRemove)); // Skip the slots with size M. More precise: copy the slot references // to the new node var read = 0; while (get2(a.table, b.table, read).table.length % M === 0) { set2(newA.table, newB.table, read, get2(a.table, b.table, read)); set2(newA.lengths, newB.lengths, read, get2(a.lengths, b.lengths, read)); read++; } // Pulling items from left to right, caching in a slot before writing // it into the new nodes. var write = read; var slot = new createNode(a.height - 1, 0); var from = 0; // If the current slot is still containing data, then there will be at // least one more write, so we do not break this loop yet. while (read - write - (slot.table.length > 0 ? 1 : 0) < toRemove) { // Find out the max possible items for copying. var source = get2(a.table, b.table, read); var to = Math.min(M - slot.table.length, source.table.length); // Copy and adjust size table. slot.table = slot.table.concat(source.table.slice(from, to)); if (slot.height > 0) { var len = slot.lengths.length; for (var i = len; i < len + to - from; i++) { slot.lengths[i] = length(slot.table[i]); slot.lengths[i] += i > 0 ? slot.lengths[i - 1] : 0; } } from += to; // Only proceed to next slots[i] if the current one was // fully copied. if (source.table.length <= to) { read++;from = 0; } // Only create a new slot if the current one is filled up. if (slot.table.length === M) { saveSlot(newA, newB, write, slot); slot = createNode(a.height - 1, 0); write++; } } // Cleanup after the loop. Copy the last slot into the new nodes. if (slot.table.length > 0) { saveSlot(newA, newB, write, slot); write++; } // Shift the untouched slots to the left while (read < a.table.length + b.table.length) { saveSlot(newA, newB, write, get2(a.table, b.table, read)); read++; write++; } return [newA, newB]; } // Navigation functions function botRight(a) { return a.table[a.table.length - 1]; } function botLeft(a) { return a.table[0]; } // Copies a node for updating. Note that you should not use this if // only updating only one of "table" or "lengths" for performance reasons. function nodeCopy(a) { var newA = { ctor: '_Array', height: a.height, table: a.table.slice() }; if (a.height > 0) { newA.lengths = a.lengths.slice(); } return newA; } // Returns how many items are in the tree. function length(array) { if (array.height === 0) { return array.table.length; } else { return array.lengths[array.lengths.length - 1]; } } // Calculates in which slot of "table" the item probably is, then // find the exact slot via forward searching in "lengths". Returns the index. function getSlot(i, a) { var slot = i >> 5 * a.height; while (a.lengths[slot] <= i) { slot++; } return slot; } // Recursively creates a tree with a given height containing // only the given item. function create(item, h) { if (h === 0) { return { ctor: '_Array', height: 0, table: [item] }; } return { ctor: '_Array', height: h, table: [create(item, h - 1)], lengths: [1] }; } // Recursively creates a tree that contains the given tree. function parentise(tree, h) { if (h === tree.height) { return tree; } return { ctor: '_Array', height: h, table: [parentise(tree, h - 1)], lengths: [length(tree)] }; } // Emphasizes blood brotherhood beneath two trees. function siblise(a, b) { return { ctor: '_Array', height: a.height + 1, table: [a, b], lengths: [length(a), length(a) + length(b)] }; } function toJSArray(a) { var jsArray = new Array(length(a)); toJSArray_(jsArray, 0, a); return jsArray; } function toJSArray_(jsArray, i, a) { for (var t = 0; t < a.table.length; t++) { if (a.height === 0) { jsArray[i + t] = a.table[t]; } else { var inc = t === 0 ? 0 : a.lengths[t - 1]; toJSArray_(jsArray, i + inc, a.table[t]); } } } function fromJSArray(jsArray) { if (jsArray.length === 0) { return empty; } var h = Math.floor(Math.log(jsArray.length) / Math.log(M)); return fromJSArray_(jsArray, h, 0, jsArray.length); } function fromJSArray_(jsArray, h, from, to) { if (h === 0) { return { ctor: '_Array', height: 0, table: jsArray.slice(from, to) }; } var step = Math.pow(M, h); var table = new Array(Math.ceil((to - from) / step)); var lengths = new Array(table.length); for (var i = 0; i < table.length; i++) { table[i] = fromJSArray_(jsArray, h - 1, from + i * step, Math.min(from + (i + 1) * step, to)); lengths[i] = length(table[i]) + (i > 0 ? lengths[i - 1] : 0); } return { ctor: '_Array', height: h, table: table, lengths: lengths }; } return { empty: empty, fromList: fromList, toList: toList, initialize: F2(initialize), append: F2(append), push: F2(push), slice: F3(slice), get: F2(get), set: F3(set), map: F2(map), indexedMap: F2(indexedMap), foldl: F3(foldl), foldr: F3(foldr), length: length, toJSArray: toJSArray, fromJSArray: fromJSArray }; }(); //import Native.Utils // var _elm_lang$core$Native_Basics = function () { function div(a, b) { return a / b | 0; } function rem(a, b) { return a % b; } function mod(a, b) { if (b === 0) { throw new Error('Cannot perform mod 0. Division by zero error.'); } var r = a % b; var m = a === 0 ? 0 : b > 0 ? a >= 0 ? r : r + b : -mod(-a, -b); return m === b ? 0 : m; } function logBase(base, n) { return Math.log(n) / Math.log(base); } function negate(n) { return -n; } function abs(n) { return n < 0 ? -n : n; } function min(a, b) { return _elm_lang$core$Native_Utils.cmp(a, b) < 0 ? a : b; } function max(a, b) { return _elm_lang$core$Native_Utils.cmp(a, b) > 0 ? a : b; } function clamp(lo, hi, n) { return _elm_lang$core$Native_Utils.cmp(n, lo) < 0 ? lo : _elm_lang$core$Native_Utils.cmp(n, hi) > 0 ? hi : n; } var ord = ['LT', 'EQ', 'GT']; function compare(x, y) { return { ctor: ord[_elm_lang$core$Native_Utils.cmp(x, y) + 1] }; } function xor(a, b) { return a !== b; } function not(b) { return !b; } function isInfinite(n) { return n === Infinity || n === -Infinity; } function truncate(n) { return n | 0; } function degrees(d) { return d * Math.PI / 180; } function turns(t) { return 2 * Math.PI * t; } function fromPolar(point) { var r = point._0; var t = point._1; return _elm_lang$core$Native_Utils.Tuple2(r * Math.cos(t), r * Math.sin(t)); } function toPolar(point) { var x = point._0; var y = point._1; return _elm_lang$core$Native_Utils.Tuple2(Math.sqrt(x * x + y * y), Math.atan2(y, x)); } return { div: F2(div), rem: F2(rem), mod: F2(mod), pi: Math.PI, e: Math.E, cos: Math.cos, sin: Math.sin, tan: Math.tan, acos: Math.acos, asin: Math.asin, atan: Math.atan, atan2: F2(Math.atan2), degrees: degrees, turns: turns, fromPolar: fromPolar, toPolar: toPolar, sqrt: Math.sqrt, logBase: F2(logBase), negate: negate, abs: abs, min: F2(min), max: F2(max), clamp: F3(clamp), compare: F2(compare), xor: F2(xor), not: not, truncate: truncate, ceiling: Math.ceil, floor: Math.floor, round: Math.round, toFloat: function toFloat(x) { return x; }, isNaN: isNaN, isInfinite: isInfinite }; }(); //import // var _elm_lang$core$Native_Utils = function () { // COMPARISONS function eq(x, y) { var stack = []; var isEqual = eqHelp(x, y, 0, stack); var pair; while (isEqual && (pair = stack.pop())) { isEqual = eqHelp(pair.x, pair.y, 0, stack); } return isEqual; } function eqHelp(x, y, depth, stack) { if (depth > 100) { stack.push({ x: x, y: y }); return true; } if (x === y) { return true; } if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) !== 'object') { if (typeof x === 'function') { throw new Error('Trying to use `(==)` on functions. There is no way to know if functions are "the same" in the Elm sense.' + ' Read more about this at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#==' + ' which describes why it is this way and what the better version will look like.'); } return false; } if (x === null || y === null) { return false; } if (x instanceof Date) { return x.getTime() === y.getTime(); } if (!('ctor' in x)) { for (var key in x) { if (!eqHelp(x[key], y[key], depth + 1, stack)) { return false; } } return true; } // convert Dicts and Sets to lists if (x.ctor === 'RBNode_elm_builtin' || x.ctor === 'RBEmpty_elm_builtin') { x = _elm_lang$core$Dict$toList(x); y = _elm_lang$core$Dict$toList(y); } if (x.ctor === 'Set_elm_builtin') { x = _elm_lang$core$Set$toList(x); y = _elm_lang$core$Set$toList(y); } // check if lists are equal without recursion if (x.ctor === '::') { var a = x; var b = y; while (a.ctor === '::' && b.ctor === '::') { if (!eqHelp(a._0, b._0, depth + 1, stack)) { return false; } a = a._1; b = b._1; } return a.ctor === b.ctor; } // check if Arrays are equal if (x.ctor === '_Array') { var xs = _elm_lang$core$Native_Array.toJSArray(x); var ys = _elm_lang$core$Native_Array.toJSArray(y); if (xs.length !== ys.length) { return false; } for (var i = 0; i < xs.length; i++) { if (!eqHelp(xs[i], ys[i], depth + 1, stack)) { return false; } } return true; } if (!eqHelp(x.ctor, y.ctor, depth + 1, stack)) { return false; } for (var key in x) { if (!eqHelp(x[key], y[key], depth + 1, stack)) { return false; } } return true; } // Code in Generate/JavaScript.hs, Basics.js, and List.js depends on // the particular integer values assigned to LT, EQ, and GT. var LT = -1, EQ = 0, GT = 1; function cmp(x, y) { if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) !== 'object') { return x === y ? EQ : x < y ? LT : GT; } if (x instanceof String) { var a = x.valueOf(); var b = y.valueOf(); return a === b ? EQ : a < b ? LT : GT; } if (x.ctor === '::' || x.ctor === '[]') { while (x.ctor === '::' && y.ctor === '::') { var ord = cmp(x._0, y._0); if (ord !== EQ) { return ord; } x = x._1; y = y._1; } return x.ctor === y.ctor ? EQ : x.ctor === '[]' ? LT : GT; } if (x.ctor.slice(0, 6) === '_Tuple') { var ord; var n = x.ctor.slice(6) - 0; var err = 'cannot compare tuples with more than 6 elements.'; if (n === 0) return EQ; if (n >= 1) { ord = cmp(x._0, y._0);if (ord !== EQ) return ord; if (n >= 2) { ord = cmp(x._1, y._1);if (ord !== EQ) return ord; if (n >= 3) { ord = cmp(x._2, y._2);if (ord !== EQ) return ord; if (n >= 4) { ord = cmp(x._3, y._3);if (ord !== EQ) return ord; if (n >= 5) { ord = cmp(x._4, y._4);if (ord !== EQ) return ord; if (n >= 6) { ord = cmp(x._5, y._5);if (ord !== EQ) return ord; if (n >= 7) throw new Error('Comparison error: ' + err); } } } } } } return EQ; } throw new Error('Comparison error: comparison is only defined on ints, ' + 'floats, times, chars, strings, lists of comparable values, ' + 'and tuples of comparable values.'); } // COMMON VALUES var Tuple0 = { ctor: '_Tuple0' }; function Tuple2(x, y) { return { ctor: '_Tuple2', _0: x, _1: y }; } function chr(c) { return new String(c); } // GUID var count = 0; function guid(_) { return count++; } // RECORDS function update(oldRecord, updatedFields) { var newRecord = {}; for (var key in oldRecord) { newRecord[key] = oldRecord[key]; } for (var key in updatedFields) { newRecord[key] = updatedFields[key]; } return newRecord; } //// LIST STUFF //// var Nil = { ctor: '[]' }; function Cons(hd, tl) { return { ctor: '::', _0: hd, _1: tl }; } function append(xs, ys) { // append Strings if (typeof xs === 'string') { return xs + ys; } // append Lists if (xs.ctor === '[]') { return ys; } var root = Cons(xs._0, Nil); var curr = root; xs = xs._1; while (xs.ctor !== '[]') { curr._1 = Cons(xs._0, Nil); xs = xs._1; curr = curr._1; } curr._1 = ys; return root; } // CRASHES function crash(moduleName, region) { return function (message) { throw new Error('Ran into a `Debug.crash` in module `' + moduleName + '` ' + regionToString(region) + '\n' + 'The message provided by the code author is:\n\n ' + message); }; } function crashCase(moduleName, region, value) { return function (message) { throw new Error('Ran into a `Debug.crash` in module `' + moduleName + '`\n\n' + 'This was caused by the `case` expression ' + regionToString(region) + '.\n' + 'One of the branches ended with a crash and the following value got through:\n\n ' + toString(value) + '\n\n' + 'The message provided by the code author is:\n\n ' + message); }; } function regionToString(region) { if (region.start.line == region.end.line) { return 'on line ' + region.start.line; } return 'between lines ' + region.start.line + ' and ' + region.end.line; } // TO STRING function toString(v) { var type = typeof v === 'undefined' ? 'undefined' : _typeof(v); if (type === 'function') { return '<function>'; } if (type === 'boolean') { return v ? 'True' : 'False'; } if (type === 'number') { return v + ''; } if (v instanceof String) { return '\'' + addSlashes(v, true) + '\''; } if (type === 'string') { return '"' + addSlashes(v, false) + '"'; } if (v === null) { return 'null'; } if (type === 'object' && 'ctor' in v) { var ctorStarter = v.ctor.substring(0, 5); if (ctorStarter === '_Tupl') { var output = []; for (var k in v) { if (k === 'ctor') continue; output.push(toString(v[k])); } return '(' + output.join(',') + ')'; } if (ctorStarter === '_Task') { return '<task>'; } if (v.ctor === '_Array') { var list = _elm_lang$core$Array$toList(v); return 'Array.fromList ' + toString(list); } if (v.ctor === '<decoder>') { return '<decoder>'; } if (v.ctor === '_Process') { return '<process:' + v.id + '>'; } if (v.ctor === '::') { var output = '[' + toString(v._0); v = v._1; while (v.ctor === '::') { output += ',' + toString(v._0); v = v._1; } return output + ']'; } if (v.ctor === '[]') { return '[]'; } if (v.ctor === 'Set_elm_builtin') { return 'Set.fromList ' + toString(_elm_lang$core$Set$toList(v)); } if (v.ctor === 'RBNode_elm_builtin' || v.ctor === 'RBEmpty_elm_builtin') { return 'Dict.fromList ' + toString(_elm_lang$core$Dict$toList(v)); } var output = ''; for (var i in v) { if (i === 'ctor') continue; var str = toString(v[i]); var c0 = str[0]; var parenless = c0 === '{' || c0 === '(' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0; output += ' ' + (parenless ? str : '(' + str + ')'); } return v.ctor + output; } if (type === 'object') { if (v instanceof Date) { return '<' + v.toString() + '>'; } if (v.elm_web_socket) { return '<websocket>'; } var output = []; for (var k in v) { output.push(k + ' = ' + toString(v[k])); } if (output.length === 0) { return '{}'; } return '{ ' + output.join(', ') + ' }'; } return '<internal structure>'; } function addSlashes(str, isChar) { var s = str.replace(/\\/g, '\\\\').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/\v/g, '\\v').replace(/\0/g, '\\0'); if (isChar) { return s.replace(/\'/g, '\\\''); } else { return s.replace(/\"/g, '\\"'); } } return { eq: eq, cmp: cmp, Tuple0: Tuple0, Tuple2: Tuple2, chr: chr, update: update, guid: guid, append: F2(append), crash: crash, crashCase: crashCase, toString: toString }; }(); var _elm_lang$core$Basics$never = function _elm_lang$core$Basics$never(_p0) { never: while (true) { var _p1 = _p0; var _v1 = _p1._0; _p0 = _v1; continue never; } }; var _elm_lang$core$Basics$uncurry = F2(function (f, _p2) { var _p3 = _p2; return A2(f, _p3._0, _p3._1); }); var _elm_lang$core$Basics$curry = F3(function (f, a, b) { return f({ ctor: '_Tuple2', _0: a, _1: b }); }); var _elm_lang$core$Basics$flip = F3(function (f, b, a) { return A2(f, a, b); }); var _elm_lang$core$Basics$always = F2(function (a, _p4) { return a; }); var _elm_lang$core$Basics$identity = function _elm_lang$core$Basics$identity(x) { return x; }; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['<|'] = F2(function (f, x) { return f(x); }); var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['|>'] = F2(function (x, f) { return f(x); }); var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['>>'] = F3(function (f, g, x) { return g(f(x)); }); var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['<<'] = F3(function (g, f, x) { return g(f(x)); }); var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['++'] = _elm_lang$core$Native_Utils.append; var _elm_lang$core$Basics$toString = _elm_lang$core$Native_Utils.toString; var _elm_lang$core$Basics$isInfinite = _elm_lang$core$Native_Basics.isInfinite; var _elm_lang$core$Basics$isNaN = _elm_lang$core$Native_Basics.isNaN; var _elm_lang$core$Basics$toFloat = _elm_lang$core$Native_Basics.toFloat; var _elm_lang$core$Basics$ceiling = _elm_lang$core$Native_Basics.ceiling; var _elm_lang$core$Basics$floor = _elm_lang$core$Native_Basics.floor; var _elm_lang$core$Basics$truncate = _elm_lang$core$Native_Basics.truncate; var _elm_lang$core$Basics$round = _elm_lang$core$Native_Basics.round; var _elm_lang$core$Basics$not = _elm_lang$core$Native_Basics.not; var _elm_lang$core$Basics$xor = _elm_lang$core$Native_Basics.xor; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['||'] = _elm_lang$core$Native_Basics.or; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['&&'] = _elm_lang$core$Native_Basics.and; var _elm_lang$core$Basics$max = _elm_lang$core$Native_Basics.max; var _elm_lang$core$Basics$min = _elm_lang$core$Native_Basics.min; var _elm_lang$core$Basics$compare = _elm_lang$core$Native_Basics.compare; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['>='] = _elm_lang$core$Native_Basics.ge; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['<='] = _elm_lang$core$Native_Basics.le; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['>'] = _elm_lang$core$Native_Basics.gt; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['<'] = _elm_lang$core$Native_Basics.lt; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['/='] = _elm_lang$core$Native_Basics.neq; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['=='] = _elm_lang$core$Native_Basics.eq; var _elm_lang$core$Basics$e = _elm_lang$core$Native_Basics.e; var _elm_lang$core$Basics$pi = _elm_lang$core$Native_Basics.pi; var _elm_lang$core$Basics$clamp = _elm_lang$core$Native_Basics.clamp; var _elm_lang$core$Basics$logBase = _elm_lang$core$Native_Basics.logBase; var _elm_lang$core$Basics$abs = _elm_lang$core$Native_Basics.abs; var _elm_lang$core$Basics$negate = _elm_lang$core$Native_Basics.negate; var _elm_lang$core$Basics$sqrt = _elm_lang$core$Native_Basics.sqrt; var _elm_lang$core$Basics$atan2 = _elm_lang$core$Native_Basics.atan2; var _elm_lang$core$Basics$atan = _elm_lang$core$Native_Basics.atan; var _elm_lang$core$Basics$asin = _elm_lang$core$Native_Basics.asin; var _elm_lang$core$Basics$acos = _elm_lang$core$Native_Basics.acos; var _elm_lang$core$Basics$tan = _elm_lang$core$Native_Basics.tan; var _elm_lang$core$Basics$sin = _elm_lang$core$Native_Basics.sin; var _elm_lang$core$Basics$cos = _elm_lang$core$Native_Basics.cos; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['^'] = _elm_lang$core$Native_Basics.exp; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['%'] = _elm_lang$core$Native_Basics.mod; var _elm_lang$core$Basics$rem = _elm_lang$core$Native_Basics.rem; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['//'] = _elm_lang$core$Native_Basics.div; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['/'] = _elm_lang$core$Native_Basics.floatDiv; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['*'] = _elm_lang$core$Native_Basics.mul; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['-'] = _elm_lang$core$Native_Basics.sub; var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; _elm_lang$core$Basics_ops['+'] = _elm_lang$core$Native_Basics.add; var _elm_lang$core$Basics$toPolar = _elm_lang$core$Native_Basics.toPolar; var _elm_lang$core$Basics$fromPolar = _elm_lang$core$Native_Basics.fromPolar; var _elm_lang$core$Basics$turns = _elm_lang$core$Native_Basics.turns; var _elm_lang$core$Basics$degrees = _elm_lang$core$Native_Basics.degrees; var _elm_lang$core$Basics$radians = function _elm_lang$core$Basics$radians(t) { return t; }; var _elm_lang$core$Basics$GT = { ctor: 'GT' }; var _elm_lang$core$Basics$EQ = { ctor: 'EQ' }; var _elm_lang$core$Basics$LT = { ctor: 'LT' }; var _elm_lang$core$Basics$JustOneMore = function _elm_lang$core$Basics$JustOneMore(a) { return { ctor: 'JustOneMore', _0: a }; }; var _elm_lang$core$Maybe$withDefault = F2(function ($default, maybe) { var _p0 = maybe; if (_p0.ctor === 'Just') { return _p0._0; } else { return $default; } }); var _elm_lang$core$Maybe$Nothing = { ctor: 'Nothing' }; var _elm_lang$core$Maybe$andThen = F2(function (callback, maybeValue) { var _p1 = maybeValue; if (_p1.ctor === 'Just') { return callback(_p1._0); } else { return _elm_lang$core$Maybe$Nothing; } }); var _elm_lang$core$Maybe$Just = function _elm_lang$core$Maybe$Just(a) { return { ctor: 'Just', _0: a }; }; var _elm_lang$core$Maybe$map = F2(function (f, maybe) { var _p2 = maybe; if (_p2.ctor === 'Just') { return _elm_lang$core$Maybe$Just(f(_p2._0)); } else { return _elm_lang$core$Maybe$Nothing; } }); var _elm_lang$core$Maybe$map2 = F3(function (func, ma, mb) { var _p3 = { ctor: '_Tuple2', _0: ma, _1: mb }; if (_p3.ctor === '_Tuple2' && _p3._0.ctor === 'Just' && _p3._1.ctor === 'Just') { return _elm_lang$core$Maybe$Just(A2(func, _p3._0._0, _p3._1._0)); } else { return _elm_lang$core$Maybe$Nothing; } }); var _elm_lang$core$Maybe$map3 = F4(function (func, ma, mb, mc) { var _p4 = { ctor: '_Tuple3', _0: ma, _1: mb, _2: mc }; if (_p4.ctor === '_Tuple3' && _p4._0.ctor === 'Just' && _p4._1.ctor === 'Just' && _p4._2.ctor === 'Just') { return _elm_lang$core$Maybe$Just(A3(func, _p4._0._0, _p4._1._0, _p4._2._0)); } else { return _elm_lang$core$Maybe$Nothing; } }); var _elm_lang$core$Maybe$map4 = F5(function (func, ma, mb, mc, md) { var _p5 = { ctor: '_Tuple4', _0: ma, _1: mb, _2: mc, _3: md }; if (_p5.ctor === '_Tuple4' && _p5._0.ctor === 'Just' && _p5._1.ctor === 'Just' && _p5._2.ctor === 'Just' && _p5._3.ctor === 'Just') { return _elm_lang$core$Maybe$Just(A4(func, _p5._0._0, _p5._1._0, _p5._2._0, _p5._3._0)); } else { return _elm_lang$core$Maybe$Nothing; } }); var _elm_lang$core$Maybe$map5 = F6(function (func, ma, mb, mc, md, me) { var _p6 = { ctor: '_Tuple5', _0: ma, _1: mb, _2: mc, _3: md, _4: me }; if (_p6.ctor === '_Tuple5' && _p6._0.ctor === 'Just' && _p6._1.ctor === 'Just' && _p6._2.ctor === 'Just' && _p6._3.ctor === 'Just' && _p6._4.ctor === 'Just') { return _elm_lang$core$Maybe$Just(A5(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0, _p6._4._0)); } else { return _elm_lang$core$Maybe$Nothing; } }); //import Native.Utils // var _elm_lang$core$Native_List = function () { var Nil = { ctor: '[]' }; function Cons(hd, tl) { return { ctor: '::', _0: hd, _1: tl }; } function fromArray(arr) { var out = Nil; for (var i = arr.length; i--;) { out = Cons(arr[i], out); } return out; } function toArray(xs) { var out = []; while (xs.ctor !== '[]') { out.push(xs._0); xs = xs._1; } return out; } function foldr(f, b, xs) { var arr = toArray(xs); var acc = b; for (var i = arr.length; i--;) { acc = A2(f, arr[i], acc); } return acc; } function map2(f, xs, ys) { var arr = []; while (xs.ctor !== '[]' && ys.ctor !== '[]') { arr.push(A2(f, xs._0, ys._0)); xs = xs._1; ys = ys._1; } return fromArray(arr); } function map3(f, xs, ys, zs) { var arr = []; while (xs.ctor !== '[]' && ys.ctor !== '[]' && zs.ctor !== '[]') { arr.push(A3(f, xs._0, ys._0, zs._0)); xs = xs._1; ys = ys._1; zs = zs._1; } return fromArray(arr); } function map4(f, ws, xs, ys, zs) { var arr = []; while (ws.ctor !== '[]' && xs.ctor !== '[]' && ys.ctor !== '[]' && zs.ctor !== '[]') { arr.push(A4(f, ws._0, xs._0, ys._0, zs._0)); ws = ws._1; xs = xs._1; ys = ys._1; zs = zs._1; } return fromArray(arr); } function map5(f, vs, ws, xs, ys, zs) { var arr = []; while (vs.ctor !== '[]' && ws.ctor !== '[]' && xs.ctor !== '[]' && ys.ctor !== '[]' && zs.ctor !== '[]') { arr.push(A5(f, vs._0, ws._0, xs._0, ys._0, zs._0)); vs = vs._1; ws = ws._1; xs = xs._1; ys = ys._1; zs = zs._1; } return fromArray(arr); } function sortBy(f, xs) { return fromArray(toArray(xs).sort(function (a, b) { return _elm_lang$core$Native_Utils.cmp(f(a), f(b)); })); } function sortWith(f, xs) { return fromArray(toArray(xs).sort(function (a, b) { var ord = f(a)(b).ctor; return ord === 'EQ' ? 0 : ord === 'LT' ? -1 : 1; })); } return { Nil: Nil, Cons: Cons, cons: F2(Cons), toArray: toArray, fromArray: fromArray, foldr: F3(foldr), map2: F3(map2), map3: F4(map3), map4: F5(map4), map5: F6(map5), sortBy: F2(sortBy), sortWith: F2(sortWith) }; }(); var _elm_lang$core$List$sortWith = _elm_lang$core$Native_List.sortWith; var _elm_lang$core$List$sortBy = _elm_lang$core$Native_List.sortBy; var _elm_lang$core$List$sort = function _elm_lang$core$List$sort(xs) { return A2(_elm_lang$core$List$sortBy, _elm_lang$core$Basics$identity, xs); }; var _elm_lang$core$List$singleton = function _elm_lang$core$List$singleton(value) { return { ctor: '::', _0: value, _1: { ctor: '[]' } }; }; var _elm_lang$core$List$drop = F2(function (n, list) { drop: while (true) { if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { return list; } else { var _p0 = list; if (_p0.ctor === '[]') { return list; } else { var _v1 = n - 1, _v2 = _p0._1; n = _v1; list = _v2; continue drop; } } } }); var _elm_lang$core$List$map5 = _elm_lang$core$Native_List.map5; var _elm_lang$core$List$map4 = _elm_lang$core$Native_List.map4; var _elm_lang$core$List$map3 = _elm_lang$core$Native_List.map3; var _elm_lang$core$List$map2 = _elm_lang$core$Native_List.map2; var _elm_lang$core$List$any = F2(function (isOkay, list) { any: while (true) { var _p1 = list; if (_p1.ctor === '[]') { return false; } else { if (isOkay(_p1._0)) { return true; } else { var _v4 = isOkay, _v5 = _p1._1; isOkay = _v4; list = _v5; continue any; } } } }); var _elm_lang$core$List$all = F2(function (isOkay, list) { return !A2(_elm_lang$core$List$any, function (_p2) { return !isOkay(_p2); }, list); }); var _elm_lang$core$List$foldr = _elm_lang$core$Native_List.foldr; var _elm_lang$core$List$foldl = F3(function (func, acc, list) { foldl: while (true) { var _p3 = list; if (_p3.ctor === '[]') { return acc; } else { var _v7 = func, _v8 = A2(func, _p3._0, acc), _v9 = _p3._1; func = _v7; acc = _v8; list = _v9; continue foldl; } } }); var _elm_lang$core$List$length = function _elm_lang$core$List$length(xs) { return A3(_elm_lang$core$List$foldl, F2(function (_p4, i) { return i + 1; }), 0, xs); }; var _elm_lang$core$List$sum = function _elm_lang$core$List$sum(numbers) { return A3(_elm_lang$core$List$foldl, F2(function (x, y) { return x + y; }), 0, numbers); }; var _elm_lang$core$List$product = function _elm_lang$core$List$product(numbers) { return A3(_elm_lang$core$List$foldl, F2(function (x, y) { return x * y; }), 1, numbers); }; var _elm_lang$core$List$maximum = function _elm_lang$core$List$maximum(list) { var _p5 = list; if (_p5.ctor === '::') { return _elm_lang$core$Maybe$Just(A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$max, _p5._0, _p5._1)); } else { return _elm_lang$core$Maybe$Nothing; } }; var _elm_lang$core$List$minimum = function _elm_lang$core$List$minimum(list) { var _p6 = list; if (_p6.ctor === '::') { return _elm_lang$core$Maybe$Just(A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$min, _p6._0, _p6._1)); } else { return _elm_lang$core$Maybe$Nothing; } }; var _elm_lang$core$List$member = F2(function (x, xs) { return A2(_elm_lang$core$List$any, function (a) { return _elm_lang$core$Native_Utils.eq(a, x); }, xs); }); var _elm_lang$core$List$isEmpty = function _elm_lang$core$List$isEmpty(xs) { var _p7 = xs; if (_p7.ctor === '[]') { return true; } else { return false; } }; var _elm_lang$core$List$tail = function _elm_lang$core$List$tail(list) { var _p8 = list; if (_p8.ctor === '::') { return _elm_lang$core$Maybe$Just(_p8._1); } else { return _elm_lang$core$Maybe$Nothing; } }; var _elm_lang$core$List$head = function _elm_lang$core$List$head(list) { var _p9 = list; if (_p9.ctor === '::') { return _elm_lang$core$Maybe$Just(_p9._0); } else { return _elm_lang$core$Maybe$Nothing; } }; var _elm_lang$core$List_ops = _elm_lang$core$List_ops || {}; _elm_lang$core$List_ops['::'] = _elm_lang$core$Native_List.cons; var _elm_lang$core$List$map = F2(function (f, xs) { return A3(_elm_lang$core$List$foldr, F2(function (x, acc) { return { ctor: '::', _0: f(x), _1: acc }; }), { ctor: '[]' }, xs); }); var _elm_lang$core$List$filter = F2(function (pred, xs) { var conditionalCons = F2(function (front, back) { return pred(front) ? { ctor: '::', _0: front, _1: back } : back; }); return A3(_elm_lang$core$List$foldr, conditionalCons, { ctor: '[]' }, xs); }); var _elm_lang$core$List$maybeCons = F3(function (f, mx, xs) { var _p10 = f(mx); if (_p10.ctor === 'Just') { return { ctor: '::', _0: _p10._0, _1: xs }; } else { return xs; } }); var _elm_lang$core$List$filterMap = F2(function (f, xs) { return A3(_elm_lang$core$List$foldr, _elm_lang$core$List$maybeCons(f), { ctor: '[]' }, xs); }); var _elm_lang$core$List$reverse = function _elm_lang$core$List$reverse(list) { return A3(_elm_lang$core$List$foldl, F2(function (x, y) { return { ctor: '::', _0: x, _1: y }; }), { ctor: '[]' }, list); }; var _elm_lang$core$List$scanl = F3(function (f, b, xs) { var scan1 = F2(function (x, accAcc) { var _p11 = accAcc; if (_p11.ctor === '::') { return { ctor: '::', _0: A2(f, x, _p11._0), _1: accAcc }; } else { return { ctor: '[]' }; } }); return _elm_lang$core$List$reverse(A3(_elm_lang$core$List$foldl, scan1, { ctor: '::', _0: b, _1: { ctor: '[]' } }, xs)); }); var _elm_lang$core$List$append = F2(function (xs, ys) { var _p12 = ys; if (_p12.ctor === '[]') { return xs; } else { return A3(_elm_lang$core$List$foldr, F2(function (x, y) { return { ctor: '::', _0: x, _1: y }; }), ys, xs); } }); var _elm_lang$core$List$concat = function _elm_lang$core$List$concat(lists) { return A3(_elm_lang$core$List$foldr, _elm_lang$core$List$append, { ctor: '[]' }, lists); }; var _elm_lang$core$List$concatMap = F2(function (f, list) { return _elm_lang$core$List$concat(A2(_elm_lang$core$List$map, f, list)); }); var _elm_lang$core$List$partition = F2(function (pred, list) { var step = F2(function (x, _p13) { var _p14 = _p13; var _p16 = _p14._0; var _p15 = _p14._1; return pred(x) ? { ctor: '_Tuple2', _0: { ctor: '::', _0: x, _1: _p16 }, _1: _p15 } : { ctor: '_Tuple2', _0: _p16, _1: { ctor: '::', _0: x, _1: _p15 } }; }); return A3(_elm_lang$core$List$foldr, step, { ctor: '_Tuple2', _0: { ctor: '[]' }, _1: { ctor: '[]' } }, list); }); var _elm_lang$core$List$unzip = function _elm_lang$core$List$unzip(pairs) { var step = F2(function (_p18, _p17) { var _p19 = _p18; var _p20 = _p17; return { ctor: '_Tuple2', _0: { ctor: '::', _0: _p19._0, _1: _p20._0 }, _1: { ctor: '::', _0: _p19._1, _1: _p20._1 } }; }); return A3(_elm_lang$core$List$foldr, step, { ctor: '_Tuple2', _0: { ctor: '[]' }, _1: { ctor: '[]' } }, pairs); }; var _elm_lang$core$List$intersperse = F2(function (sep, xs) { var _p21 = xs; if (_p21.ctor === '[]') { return { ctor: '[]' }; } else { var step = F2(function (x, rest) { return { ctor: '::', _0: sep, _1: { ctor: '::', _0: x, _1: rest } }; }); var spersed = A3(_elm_lang$core$List$foldr, step, { ctor: '[]' }, _p21._1); return { ctor: '::', _0: _p21._0, _1: spersed }; } }); var _elm_lang$core$List$takeReverse = F3(function (n, list, taken) { takeReverse: while (true) { if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { return taken; } else { var _p22 = list; if (_p22.ctor === '[]') { return taken; } else { var _v23 = n - 1, _v24 = _p22._1, _v25 = { ctor: '::', _0: _p22._0, _1: taken }; n = _v23; list = _v24; taken = _v25; continue takeReverse; } } } }); var _elm_lang$core$List$takeTailRec = F2(function (n, list) { return _elm_lang$core$List$reverse(A3(_elm_lang$core$List$takeReverse, n, list, { ctor: '[]' })); }); var _elm_lang$core$List$takeFast = F3(function (ctr, n, list) { if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { return { ctor: '[]' }; } else { var _p23 = { ctor: '_Tuple2', _0: n, _1: list }; _v26_5: do { _v26_1: do { if (_p23.ctor === '_Tuple2') { if (_p23._1.ctor === '[]') { return list; } else { if (_p23._1._1.ctor === '::') { switch (_p23._0) { case 1: break _v26_1; case 2: return { ctor: '::', _0: _p23._1._0, _1: { ctor: '::', _0: _p23._1._1._0, _1: { ctor: '[]' } } }; case 3: if (_p23._1._1._1.ctor === '::') { return { ctor: '::', _0: _p23._1._0, _1: { ctor: '::', _0: _p23._1._1._0, _1: { ctor: '::', _0: _p23._1._1._1._0, _1: { ctor: '[]' } } } }; } else { break _v26_5; } default: if (_p23._1._1._1.ctor === '::' && _p23._1._1._1._1.ctor === '::') { var _p28 = _p23._1._1._1._0; var _p27 = _p23._1._1._0; var _p26 = _p23._1._0; var _p25 = _p23._1._1._1._1._0; var _p24 = _p23._1._1._1._1._1; return _elm_lang$core$Native_Utils.cmp(ctr, 1000) > 0 ? { ctor: '::', _0: _p26, _1: { ctor: '::', _0: _p27, _1: { ctor: '::', _0: _p28, _1: { ctor: '::', _0: _p25, _1: A2(_elm_lang$core$List$takeTailRec, n - 4, _p24) } } } } : { ctor: '::', _0: _p26, _1: { ctor: '::', _0: _p27, _1: { ctor: '::', _0: _p28, _1: { ctor: '::', _0: _p25, _1: A3(_elm_lang$core$List$takeFast, ctr + 1, n - 4, _p24) } } } }; } else { break _v26_5; } } } else { if (_p23._0 === 1) { break _v26_1; } else { break _v26_5; } } } } else { break _v26_5; } } while (false); return { ctor: '::', _0: _p23._1._0, _1: { ctor: '[]' } }; } while (false); return list; } }); var _elm_lang$core$List$take = F2(function (n, list) { return A3(_elm_lang$core$List$takeFast, 0, n, list); }); var _elm_lang$core$List$repeatHelp = F3(function (result, n, value) { repeatHelp: while (true) { if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { return result; } else { var _v27 = { ctor: '::', _0: value, _1: result }, _v28 = n - 1, _v29 = value; result = _v27; n = _v28; value = _v29; continue repeatHelp; } } }); var _elm_lang$core$List$repeat = F2(function (n, value) { return A3(_elm_lang$core$List$repeatHelp, { ctor: '[]' }, n, value); }); var _elm_lang$core$List$rangeHelp = F3(function (lo, hi, list) { rangeHelp: while (true) { if (_elm_lang$core$Native_Utils.cmp(lo, hi) < 1) { var _v30 = lo, _v31 = hi - 1, _v32 = { ctor: '::', _0: hi, _1: list }; lo = _v30; hi = _v31; list = _v32; continue rangeHelp; } else { return list; } } }); var _elm_lang$core$List$range = F2(function (lo, hi) { return A3(_elm_lang$core$List$rangeHelp, lo, hi, { ctor: '[]' }); }); var _elm_lang$core$List$indexedMap = F2(function (f, xs) { return A3(_elm_lang$core$List$map2, f, A2(_elm_lang$core$List$range, 0, _elm_lang$core$List$length(xs) - 1), xs); }); var _elm_lang$core$Array$append = _elm_lang$core$Native_Array.append; var _elm_lang$core$Array$length = _elm_lang$core$Native_Array.length; var _elm_lang$core$Array$isEmpty = function _elm_lang$core$Array$isEmpty(array) { return _elm_lang$core$Native_Utils.eq(_elm_lang$core$Array$length(array), 0); }; var _elm_lang$core$Array$slice = _elm_lang$core$Native_Array.slice; var _elm_lang$core$Array$set = _elm_lang$core$Native_Array.set; var _elm_lang$core$Array$get = F2(function (i, array) { return _elm_lang$core$Native_Utils.cmp(0, i) < 1 && _elm_lang$core$Native_Utils.cmp(i, _elm_lang$core$Native_Array.length(array)) < 0 ? _elm_lang$core$Maybe$Just(A2(_elm_lang$core$Native_Array.get, i, array)) : _elm_lang$core$Maybe$Nothing; }); var _elm_lang$core$Array$push = _elm_lang$core$Native_Array.push; var _elm_lang$core$Array$empty = _elm_lang$core$Native_Array.empty; var _elm_lang$core$Array$filter = F2(function (isOkay, arr) { var update = F2(function (x, xs) { return isOkay(x) ? A2(_elm_lang$core$Native_Array.push, x, xs) : xs; }); return A3(_elm_lang$core$Native_Array.foldl, update, _elm_lang$core$Native_Array.empty, arr); }); var _elm_lang$core$Array$foldr = _elm_lang$core$Native_Array.foldr; var _elm_lang$core$Array$foldl = _elm_lang$core$Native_Array.foldl; var _elm_lang$core$Array$indexedMap = _elm_lang$core$Native_Array.indexedMap; var _elm_lang$core$Array$map = _elm_lang$core$Native_Array.map; var _elm_lang$core$Array$toIndexedList = function _elm_lang$core$Array$toIndexedList(array) { return A3(_elm_lang$core$List$map2, F2(function (v0, v1) { return { ctor: '_Tuple2', _0: v0, _1: v1 }; }), A2(_elm_lang$core$List$range, 0, _elm_lang$core$Native_Array.length(array) - 1), _elm_lang$core$Native_Array.toList(array)); }; var _elm_lang$core$Array$toList = _elm_lang$core$Native_Array.toList; var _elm_lang$core$Array$fromList = _elm_lang$core$Native_Array.fromList; var _elm_lang$core$Array$initialize = _elm_lang$core$Native_Array.initialize; var _elm_lang$core$Array$repeat = F2(function (n, e) { return A2(_elm_lang$core$Array$initialize, n, _elm_lang$core$Basics$always(e)); }); var _elm_lang$core$Array$Array = { ctor: 'Array' }; //import Native.Utils // var _elm_lang$core$Native_Debug = function () { function log(tag, value) { var msg = tag + ': ' + _elm_lang$core$Native_Utils.toString(value); var process = process || {}; if (process.stdout) { process.stdout.write(msg); } else { console.log(msg); } return value; } function crash(message) { throw new Error(message); } return { crash: crash, log: F2(log) }; }(); //import Maybe, Native.List, Native.Utils, Result // var _elm_lang$core$Native_String = function () { function isEmpty(str) { return str.length === 0; } function cons(chr, str) { return chr + str; } function uncons(str) { var hd = str[0]; if (hd) { return _elm_lang$core$Maybe$Just(_elm_lang$core$Native_Utils.Tuple2(_elm_lang$core$Native_Utils.chr(hd), str.slice(1))); } return _elm_lang$core$Maybe$Nothing; } function append(a, b) { return a + b; } function concat(strs) { return _elm_lang$core$Native_List.toArray(strs).join(''); } function length(str) { return str.length; } function map(f, str) { var out = str.split(''); for (var i = out.length; i--;) { out[i] = f(_elm_lang$core$Native_Utils.chr(out[i])); } return out.join(''); } function filter(pred, str) { return str.split('').map(_elm_lang$core$Native_Utils.chr).filter(pred).join(''); } function reverse(str) { return str.split('').reverse().join(''); } function foldl(f, b, str) { var len = str.length; for (var i = 0; i < len; ++i) { b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b); } return b; } function foldr(f, b, str) { for (var i = str.length; i--;) { b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b); } return b; } function split(sep, str) { return _elm_lang$core$Native_List.fromArray(str.split(sep)); } function join(sep, strs) { return _elm_lang$core$Native_List.toArray(strs).join(sep); } function repeat(n, str) { var result = ''; while (n > 0) { if (n & 1) { result += str; } n >>= 1, str += str; } return result; } function slice(start, end, str) { return str.slice(start, end); } function left(n, str) { return n < 1 ? '' : str.slice(0, n); } function right(n, str) { return n < 1 ? '' : str.slice(-n); } function dropLeft(n, str) { return n < 1 ? str : str.slice(n); } function dropRight(n, str) { return n < 1 ? str : str.slice(0, -n); } function pad(n, chr, str) { var half = (n - str.length) / 2; return repeat(Math.ceil(half), chr) + str + repeat(half | 0, chr); } function padRight(n, chr, str) { return str + repeat(n - str.length, chr); } function padLeft(n, chr, str) { return repeat(n - str.length, chr) + str; } function trim(str) { return str.trim(); } function trimLeft(str) { return str.replace(/^\s+/, ''); } function trimRight(str) { return str.replace(/\s+$/, ''); } function words(str) { return _elm_lang$core$Native_List.fromArray(str.trim().split(/\s+/g)); } function lines(str) { return _elm_lang$core$Native_List.fromArray(str.split(/\r\n|\r|\n/g)); } function toUpper(str) { return str.toUpperCase(); } function toLower(str) { return str.toLowerCase(); } function any(pred, str) { for (var i = str.length; i--;) { if (pred(_elm_lang$core$Native_Utils.chr(str[i]))) { return true; } } return false; } function all(pred, str) { for (var i = str.length; i--;) { if (!pred(_elm_lang$core$Native_Utils.chr(str[i]))) { return false; } } return true; } function contains(sub, str) { return str.indexOf(sub) > -1; } function startsWith(sub, str) { return str.indexOf(sub) === 0; } function endsWith(sub, str) { return str.length >= sub.length && str.lastIndexOf(sub) === str.length - sub.length; } function indexes(sub, str) { var subLen = sub.length; if (subLen < 1) { return _elm_lang$core$Native_List.Nil; } var i = 0; var is = []; while ((i = str.indexOf(sub, i)) > -1) { is.push(i); i = i + subLen; } return _elm_lang$core$Native_List.fromArray(is); } function toInt(s) { var len = s.length; // if empty if (len === 0) { return intErr(s); } // if hex var c = s[0]; if (c === '0' && s[1] === 'x') { for (var i = 2; i < len; ++i) { var c = s[i]; if ('0' <= c && c <= '9' || 'A' <= c && c <= 'F' || 'a' <= c && c <= 'f') { continue; } return intErr(s); } return _elm_lang$core$Result$Ok(parseInt(s, 16)); } // is decimal if (c > '9' || c < '0' && c !== '-' && c !== '+') { return intErr(s); } for (var i = 1; i < len; ++i) { var c = s[i]; if (c < '0' || '9' < c) { return intErr(s); } } return _elm_lang$core$Result$Ok(parseInt(s, 10)); } function intErr(s) { return _elm_lang$core$Result$Err("could not convert string '" + s + "' to an Int"); } function toFloat(s) { // check if it is a hex, octal, or binary number if (s.length === 0 || /[\sxbo]/.test(s)) { return floatErr(s); } var n = +s; // faster isNaN check return n === n ? _elm_lang$core$Result$Ok(n) : floatErr(s); } function floatErr(s) { return _elm_lang$core$Result$Err("could not convert string '" + s + "' to a Float"); } function toList(str) { return _elm_lang$core$Native_List.fromArray(str.split('').map(_elm_lang$core$Native_Utils.chr)); } function fromList(chars) { return _elm_lang$core$Native_List.toArray(chars).join(''); } return { isEmpty: isEmpty, cons: F2(cons), uncons: uncons, append: F2(append), concat: concat, length: length, map: F2(map), filter: F2(filter), reverse: reverse, foldl: F3(foldl), foldr: F3(foldr), split: F2(split), join: F2(join), repeat: F2(repeat), slice: F3(slice), left: F2(left), right: F2(right), dropLeft: F2(dropLeft), dropRight: F2(dropRight), pad: F3(pad), padLeft: F3(padLeft), padRight: F3(padRight), trim: trim, trimLeft: trimLeft, trimRight: trimRight, words: words, lines: lines, toUpper: toUpper, toLower: toLower, any: F2(any), all: F2(all), contains: F2(contains), startsWith: F2(startsWith), endsWith: F2(endsWith), indexes: F2(indexes), toInt: toInt, toFloat: toFloat, toList: toList, fromList: fromList }; }(); //import Native.Utils // var _elm_lang$core$Native_Char = function () { return { fromCode: function fromCode(c) { return _elm_lang$core$Native_Utils.chr(String.fromCharCode(c)); }, toCode: function toCode(c) { return c.charCodeAt(0); }, toUpper: function toUpper(c) { return _elm_lang$core$Native_Utils.chr(c.toUpperCase()); }, toLower: function toLower(c) { return _elm_lang$core$Native_Utils.chr(c.toLowerCase()); }, toLocaleUpper: function toLocaleUpper(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleUpperCase()); }, toLocaleLower: function toLocaleLower(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleLowerCase()); } }; }(); var _elm_lang$core$Char$fromCode = _elm_lang$core$Native_Char.fromCode; var _elm_lang$core$Char$toCode = _elm_lang$core$Native_Char.toCode; var _elm_lang$core$Char$toLocaleLower = _elm_lang$core$Native_Char.toLocaleLower; var _elm_lang$core$Char$toLocaleUpper = _elm_lang$core$Native_Char.toLocaleUpper; var _elm_lang$core$Char$toLower = _elm_lang$core$Native_Char.toLower; var _elm_lang$core$Char$toUpper = _elm_lang$core$Native_Char.toUpper; var _elm_lang$core$Char$isBetween = F3(function (low, high, $char) { var code = _elm_lang$core$Char$toCode($char); return _elm_lang$core$Native_Utils.cmp(code, _elm_lang$core$Char$toCode(low)) > -1 && _elm_lang$core$Native_Utils.cmp(code, _elm_lang$core$Char$toCode(high)) < 1; }); var _elm_lang$core$Char$isUpper = A2(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('A'), _elm_lang$core$Native_Utils.chr('Z')); var _elm_lang$core$Char$isLower = A2(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('a'), _elm_lang$core$Native_Utils.chr('z')); var _elm_lang$core$Char$isDigit = A2(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('0'), _elm_lang$core$Native_Utils.chr('9')); var _elm_lang$core$Char$isOctDigit = A2(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('0'), _elm_lang$core$Native_Utils.chr('7')); var _elm_lang$core$Char$isHexDigit = function _elm_lang$core$Char$isHexDigit($char) { return _elm_lang$core$Char$isDigit($char) || A3(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('a'), _elm_lang$core$Native_Utils.chr('f'), $char) || A3(_elm_lang$core$Char$isBetween, _elm_lang$core$Native_Utils.chr('A'), _elm_lang$core$Native_Utils.chr('F'), $char); }; var _elm_lang$core$Result$toMaybe = function _elm_lang$core$Result$toMaybe(result) { var _p0 = result; if (_p0.ctor === 'Ok') { return _elm_lang$core$Maybe$Just(_p0._0); } else { return _elm_lang$core$Maybe$Nothing; } }; var _elm_lang$core$Result$withDefault = F2(function (def, result) { var _p1 = result; if (_p1.ctor === 'Ok') { return _p1._0; } else { return def; } }); var _elm_lang$core$Result$Err = function _elm_lang$core$Result$Err(a) { return { ctor: 'Err', _0: a }; }; var _elm_lang$core$Result$andThen = F2(function (callback, result) { var _p2 = result; if (_p2.ctor === 'Ok') { return callback(_p2._0); } else { return _elm_lang$core$Result$Err(_p2._0); } }); var _elm_lang$core$Result$Ok = function _elm_lang$core$Result$Ok(a) { return { ctor: 'Ok', _0: a }; }; var _elm_lang$core$Result$map = F2(function (func, ra) { var _p3 = ra; if (_p3.ctor === 'Ok') { return _elm_lang$core$Result$Ok(func(_p3._0)); } else { return _elm_lang$core$Result$Err(_p3._0); } }); var _elm_lang$core$Result$map2 = F3(function (func, ra, rb) { var _p4 = { ctor: '_Tuple2', _0: ra, _1: rb }; if (_p4._0.ctor === 'Ok') { if (_p4._1.ctor === 'Ok') { return _elm_lang$core$Result$Ok(A2(func, _p4._0._0, _p4._1._0)); } else { return _elm_lang$core$Result$Err(_p4._1._0); } } else { return _elm_lang$core$Result$Err(_p4._0._0); } }); var _elm_lang$core$Result$map3 = F4(function (func, ra, rb, rc) { var _p5 = { ctor: '_Tuple3', _0: ra, _1: rb, _2: rc }; if (_p5._0.ctor === 'Ok') { if (_p5._1.ctor === 'Ok') { if (_p5._2.ctor === 'Ok') { return _elm_lang$core$Result$Ok(A3(func, _p5._0._0, _p5._1._0, _p5._2._0)); } else { return _elm_lang$core$Result$Err(_p5._2._0); } } else { return _elm_lang$core$Result$Err(_p5._1._0); } } else { return _elm_lang$core$Result$Err(_p5._0._0); } }); var _elm_lang$core$Result$map4 = F5(function (func, ra, rb, rc, rd) { var _p6 = { ctor: '_Tuple4', _0: ra, _1: rb, _2: rc, _3: rd }; if (_p6._0.ctor === 'Ok') { if (_p6._1.ctor === 'Ok') { if (_p6._2.ctor === 'Ok') { if (_p6._3.ctor === 'Ok') { return _elm_lang$core$Result$Ok(A4(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0)); } else { return _elm_lang$core$Result$Err(_p6._3._0); } } else { return _elm_lang$core$Result$Err(_p6._2._0); } } else { return _elm_lang$core$Result$Err(_p6._1._0); } } else { return _elm_lang$core$Result$Err(_p6._0._0); } }); var _elm_lang$core$Result$map5 = F6(function (func, ra, rb, rc, rd, re) { var _p7 = { ctor: '_Tuple5', _0: ra, _1: rb, _2: rc, _3: rd, _4: re }; if (_p7._0.ctor === 'Ok') { if (_p7._1.ctor === 'Ok') { if (_p7._2.ctor === 'Ok') { if (_p7._3.ctor === 'Ok') { if (_p7._4.ctor === 'Ok') { return _elm_lang$core$Result$Ok(A5(func, _p7._0._0, _p7._1._0, _p7._2._0, _p7._3._0, _p7._4._0)); } else { return _elm_lang$core$Result$Err(_p7._4._0); } } else { return _elm_lang$core$Result$Err(_p7._3._0); } } else { return _elm_lang$core$Result$Err(_p7._2._0); } } else { return _elm_lang$core$Result$Err(_p7._1._0); } } else { return _elm_lang$core$Result$Err(_p7._0._0); } }); var _elm_lang$core$Result$mapError = F2(function (f, result) { var _p8 = result; if (_p8.ctor === 'Ok') { return _elm_lang$core$Result$Ok(_p8._0); } else { return _elm_lang$core$Result$Err(f(_p8._0)); } }); var _elm_lang$core$Result$fromMaybe = F2(function (err, maybe) { var _p9 = maybe; if (_p9.ctor === 'Just') { return _elm_lang$core$Result$Ok(_p9._0); } else { return _elm_lang$core$Result$Err(err); } }); var _elm_lang$core$String$fromList = _elm_lang$core$Native_String.fromList; var _elm_lang$core$String$toList = _elm_lang$core$Native_String.toList; var _elm_lang$core$String$toFloat = _elm_lang$core$Native_String.toFloat; var _elm_lang$core$String$toInt = _elm_lang$core$Native_String.toInt; var _elm_lang$core$String$indices = _elm_lang$core$Native_String.indexes; var _elm_lang$core$String$indexes = _elm_lang$core$Native_String.indexes; var _elm_lang$core$String$endsWith = _elm_lang$core$Native_String.endsWith; var _elm_lang$core$String$startsWith = _elm_lang$core$Native_String.startsWith; var _elm_lang$core$String$contains = _elm_lang$core$Native_String.contains; var _elm_lang$core$String$all = _elm_lang$core$Native_String.all; var _elm_lang$core$String$any = _elm_lang$core$Native_String.any; var _elm_lang$core$String$toLower = _elm_lang$core$Native_String.toLower; var _elm_lang$core$String$toUpper = _elm_lang$core$Native_String.toUpper; var _elm_lang$core$String$lines = _elm_lang$core$Native_String.lines; var _elm_lang$core$String$words = _elm_lang$core$Native_String.words; var _elm_lang$core$String$trimRight = _elm_lang$core$Native_String.trimRight; var _elm_lang$core$String$trimLeft = _elm_lang$core$Native_String.trimLeft; var _elm_lang$core$String$trim = _elm_lang$core$Native_String.trim; var _elm_lang$core$String$padRight = _elm_lang$core$Native_String.padRight; var _elm_lang$core$String$padLeft = _elm_lang$core$Native_String.padLeft; var _elm_lang$core$String$pad = _elm_lang$core$Native_String.pad; var _elm_lang$core$String$dropRight = _elm_lang$core$Native_String.dropRight; var _elm_lang$core$String$dropLeft = _elm_lang$core$Native_String.dropLeft; var _elm_lang$core$String$right = _elm_lang$core$Native_String.right; var _elm_lang$core$String$left = _elm_lang$core$Native_String.left; var _elm_lang$core$String$slice = _elm_lang$core$Native_String.slice; var _elm_lang$core$String$repeat = _elm_lang$core$Native_String.repeat; var _elm_lang$core$String$join = _elm_lang$core$Native_String.join; var _elm_lang$core$String$split = _elm_lang$core$Native_String.split; var _elm_lang$core$String$foldr = _elm_lang$core$Native_String.foldr; var _elm_lang$core$String$foldl = _elm_lang$core$Native_String.foldl; var _elm_lang$core$String$reverse = _elm_lang$core$Native_String.reverse; var _elm_lang$core$String$filter = _elm_lang$core$Native_String.filter; var _elm_lang$core$String$map = _elm_lang$core$Native_String.map; var _elm_lang$core$String$length = _elm_lang$core$Native_String.length; var _elm_lang$core$String$concat = _elm_lang$core$Native_String.concat; var _elm_lang$core$String$append = _elm_lang$core$Native_String.append; var _elm_lang$core$String$uncons = _elm_lang$core$Native_String.uncons; var _elm_lang$core$String$cons = _elm_lang$core$Native_String.cons; var _elm_lang$core$String$fromChar = function _elm_lang$core$String$fromChar($char) { return A2(_elm_lang$core$String$cons, $char, ''); }; var _elm_lang$core$String$isEmpty = _elm_lang$core$Native_String.isEmpty; var _elm_lang$core$Dict$foldr = F3(function (f, acc, t) { foldr: while (true) { var _p0 = t; if (_p0.ctor === 'RBEmpty_elm_builtin') { return acc; } else { var _v1 = f, _v2 = A3(f, _p0._1, _p0._2, A3(_elm_lang$core$Dict$foldr, f, acc, _p0._4)), _v3 = _p0._3; f = _v1; acc = _v2; t = _v3; continue foldr; } } }); var _elm_lang$core$Dict$keys = function _elm_lang$core$Dict$keys(dict) { return A3(_elm_lang$core$Dict$foldr, F3(function (key, value, keyList) { return { ctor: '::', _0: key, _1: keyList }; }), { ctor: '[]' }, dict); }; var _elm_lang$core$Dict$values = function _elm_lang$core$Dict$values(dict) { return A3(_elm_lang$core$Dict$foldr, F3(function (key, value, valueList) { return { ctor: '::', _0: value, _1: valueList }; }), { ctor: '[]' }, dict); }; var _elm_lang$core$Dict$toList = function _elm_lang$core$Dict$toList(dict) { return A3(_elm_lang$core$Dict$foldr, F3(function (key, value, list) { return { ctor: '::', _0: { ctor: '_Tuple2', _0: key, _1: value }, _1: list }; }), { ctor: '[]' }, dict); }; var _elm_lang$core$Dict$foldl = F3(function (f, acc, dict) { foldl: while (true) { var _p1 = dict; if (_p1.ctor === 'RBEmpty_elm_builtin') { return acc; } else { var _v5 = f, _v6 = A3(f, _p1._1, _p1._2, A3(_elm_lang$core$Dict$foldl, f, acc, _p1._3)), _v7 = _p1._4; f = _v5; acc = _v6; dict = _v7; continue foldl; } } }); var _elm_lang$core$Dict$merge = F6(function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { var stepState = F3(function (rKey, rValue, _p2) { stepState: while (true) { var _p3 = _p2; var _p9 = _p3._1; var _p8 = _p3._0; var _p4 = _p8; if (_p4.ctor === '[]') { return { ctor: '_Tuple2', _0: _p8, _1: A3(rightStep, rKey, rValue, _p9) }; } else { var _p7 = _p4._1; var _p6 = _p4._0._1; var _p5 = _p4._0._0; if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) < 0) { var _v10 = rKey, _v11 = rValue, _v12 = { ctor: '_Tuple2', _0: _p7, _1: A3(leftStep, _p5, _p6, _p9) }; rKey = _v10; rValue = _v11; _p2 = _v12; continue stepState; } else { if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) > 0) { return { ctor: '_Tuple2', _0: _p8, _1: A3(rightStep, rKey, rValue, _p9) }; } else { return { ctor: '_Tuple2', _0: _p7, _1: A4(bothStep, _p5, _p6, rValue, _p9) }; } } } } }); var _p10 = A3(_elm_lang$core$Dict$foldl, stepState, { ctor: '_Tuple2', _0: _elm_lang$core$Dict$toList(leftDict), _1: initialResult }, rightDict); var leftovers = _p10._0; var intermediateResult = _p10._1; return A3(_elm_lang$core$List$foldl, F2(function (_p11, result) { var _p12 = _p11; return A3(leftStep, _p12._0, _p12._1, result); }), intermediateResult, leftovers); }); var _elm_lang$core$Dict$reportRemBug = F4(function (msg, c, lgot, rgot) { return _elm_lang$core$Native_Debug.crash(_elm_lang$core$String$concat({ ctor: '::', _0: 'Internal red-black tree invariant violated, expected ', _1: { ctor: '::', _0: msg, _1: { ctor: '::', _0: ' and got ', _1: { ctor: '::', _0: _elm_lang$core$Basics$toString(c), _1: { ctor: '::', _0: '/', _1: { ctor: '::', _0: lgot, _1: { ctor: '::', _0: '/', _1: { ctor: '::', _0: rgot, _1: { ctor: '::', _0: '\nPlease report this bug to <https://github.com/elm-lang/core/issues>', _1: { ctor: '[]' } } } } } } } } } })); }); var _elm_lang$core$Dict$isBBlack = function _elm_lang$core$Dict$isBBlack(dict) { var _p13 = dict; _v14_2: do { if (_p13.ctor === 'RBNode_elm_builtin') { if (_p13._0.ctor === 'BBlack') { return true; } else { break _v14_2; } } else { if (_p13._0.ctor === 'LBBlack') { return true; } else { break _v14_2; } } } while (false); return false; }; var _elm_lang$core$Dict$sizeHelp = F2(function (n, dict) { sizeHelp: while (true) { var _p14 = dict; if (_p14.ctor === 'RBEmpty_elm_builtin') { return n; } else { var _v16 = A2(_elm_lang$core$Dict$sizeHelp, n + 1, _p14._4), _v17 = _p14._3; n = _v16; dict = _v17; continue sizeHelp; } } }); var _elm_lang$core$Dict$size = function _elm_lang$core$Dict$size(dict) { return A2(_elm_lang$core$Dict$sizeHelp, 0, dict); }; var _elm_lang$core$Dict$get = F2(function (targetKey, dict) { get: while (true) { var _p15 = dict; if (_p15.ctor === 'RBEmpty_elm_builtin') { return _elm_lang$core$Maybe$Nothing; } else { var _p16 = A2(_elm_lang$core$Basics$compare, targetKey, _p15._1); switch (_p16.ctor) { case 'LT': var _v20 = targetKey, _v21 = _p15._3; targetKey = _v20; dict = _v21; continue get; case 'EQ': return _elm_lang$core$Maybe$Just(_p15._2); default: var _v22 = targetKey, _v23 = _p15._4; targetKey = _v22; dict = _v23; continue get; } } } }); var _elm_lang$core$Dict$member = F2(function (key, dict) { var _p17 = A2(_elm_lang$core$Dict$get, key, dict); if (_p17.ctor === 'Just') { return true; } else { return false; } }); var _elm_lang$core$Dict$maxWithDefault = F3(function (k, v, r) { maxWithDefault: while (true) { var _p18 = r; if (_p18.ctor === 'RBEmpty_elm_builtin') { return { ctor: '_Tuple2', _0: k, _1: v }; } else { var _v26 = _p18._1, _v27 = _p18._2, _v28 = _p18._4; k = _v26; v = _v27; r = _v28; continue maxWithDefault; } } }); var _elm_lang$core$Dict$NBlack = { ctor: 'NBlack' }; var _elm_lang$core$Dict$BBlack = { ctor: 'BBlack' }; var _elm_lang$core$Dict$Black = { ctor: 'Black' }; var _elm_lang$core$Dict$blackish = function _elm_lang$core$Dict$blackish(t) { var _p19 = t; if (_p19.ctor === 'RBNode_elm_builtin') { var _p20 = _p19._0; return _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$Black) || _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$BBlack); } else { return true; } }; var _elm_lang$core$Dict$Red = { ctor: 'Red' }; var _elm_lang$core$Dict$moreBlack = function _elm_lang$core$Dict$moreBlack(color) { var _p21 = color; switch (_p21.ctor) { case 'Black': return _elm_lang$core$Dict$BBlack; case 'Red': return _elm_lang$core$Dict$Black; case 'NBlack': return _elm_lang$core$Dict$Red; default: return _elm_lang$core$Native_Debug.crash('Can\'t make a double black node more black!'); } }; var _elm_lang$core$Dict$lessBlack = function _elm_lang$core$Dict$lessBlack(color) { var _p22 = color; switch (_p22.ctor) { case 'BBlack': return _elm_lang$core$Dict$Black; case 'Black': return _elm_lang$core$Dict$Red; case 'Red': return _elm_lang$core$Dict$NBlack; default: return _elm_lang$core$Native_Debug.crash('Can\'t make a negative black node less black!'); } }; var _elm_lang$core$Dict$LBBlack = { ctor: 'LBBlack' }; var _elm_lang$core$Dict$LBlack = { ctor: 'LBlack' }; var _elm_lang$core$Dict$RBEmpty_elm_builtin = function _elm_lang$core$Dict$RBEmpty_elm_builtin(a) { return { ctor: 'RBEmpty_elm_builtin', _0: a }; }; var _elm_lang$core$Dict$empty = _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); var _elm_lang$core$Dict$isEmpty = function _elm_lang$core$Dict$isEmpty(dict) { return _elm_lang$core$Native_Utils.eq(dict, _elm_lang$core$Dict$empty); }; var _elm_lang$core$Dict$RBNode_elm_builtin = F5(function (a, b, c, d, e) { return { ctor: 'RBNode_elm_builtin', _0: a, _1: b, _2: c, _3: d, _4: e }; }); var _elm_lang$core$Dict$ensureBlackRoot = function _elm_lang$core$Dict$ensureBlackRoot(dict) { var _p23 = dict; if (_p23.ctor === 'RBNode_elm_builtin' && _p23._0.ctor === 'Red') { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p23._1, _p23._2, _p23._3, _p23._4); } else { return dict; } }; var _elm_lang$core$Dict$lessBlackTree = function _elm_lang$core$Dict$lessBlackTree(dict) { var _p24 = dict; if (_p24.ctor === 'RBNode_elm_builtin') { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$lessBlack(_p24._0), _p24._1, _p24._2, _p24._3, _p24._4); } else { return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); } }; var _elm_lang$core$Dict$balancedTree = function _elm_lang$core$Dict$balancedTree(col) { return function (xk) { return function (xv) { return function (yk) { return function (yv) { return function (zk) { return function (zv) { return function (a) { return function (b) { return function (c) { return function (d) { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$lessBlack(col), yk, yv, A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, xk, xv, a, b), A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, zk, zv, c, d)); }; }; }; }; }; }; }; }; }; }; }; var _elm_lang$core$Dict$blacken = function _elm_lang$core$Dict$blacken(t) { var _p25 = t; if (_p25.ctor === 'RBEmpty_elm_builtin') { return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); } else { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p25._1, _p25._2, _p25._3, _p25._4); } }; var _elm_lang$core$Dict$redden = function _elm_lang$core$Dict$redden(t) { var _p26 = t; if (_p26.ctor === 'RBEmpty_elm_builtin') { return _elm_lang$core$Native_Debug.crash('can\'t make a Leaf red'); } else { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, _p26._1, _p26._2, _p26._3, _p26._4); } }; var _elm_lang$core$Dict$balanceHelp = function _elm_lang$core$Dict$balanceHelp(tree) { var _p27 = tree; _v36_6: do { _v36_5: do { _v36_4: do { _v36_3: do { _v36_2: do { _v36_1: do { _v36_0: do { if (_p27.ctor === 'RBNode_elm_builtin') { if (_p27._3.ctor === 'RBNode_elm_builtin') { if (_p27._4.ctor === 'RBNode_elm_builtin') { switch (_p27._3._0.ctor) { case 'Red': switch (_p27._4._0.ctor) { case 'Red': if (_p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Red') { break _v36_0; } else { if (_p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Red') { break _v36_1; } else { if (_p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Red') { break _v36_2; } else { if (_p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Red') { break _v36_3; } else { break _v36_6; } } } } case 'NBlack': if (_p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Red') { break _v36_0; } else { if (_p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Red') { break _v36_1; } else { if (_p27._0.ctor === 'BBlack' && _p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Black' && _p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Black') { break _v36_4; } else { break _v36_6; } } } default: if (_p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Red') { break _v36_0; } else { if (_p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Red') { break _v36_1; } else { break _v36_6; } } } case 'NBlack': switch (_p27._4._0.ctor) { case 'Red': if (_p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Red') { break _v36_2; } else { if (_p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Red') { break _v36_3; } else { if (_p27._0.ctor === 'BBlack' && _p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Black' && _p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Black') { break _v36_5; } else { break _v36_6; } } } case 'NBlack': if (_p27._0.ctor === 'BBlack') { if (_p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Black' && _p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Black') { break _v36_4; } else { if (_p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Black' && _p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Black') { break _v36_5; } else { break _v36_6; } } } else { break _v36_6; } default: if (_p27._0.ctor === 'BBlack' && _p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Black' && _p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Black') { break _v36_5; } else { break _v36_6; } } default: switch (_p27._4._0.ctor) { case 'Red': if (_p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Red') { break _v36_2; } else { if (_p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Red') { break _v36_3; } else { break _v36_6; } } case 'NBlack': if (_p27._0.ctor === 'BBlack' && _p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Black' && _p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Black') { break _v36_4; } else { break _v36_6; } default: break _v36_6; } } } else { switch (_p27._3._0.ctor) { case 'Red': if (_p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Red') { break _v36_0; } else { if (_p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Red') { break _v36_1; } else { break _v36_6; } } case 'NBlack': if (_p27._0.ctor === 'BBlack' && _p27._3._3.ctor === 'RBNode_elm_builtin' && _p27._3._3._0.ctor === 'Black' && _p27._3._4.ctor === 'RBNode_elm_builtin' && _p27._3._4._0.ctor === 'Black') { break _v36_5; } else { break _v36_6; } default: break _v36_6; } } } else { if (_p27._4.ctor === 'RBNode_elm_builtin') { switch (_p27._4._0.ctor) { case 'Red': if (_p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Red') { break _v36_2; } else { if (_p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Red') { break _v36_3; } else { break _v36_6; } } case 'NBlack': if (_p27._0.ctor === 'BBlack' && _p27._4._3.ctor === 'RBNode_elm_builtin' && _p27._4._3._0.ctor === 'Black' && _p27._4._4.ctor === 'RBNode_elm_builtin' && _p27._4._4._0.ctor === 'Black') { break _v36_4; } else { break _v36_6; } default: break _v36_6; } } else { break _v36_6; } } } else { break _v36_6; } } while (false); return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._3._1)(_p27._3._3._2)(_p27._3._1)(_p27._3._2)(_p27._1)(_p27._2)(_p27._3._3._3)(_p27._3._3._4)(_p27._3._4)(_p27._4); } while (false); return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._1)(_p27._3._2)(_p27._3._4._1)(_p27._3._4._2)(_p27._1)(_p27._2)(_p27._3._3)(_p27._3._4._3)(_p27._3._4._4)(_p27._4); } while (false); return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._3._1)(_p27._4._3._2)(_p27._4._1)(_p27._4._2)(_p27._3)(_p27._4._3._3)(_p27._4._3._4)(_p27._4._4); } while (false); return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._1)(_p27._4._2)(_p27._4._4._1)(_p27._4._4._2)(_p27._3)(_p27._4._3)(_p27._4._4._3)(_p27._4._4._4); } while (false); return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._4._3._1, _p27._4._3._2, A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3, _p27._4._3._3), A5(_elm_lang$core$Dict$balance, _elm_lang$core$Dict$Black, _p27._4._1, _p27._4._2, _p27._4._3._4, _elm_lang$core$Dict$redden(_p27._4._4))); } while (false); return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._3._4._1, _p27._3._4._2, A5(_elm_lang$core$Dict$balance, _elm_lang$core$Dict$Black, _p27._3._1, _p27._3._2, _elm_lang$core$Dict$redden(_p27._3._3), _p27._3._4._3), A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3._4._4, _p27._4)); } while (false); return tree; }; var _elm_lang$core$Dict$balance = F5(function (c, k, v, l, r) { var tree = A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r); return _elm_lang$core$Dict$blackish(tree) ? _elm_lang$core$Dict$balanceHelp(tree) : tree; }); var _elm_lang$core$Dict$bubble = F5(function (c, k, v, l, r) { return _elm_lang$core$Dict$isBBlack(l) || _elm_lang$core$Dict$isBBlack(r) ? A5(_elm_lang$core$Dict$balance, _elm_lang$core$Dict$moreBlack(c), k, v, _elm_lang$core$Dict$lessBlackTree(l), _elm_lang$core$Dict$lessBlackTree(r)) : A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r); }); var _elm_lang$core$Dict$removeMax = F5(function (c, k, v, l, r) { var _p28 = r; if (_p28.ctor === 'RBEmpty_elm_builtin') { return A3(_elm_lang$core$Dict$rem, c, l, r); } else { return A5(_elm_lang$core$Dict$bubble, c, k, v, l, A5(_elm_lang$core$Dict$removeMax, _p28._0, _p28._1, _p28._2, _p28._3, _p28._4)); } }); var _elm_lang$core$Dict$rem = F3(function (color, left, right) { var _p29 = { ctor: '_Tuple2', _0: left, _1: right }; if (_p29._0.ctor === 'RBEmpty_elm_builtin') { if (_p29._1.ctor === 'RBEmpty_elm_builtin') { var _p30 = color; switch (_p30.ctor) { case 'Red': return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); case 'Black': return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBBlack); default: return _elm_lang$core$Native_Debug.crash('cannot have bblack or nblack nodes at this point'); } } else { var _p33 = _p29._1._0; var _p32 = _p29._0._0; var _p31 = { ctor: '_Tuple3', _0: color, _1: _p32, _2: _p33 }; if (_p31.ctor === '_Tuple3' && _p31._0.ctor === 'Black' && _p31._1.ctor === 'LBlack' && _p31._2.ctor === 'Red') { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._1._1, _p29._1._2, _p29._1._3, _p29._1._4); } else { return A4(_elm_lang$core$Dict$reportRemBug, 'Black/LBlack/Red', color, _elm_lang$core$Basics$toString(_p32), _elm_lang$core$Basics$toString(_p33)); } } } else { if (_p29._1.ctor === 'RBEmpty_elm_builtin') { var _p36 = _p29._1._0; var _p35 = _p29._0._0; var _p34 = { ctor: '_Tuple3', _0: color, _1: _p35, _2: _p36 }; if (_p34.ctor === '_Tuple3' && _p34._0.ctor === 'Black' && _p34._1.ctor === 'Red' && _p34._2.ctor === 'LBlack') { return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._0._1, _p29._0._2, _p29._0._3, _p29._0._4); } else { return A4(_elm_lang$core$Dict$reportRemBug, 'Black/Red/LBlack', color, _elm_lang$core$Basics$toString(_p35), _elm_lang$core$Basics$toString(_p36)); } } else { var _p40 = _p29._0._2; var _p39 = _p29._0._4; var _p38 = _p29._0._1; var newLeft = A5(_elm_lang$core$Dict$removeMax, _p29._0._0, _p38, _p40, _p29._0._3, _p39); var _p37 = A3(_elm_lang$core$Dict$maxWithDefault, _p38, _p40, _p39); var k = _p37._0; var v = _p37._1; return A5(_elm_lang$core$Dict$bubble, color, k, v, newLeft, right); } } }); var _elm_lang$core$Dict$map = F2(function (f, dict) { var _p41 = dict; if (_p41.ctor === 'RBEmpty_elm_builtin') { return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); } else { var _p42 = _p41._1; return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p41._0, _p42, A2(f, _p42, _p41._2), A2(_elm_lang$core$Dict$map, f, _p41._3), A2(_elm_lang$core$Dict$map, f, _p41._4)); } }); var _elm_lang$core$Dict$Same = { ctor: 'Same' }; var _elm_lang$core$Dict$Remove = { ctor: 'Remove' }; var _elm_lang$core$Dict$Insert = { ctor: 'Insert' }; var _elm_lang$core$Dict$update = F3(function (k, alter, dict) { var up = function up(dict) { var _p43 = dict; if (_p43.ctor === 'RBEmpty_elm_builtin') { var _p44 = alter(_elm_lang$core$Maybe$Nothing); if (_p44.ctor === 'Nothing') { return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: _elm_lang$core$Dict$empty }; } else { return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Insert, _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, k, _p44._0, _elm_lang$core$Dict$empty, _elm_lang$core$Dict$empty) }; } } else { var _p55 = _p43._2; var _p54 = _p43._4; var _p53 = _p43._3; var _p52 = _p43._1; var _p51 = _p43._0; var _p45 = A2(_elm_lang$core$Basics$compare, k, _p52); switch (_p45.ctor) { case 'EQ': var _p46 = alter(_elm_lang$core$Maybe$Just(_p55)); if (_p46.ctor === 'Nothing') { return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Remove, _1: A3(_elm_lang$core$Dict$rem, _p51, _p53, _p54) }; } else { return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p46._0, _p53, _p54) }; } case 'LT': var _p47 = up(_p53); var flag = _p47._0; var newLeft = _p47._1; var _p48 = flag; switch (_p48.ctor) { case 'Same': return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, newLeft, _p54) }; case 'Insert': return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Insert, _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, newLeft, _p54) }; default: return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Remove, _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, newLeft, _p54) }; } default: var _p49 = up(_p54); var flag = _p49._0; var newRight = _p49._1; var _p50 = flag; switch (_p50.ctor) { case 'Same': return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, _p53, newRight) }; case 'Insert': return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Insert, _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, _p53, newRight) }; default: return { ctor: '_Tuple2', _0: _elm_lang$core$Dict$Remove, _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, _p53, newRight) }; } } } }; var _p56 = up(dict); var flag = _p56._0; var updatedDict = _p56._1; var _p57 = flag; switch (_p57.ctor) { case 'Same': return updatedDict; case 'Insert': return _elm_lang$core$Dict$ensureBlackRoot(updatedDict); default: return _elm_lang$core$Dict$blacken(updatedDict); } }); var _elm_lang$core$Dict$insert = F3(function (key, value, dict) { return A3(_elm_lang$core$Dict$update, key, _elm_lang$core$Basics$always(_elm_lang$core$Maybe$Just(value)), dict); }); var _elm_lang$core$Dict$singleton = F2(function (key, value) { return A3(_elm_lang$core$Dict$insert, key, value, _elm_lang$core$Dict$empty); }); var _elm_lang$core$Dict$union = F2(function (t1, t2) { return A3(_elm_lang$core$Dict$foldl, _elm_lang$core$Dict$insert, t2, t1); }); var _elm_lang$core$Dict$filter = F2(function (predicate, dictionary) { var add = F3(function (key, value, dict) { return A2(predicate, key, value) ? A3(_elm_lang$core$Dict$insert, key, value, dict) : dict; }); return A3(_elm_lang$core$Dict$foldl, add, _elm_lang$core$Dict$empty, dictionary); }); var _elm_lang$core$Dict$intersect = F2(function (t1, t2) { return A2(_elm_lang$core$Dict$filter, F2(function (k, _p58) { return A2(_elm_lang$core$Dict$member, k, t2); }), t1); }); var _elm_lang$core$Dict$partition = F2(function (predicate, dict) { var add = F3(function (key, value, _p59) { var _p60 = _p59; var _p62 = _p60._1; var _p61 = _p60._0; return A2(predicate, key, value) ? { ctor: '_Tuple2', _0: A3(_elm_lang$core$Dict$insert, key, value, _p61), _1: _p62 } : { ctor: '_Tuple2', _0: _p61, _1: A3(_elm_lang$core$Dict$insert, key, value, _p62) }; }); return A3(_elm_lang$core$Dict$foldl, add, { ctor: '_Tuple2', _0: _elm_lang$core$Dict$empty, _1: _elm_lang$core$Dict$empty }, dict); }); var _elm_lang$core$Dict$fromList = function _elm_lang$core$Dict$fromList(assocs) { return A3(_elm_lang$core$List$foldl, F2(function (_p63, dict) { var _p64 = _p63; return A3(_elm_lang$core$Dict$insert, _p64._0, _p64._1, dict); }), _elm_lang$core$Dict$empty, assocs); }; var _elm_lang$core$Dict$remove = F2(function (key, dict) { return A3(_elm_lang$core$Dict$update, key, _elm_lang$core$Basics$always(_elm_lang$core$Maybe$Nothing), dict); }); var _elm_lang$core$Dict$diff = F2(function (t1, t2) { return A3(_elm_lang$core$Dict$foldl, F3(function (k, v, t) { return A2(_elm_lang$core$Dict$remove, k, t); }), t1, t2); }); //import Maybe, Native.Array, Native.List, Native.Utils, Result // var _elm_lang$core$Native_Json = function () { // CORE DECODERS function succeed(msg) { return { ctor: '<decoder>', tag: 'succeed', msg: msg }; } function fail(msg) { return { ctor: '<decoder>', tag: 'fail', msg: msg }; } function decodePrimitive(tag) { return { ctor: '<decoder>', tag: tag }; } function decodeContainer(tag, decoder) { return { ctor: '<decoder>', tag: tag, decoder: decoder }; } function decodeNull(value) { return { ctor: '<decoder>', tag: 'null', value: value }; } function decodeField(field, decoder) { return { ctor: '<decoder>', tag: 'field', field: field, decoder: decoder }; } function decodeIndex(index, decoder) { return { ctor: '<decoder>', tag: 'index', index: index, decoder: decoder }; } function decodeKeyValuePairs(decoder) { return { ctor: '<decoder>', tag: 'key-value', decoder: decoder }; } function mapMany(f, decoders) { return { ctor: '<decoder>', tag: 'map-many', func: f, decoders: decoders }; } function andThen(callback, decoder) { return { ctor: '<decoder>', tag: 'andThen', decoder: decoder, callback: callback }; } function oneOf(decoders) { return { ctor: '<decoder>', tag: 'oneOf', decoders: decoders }; } // DECODING OBJECTS function map1(f, d1) { return mapMany(f, [d1]); } function map2(f, d1, d2) { return mapMany(f, [d1, d2]); } function map3(f, d1, d2, d3) { return mapMany(f, [d1, d2, d3]); } function map4(f, d1, d2, d3, d4) { return mapMany(f, [d1, d2, d3, d4]); } function map5(f, d1, d2, d3, d4, d5) { return mapMany(f, [d1, d2, d3, d4, d5]); } function map6(f, d1, d2, d3, d4, d5, d6) { return mapMany(f, [d1, d2, d3, d4, d5, d6]); } function map7(f, d1, d2, d3, d4, d5, d6, d7) { return mapMany(f, [d1, d2, d3, d4, d5, d6, d7]); } function map8(f, d1, d2, d3, d4, d5, d6, d7, d8) { return mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]); } // DECODE HELPERS function ok(value) { return { tag: 'ok', value: value }; } function badPrimitive(type, value) { return { tag: 'primitive', type: type, value: value }; } function badIndex(index, nestedProblems) { return { tag: 'index', index: index, rest: nestedProblems }; } function badField(field, nestedProblems) { return { tag: 'field', field: field, rest: nestedProblems }; } function badIndex(index, nestedProblems) { return { tag: 'index', index: index, rest: nestedProblems }; } function badOneOf(problems) { return { tag: 'oneOf', problems: problems }; } function bad(msg) { return { tag: 'fail', msg: msg }; } function badToString(problem) { var context = '_'; while (problem) { switch (problem.tag) { case 'primitive': return 'Expecting ' + problem.type + (context === '_' ? '' : ' at ' + context) + ' but instead got: ' + jsToString(problem.value); case 'index': context += '[' + problem.index + ']'; problem = problem.rest; break; case 'field': context += '.' + problem.field; problem = problem.rest; break; case 'oneOf': var problems = problem.problems; for (var i = 0; i < problems.length; i++) { problems[i] = badToString(problems[i]); } return 'I ran into the following problems' + (context === '_' ? '' : ' at ' + context) + ':\n\n' + problems.join('\n'); case 'fail': return 'I ran into a `fail` decoder' + (context === '_' ? '' : ' at ' + context) + ': ' + problem.msg; } } } function jsToString(value) { return value === undefined ? 'undefined' : JSON.stringify(value); } // DECODE function runOnString(decoder, string) { var json; try { json = JSON.parse(string); } catch (e) { return _elm_lang$core$Result$Err('Given an invalid JSON: ' + e.message); } return run(decoder, json); } function run(decoder, value) { var result = runHelp(decoder, value); return result.tag === 'ok' ? _elm_lang$core$Result$Ok(result.value) : _elm_lang$core$Result$Err(badToString(result)); } function runHelp(decoder, value) { switch (decoder.tag) { case 'bool': return typeof value === 'boolean' ? ok(value) : badPrimitive('a Bool', value); case 'int': if (typeof value !== 'number') { return badPrimitive('an Int', value); } if (-2147483647 < value && value < 2147483647 && (value | 0) === value) { return ok(value); } if (isFinite(value) && !(value % 1)) { return ok(value); } return badPrimitive('an Int', value); case 'float': return typeof value === 'number' ? ok(value) : badPrimitive('a Float', value); case 'string': return typeof value === 'string' ? ok(value) : value instanceof String ? ok(value + '') : badPrimitive('a String', value); case 'null': return value === null ? ok(decoder.value) : badPrimitive('null', value); case 'value': return ok(value); case 'list': if (!(value instanceof Array)) { return badPrimitive('a List', value); } var list = _elm_lang$core$Native_List.Nil; for (var i = value.length; i--;) { var result = runHelp(decoder.decoder, value[i]); if (result.tag !== 'ok') { return badIndex(i, result); } list = _elm_lang$core$Native_List.Cons(result.value, list); } return ok(list); case 'array': if (!(value instanceof Array)) { return badPrimitive('an Array', value); } var len = value.length; var array = new Array(len); for (var i = len; i--;) { var result = runHelp(decoder.decoder, value[i]); if (result.tag !== 'ok') { return badIndex(i, result); } array[i] = result.value; } return ok(_elm_lang$core$Native_Array.fromJSArray(array)); case 'maybe': var result = runHelp(decoder.decoder, value); return result.tag === 'ok' ? ok(_elm_lang$core$Maybe$Just(result.value)) : ok(_elm_lang$core$Maybe$Nothing); case 'field': var field = decoder.field; if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null || !(field in value)) { return badPrimitive('an object with a field named `' + field + '`', value); } var result = runHelp(decoder.decoder, value[field]); return result.tag === 'ok' ? result : badField(field, result); case 'index': var index = decoder.index; if (!(value instanceof Array)) { return badPrimitive('an array', value); } if (index >= value.length) { return badPrimitive('a longer array. Need index ' + index + ' but there are only ' + value.length + ' entries', value); } var result = runHelp(decoder.decoder, value[index]); return result.tag === 'ok' ? result : badIndex(index, result); case 'key-value': if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null || value instanceof Array) { return badPrimitive('an object', value); } var keyValuePairs = _elm_lang$core$Native_List.Nil; for (var key in value) { var result = runHelp(decoder.decoder, value[key]); if (result.tag !== 'ok') { return badField(key, result); } var pair = _elm_lang$core$Native_Utils.Tuple2(key, result.value); keyValuePairs = _elm_lang$core$Native_List.Cons(pair, keyValuePairs); } return ok(keyValuePairs); case 'map-many': var answer = decoder.func; var decoders = decoder.decoders; for (var i = 0; i < decoders.length; i++) { var result = runHelp(decoders[i], value); if (result.tag !== 'ok') { return result; } answer = answer(result.value); } return ok(answer); case 'andThen': var result = runHelp(decoder.decoder, value); return result.tag !== 'ok' ? result : runHelp(decoder.callback(result.value), value); case 'oneOf': var errors = []; var temp = decoder.decoders; while (temp.ctor !== '[]') { var result = runHelp(temp._0, value); if (result.tag === 'ok') { return result; } errors.push(result); temp = temp._1; } return badOneOf(errors); case 'fail': return bad(decoder.msg); case 'succeed': return ok(decoder.msg); } } // EQUALITY function equality(a, b) { if (a === b) { return true; } if (a.tag !== b.tag) { return false; } switch (a.tag) { case 'succeed': case 'fail': return a.msg === b.msg; case 'bool': case 'int': case 'float': case 'string': case 'value': return true; case 'null': return a.value === b.value; case 'list': case 'array': case 'maybe': case 'key-value': return equality(a.decoder, b.decoder); case 'field': return a.field === b.field && equality(a.decoder, b.decoder); case 'index': return a.index === b.index && equality(a.decoder, b.decoder); case 'map-many': if (a.func !== b.func) { return false; } return listEquality(a.decoders, b.decoders); case 'andThen': return a.callback === b.callback && equality(a.decoder, b.decoder); case 'oneOf': return listEquality(a.decoders, b.decoders); } } function listEquality(aDecoders, bDecoders) { var len = aDecoders.length; if (len !== bDecoders.length) { return false; } for (var i = 0; i < len; i++) { if (!equality(aDecoders[i], bDecoders[i])) { return false; } } return true; } // ENCODE function encode(indentLevel, value) { return JSON.stringify(value, null, indentLevel); } function identity(value) { return value; } function encodeObject(keyValuePairs) { var obj = {}; while (keyValuePairs.ctor !== '[]') { var pair = keyValuePairs._0; obj[pair._0] = pair._1; keyValuePairs = keyValuePairs._1; } return obj; } return { encode: F2(encode), runOnString: F2(runOnString), run: F2(run), decodeNull: decodeNull, decodePrimitive: decodePrimitive, decodeContainer: F2(decodeContainer), decodeField: F2(decodeField), decodeIndex: F2(decodeIndex), map1: F2(map1), map2: F3(map2), map3: F4(map3), map4: F5(map4), map5: F6(map5), map6: F7(map6), map7: F8(map7), map8: F9(map8), decodeKeyValuePairs: decodeKeyValuePairs, andThen: F2(andThen), fail: fail, succeed: succeed, oneOf: oneOf, identity: identity, encodeNull: null, encodeArray: _elm_lang$core$Native_Array.toJSArray, encodeList: _elm_lang$core$Native_List.toArray, encodeObject: encodeObject, equality: equality }; }(); var _elm_lang$core$Json_Encode$list = _elm_lang$core$Native_Json.encodeList; var _elm_lang$core$Json_Encode$array = _elm_lang$core$Native_Json.encodeArray; var _elm_lang$core$Json_Encode$object = _elm_lang$core$Native_Json.encodeObject; var _elm_lang$core$Json_Encode$null = _elm_lang$core$Native_Json.encodeNull; var _elm_lang$core$Json_Encode$bool = _elm_lang$core$Native_Json.identity; var _elm_lang$core$Json_Encode$float = _elm_lang$core$Native_Json.identity; var _elm_lang$core$Json_Encode$int = _elm_lang$core$Native_Json.identity; var _elm_lang$core$Json_Encode$string = _elm_lang$core$Native_Json.identity; var _elm_lang$core$Json_Encode$encode = _elm_lang$core$Native_Json.encode; var _elm_lang$core$Json_Encode$Value = { ctor: 'Value' }; var _elm_lang$core$Json_Decode$null = _elm_lang$core$Native_Json.decodeNull; var _elm_lang$core$Json_Decode$value = _elm_lang$core$Native_Json.decodePrimitive('value'); var _elm_lang$core$Json_Decode$andThen = _elm_lang$core$Native_Json.andThen; var _elm_lang$core$Json_Decode$fail = _elm_lang$core$Native_Json.fail; var _elm_lang$core$Json_Decode$succeed = _elm_lang$core$Native_Json.succeed; var _elm_lang$core$Json_Decode$lazy = function _elm_lang$core$Json_Decode$lazy(thunk) { return A2(_elm_lang$core$Json_Decode$andThen, thunk, _elm_lang$core$Json_Decode$succeed({ ctor: '_Tuple0' })); }; var _elm_lang$core$Json_Decode$decodeValue = _elm_lang$core$Native_Json.run; var _elm_lang$core$Json_Decode$decodeString = _elm_lang$core$Native_Json.runOnString; var _elm_lang$core$Json_Decode$map8 = _elm_lang$core$Native_Json.map8; var _elm_lang$core$Json_Decode$map7 = _elm_lang$core$Native_Json.map7; var _elm_lang$core$Json_Decode$map6 = _elm_lang$core$Native_Json.map6; var _elm_lang$core$Json_Decode$map5 = _elm_lang$core$Native_Json.map5; var _elm_lang$core$Json_Decode$map4 = _elm_lang$core$Native_Json.map4; var _elm_lang$core$Json_Decode$map3 = _elm_lang$core$Native_Json.map3; var _elm_lang$core$Json_Decode$map2 = _elm_lang$core$Native_Json.map2; var _elm_lang$core$Json_Decode$map = _elm_lang$core$Native_Json.map1; var _elm_lang$core$Json_Decode$oneOf = _elm_lang$core$Native_Json.oneOf; var _elm_lang$core$Json_Decode$maybe = function _elm_lang$core$Json_Decode$maybe(decoder) { return A2(_elm_lang$core$Native_Json.decodeContainer, 'maybe', decoder); }; var _elm_lang$core$Json_Decode$index = _elm_lang$core$Native_Json.decodeIndex; var _elm_lang$core$Json_Decode$field = _elm_lang$core$Native_Json.decodeField; var _elm_lang$core$Json_Decode$at = F2(function (fields, decoder) { return A3(_elm_lang$core$List$foldr, _elm_lang$core$Json_Decode$field, decoder, fields); }); var _elm_lang$core$Json_Decode$keyValuePairs = _elm_lang$core$Native_Json.decodeKeyValuePairs; var _elm_lang$core$Json_Decode$dict = function _elm_lang$core$Json_Decode$dict(decoder) { return A2(_elm_lang$core$Json_Decode$map, _elm_lang$core$Dict$fromList, _elm_lang$core$Json_Decode$keyValuePairs(decoder)); }; var _elm_lang$core$Json_Decode$array = function _elm_lang$core$Json_Decode$array(decoder) { return A2(_elm_lang$core$Native_Json.decodeContainer, 'array', decoder); }; var _elm_lang$core$Json_Decode$list = function _elm_lang$core$Json_Decode$list(decoder) { return A2(_elm_lang$core$Native_Json.decodeContainer, 'list', decoder); }; var _elm_lang$core$Json_Decode$nullable = function _elm_lang$core$Json_Decode$nullable(decoder) { return _elm_lang$core$Json_Decode$oneOf({ ctor: '::', _0: _elm_lang$core$Json_Decode$null(_elm_lang$core$Maybe$Nothing), _1: { ctor: '::', _0: A2(_elm_lang$core$Json_Decode$map, _elm_lang$core$Maybe$Just, decoder), _1: { ctor: '[]' } } }); }; var _elm_lang$core$Json_Decode$float = _elm_lang$core$Native_Json.decodePrimitive('float'); var _elm_lang$core$Json_Decode$int = _elm_lang$core$Native_Json.decodePrimitive('int'); var _elm_lang$core$Json_Decode$bool = _elm_lang$core$Native_Json.decodePrimitive('bool'); var _elm_lang$core$Json_Decode$string = _elm_lang$core$Native_Json.decodePrimitive('string'); var _elm_lang$core$Json_Decode$Decoder = { ctor: 'Decoder' }; var _elm_lang$http$Native_Http = function () { // ENCODING AND DECODING function encodeUri(string) { return encodeURIComponent(string); } function decodeUri(string) { try { return _elm_lang$core$Maybe$Just(decodeURIComponent(string)); } catch (e) { return _elm_lang$core$Maybe$Nothing; } } // SEND REQUEST function toTask(request, maybeProgress) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { var xhr = new XMLHttpRequest(); configureProgress(xhr, maybeProgress); xhr.addEventListener('error', function () { callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'NetworkError' })); }); xhr.addEventListener('timeout', function () { callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'Timeout' })); }); xhr.addEventListener('load', function () { callback(handleResponse(xhr, request.expect.responseToResult)); }); try { xhr.open(request.method, request.url, true); } catch (e) { return callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'BadUrl', _0: request.url })); } configureRequest(xhr, request); send(xhr, request.body); return function () { xhr.abort(); }; }); } function configureProgress(xhr, maybeProgress) { if (maybeProgress.ctor === 'Nothing') { return; } xhr.addEventListener('progress', function (event) { if (!event.lengthComputable) { return; } _elm_lang$core$Native_Scheduler.rawSpawn(maybeProgress._0({ bytes: event.loaded, bytesExpected: event.total })); }); } function configureRequest(xhr, request) { function setHeader(pair) { xhr.setRequestHeader(pair._0, pair._1); } A2(_elm_lang$core$List$map, setHeader, request.headers); xhr.responseType = request.expect.responseType; xhr.withCredentials = request.withCredentials; if (request.timeout.ctor === 'Just') { xhr.timeout = request.timeout._0; } } function send(xhr, body) { switch (body.ctor) { case 'EmptyBody': xhr.send(); return; case 'StringBody': xhr.setRequestHeader('Content-Type', body._0); xhr.send(body._1); return; case 'FormDataBody': xhr.send(body._0); return; } } // RESPONSES function handleResponse(xhr, responseToResult) { var response = toResponse(xhr); if (xhr.status < 200 || 300 <= xhr.status) { response.body = xhr.responseText; return _elm_lang$core$Native_Scheduler.fail({ ctor: 'BadStatus', _0: response }); } var result = responseToResult(response); if (result.ctor === 'Ok') { return _elm_lang$core$Native_Scheduler.succeed(result._0); } else { response.body = xhr.responseText; return _elm_lang$core$Native_Scheduler.fail({ ctor: 'BadPayload', _0: result._0, _1: response }); } } function toResponse(xhr) { return { status: { code: xhr.status, message: xhr.statusText }, headers: parseHeaders(xhr.getAllResponseHeaders()), url: xhr.responseURL, body: xhr.response }; } function parseHeaders(rawHeaders) { var headers = _elm_lang$core$Dict$empty; if (!rawHeaders) { return headers; } var headerPairs = rawHeaders.split('\r\n'); for (var i = headerPairs.length; i--;) { var headerPair = headerPairs[i]; var index = headerPair.indexOf(': '); if (index > 0) { var key = headerPair.substring(0, index); var value = headerPair.substring(index + 2); headers = A3(_elm_lang$core$Dict$update, key, function (oldValue) { if (oldValue.ctor === 'Just') { return _elm_lang$core$Maybe$Just(value + ', ' + oldValue._0); } return _elm_lang$core$Maybe$Just(value); }, headers); } } return headers; } // EXPECTORS function expectStringResponse(responseToResult) { return { responseType: 'text', responseToResult: responseToResult }; } function mapExpect(func, expect) { return { responseType: expect.responseType, responseToResult: function responseToResult(response) { var convertedResponse = expect.responseToResult(response); return A2(_elm_lang$core$Result$map, func, convertedResponse); } }; } // BODY function multipart(parts) { var formData = new FormData(); while (parts.ctor !== '[]') { var part = parts._0; formData.append(part._0, part._1); parts = parts._1; } return { ctor: 'FormDataBody', _0: formData }; } return { toTask: F2(toTask), expectStringResponse: expectStringResponse, mapExpect: F2(mapExpect), multipart: multipart, encodeUri: encodeUri, decodeUri: decodeUri }; }(); //import Native.Utils // var _elm_lang$core$Native_Scheduler = function () { var MAX_STEPS = 10000; // TASKS function succeed(value) { return { ctor: '_Task_succeed', value: value }; } function fail(error) { return { ctor: '_Task_fail', value: error }; } function nativeBinding(callback) { return { ctor: '_Task_nativeBinding', callback: callback, cancel: null }; } function andThen(callback, task) { return { ctor: '_Task_andThen', callback: callback, task: task }; } function onError(callback, task) { return { ctor: '_Task_onError', callback: callback, task: task }; } function receive(callback) { return { ctor: '_Task_receive', callback: callback }; } // PROCESSES function rawSpawn(task) { var process = { ctor: '_Process', id: _elm_lang$core$Native_Utils.guid(), root: task, stack: null, mailbox: [] }; enqueue(process); return process; } function spawn(task) { return nativeBinding(function (callback) { var process = rawSpawn(task); callback(succeed(process)); }); } function rawSend(process, msg) { process.mailbox.push(msg); enqueue(process); } function send(process, msg) { return nativeBinding(function (callback) { rawSend(process, msg); callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function kill(process) { return nativeBinding(function (callback) { var root = process.root; if (root.ctor === '_Task_nativeBinding' && root.cancel) { root.cancel(); } process.root = null; callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function sleep(time) { return nativeBinding(function (callback) { var id = setTimeout(function () { callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); }, time); return function () { clearTimeout(id); }; }); } // STEP PROCESSES function step(numSteps, process) { while (numSteps < MAX_STEPS) { var ctor = process.root.ctor; if (ctor === '_Task_succeed') { while (process.stack && process.stack.ctor === '_Task_onError') { process.stack = process.stack.rest; } if (process.stack === null) { break; } process.root = process.stack.callback(process.root.value); process.stack = process.stack.rest; ++numSteps; continue; } if (ctor === '_Task_fail') { while (process.stack && process.stack.ctor === '_Task_andThen') { process.stack = process.stack.rest; } if (process.stack === null) { break; } process.root = process.stack.callback(process.root.value); process.stack = process.stack.rest; ++numSteps; continue; } if (ctor === '_Task_andThen') { process.stack = { ctor: '_Task_andThen', callback: process.root.callback, rest: process.stack }; process.root = process.root.task; ++numSteps; continue; } if (ctor === '_Task_onError') { process.stack = { ctor: '_Task_onError', callback: process.root.callback, rest: process.stack }; process.root = process.root.task; ++numSteps; continue; } if (ctor === '_Task_nativeBinding') { process.root.cancel = process.root.callback(function (newRoot) { process.root = newRoot; enqueue(process); }); break; } if (ctor === '_Task_receive') { var mailbox = process.mailbox; if (mailbox.length === 0) { break; } process.root = process.root.callback(mailbox.shift()); ++numSteps; continue; } throw new Error(ctor); } if (numSteps < MAX_STEPS) { return numSteps + 1; } enqueue(process); return numSteps; } // WORK QUEUE var working = false; var workQueue = []; function enqueue(process) { workQueue.push(process); if (!working) { setTimeout(work, 0); working = true; } } function work() { var numSteps = 0; var process; while (numSteps < MAX_STEPS && (process = workQueue.shift())) { if (process.root) { numSteps = step(numSteps, process); } } if (!process) { working = false; return; } setTimeout(work, 0); } return { succeed: succeed, fail: fail, nativeBinding: nativeBinding, andThen: F2(andThen), onError: F2(onError), receive: receive, spawn: spawn, kill: kill, sleep: sleep, send: F2(send), rawSpawn: rawSpawn, rawSend: rawSend }; }(); //import Native.Scheduler // var _elm_lang$core$Native_Time = function () { var now = _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { callback(_elm_lang$core$Native_Scheduler.succeed(Date.now())); }); function setInterval_(interval, task) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { var id = setInterval(function () { _elm_lang$core$Native_Scheduler.rawSpawn(task); }, interval); return function () { clearInterval(id); }; }); } return { now: now, setInterval_: F2(setInterval_) }; }(); //import // var _elm_lang$core$Native_Platform = function () { // PROGRAMS function program(impl) { return function (flagDecoder) { return function (object, moduleName) { object['worker'] = function worker(flags) { if (typeof flags !== 'undefined') { throw new Error('The `' + moduleName + '` module does not need flags.\n' + 'Call ' + moduleName + '.worker() with no arguments and you should be all set!'); } return initialize(impl.init, impl.update, impl.subscriptions, renderer); }; }; }; } function programWithFlags(impl) { return function (flagDecoder) { return function (object, moduleName) { object['worker'] = function worker(flags) { if (typeof flagDecoder === 'undefined') { throw new Error('Are you trying to sneak a Never value into Elm? Trickster!\n' + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\n' + 'Use `program` instead if you do not want flags.'); } var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags); if (result.ctor === 'Err') { throw new Error(moduleName + '.worker(...) was called with an unexpected argument.\n' + 'I tried to convert it to an Elm value, but ran into this problem:\n\n' + result._0); } return initialize(impl.init(result._0), impl.update, impl.subscriptions, renderer); }; }; }; } function renderer(enqueue, _) { return function (_) {}; } // HTML TO PROGRAM function htmlToProgram(vnode) { var emptyBag = batch(_elm_lang$core$Native_List.Nil); var noChange = _elm_lang$core$Native_Utils.Tuple2(_elm_lang$core$Native_Utils.Tuple0, emptyBag); return _elm_lang$virtual_dom$VirtualDom$program({ init: noChange, view: function view(model) { return main; }, update: F2(function (msg, model) { return noChange; }), subscriptions: function subscriptions(model) { return emptyBag; } }); } // INITIALIZE A PROGRAM function initialize(init, update, subscriptions, renderer) { // ambient state var managers = {}; var updateView; // init and update state in main process var initApp = _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { var model = init._0; updateView = renderer(enqueue, model); var cmds = init._1; var subs = subscriptions(model); dispatchEffects(managers, cmds, subs); callback(_elm_lang$core$Native_Scheduler.succeed(model)); }); function onMessage(msg, model) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { var results = A2(update, msg, model); model = results._0; updateView(model); var cmds = results._1; var subs = subscriptions(model); dispatchEffects(managers, cmds, subs); callback(_elm_lang$core$Native_Scheduler.succeed(model)); }); } var mainProcess = spawnLoop(initApp, onMessage); function enqueue(msg) { _elm_lang$core$Native_Scheduler.rawSend(mainProcess, msg); } var ports = setupEffects(managers, enqueue); return ports ? { ports: ports } : {}; } // EFFECT MANAGERS var effectManagers = {}; function setupEffects(managers, callback) { var ports; // setup all necessary effect managers for (var key in effectManagers) { var manager = effectManagers[key]; if (manager.isForeign) { ports = ports || {}; ports[key] = manager.tag === 'cmd' ? setupOutgoingPort(key) : setupIncomingPort(key, callback); } managers[key] = makeManager(manager, callback); } return ports; } function makeManager(info, callback) { var router = { main: callback, self: undefined }; var tag = info.tag; var onEffects = info.onEffects; var onSelfMsg = info.onSelfMsg; function onMessage(msg, state) { if (msg.ctor === 'self') { return A3(onSelfMsg, router, msg._0, state); } var fx = msg._0; switch (tag) { case 'cmd': return A3(onEffects, router, fx.cmds, state); case 'sub': return A3(onEffects, router, fx.subs, state); case 'fx': return A4(onEffects, router, fx.cmds, fx.subs, state); } } var process = spawnLoop(info.init, onMessage); router.self = process; return process; } function sendToApp(router, msg) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { router.main(msg); callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function sendToSelf(router, msg) { return A2(_elm_lang$core$Native_Scheduler.send, router.self, { ctor: 'self', _0: msg }); } // HELPER for STATEFUL LOOPS function spawnLoop(init, onMessage) { var andThen = _elm_lang$core$Native_Scheduler.andThen; function loop(state) { var handleMsg = _elm_lang$core$Native_Scheduler.receive(function (msg) { return onMessage(msg, state); }); return A2(andThen, loop, handleMsg); } var task = A2(andThen, loop, init); return _elm_lang$core$Native_Scheduler.rawSpawn(task); } // BAGS function leaf(home) { return function (value) { return { type: 'leaf', home: home, value: value }; }; } function batch(list) { return { type: 'node', branches: list }; } function map(tagger, bag) { return { type: 'map', tagger: tagger, tree: bag }; } // PIPE BAGS INTO EFFECT MANAGERS function dispatchEffects(managers, cmdBag, subBag) { var effectsDict = {}; gatherEffects(true, cmdBag, effectsDict, null); gatherEffects(false, subBag, effectsDict, null); for (var home in managers) { var fx = home in effectsDict ? effectsDict[home] : { cmds: _elm_lang$core$Native_List.Nil, subs: _elm_lang$core$Native_List.Nil }; _elm_lang$core$Native_Scheduler.rawSend(managers[home], { ctor: 'fx', _0: fx }); } } function gatherEffects(isCmd, bag, effectsDict, taggers) { switch (bag.type) { case 'leaf': var home = bag.home; var effect = toEffect(isCmd, home, taggers, bag.value); effectsDict[home] = insert(isCmd, effect, effectsDict[home]); return; case 'node': var list = bag.branches; while (list.ctor !== '[]') { gatherEffects(isCmd, list._0, effectsDict, taggers); list = list._1; } return; case 'map': gatherEffects(isCmd, bag.tree, effectsDict, { tagger: bag.tagger, rest: taggers }); return; } } function toEffect(isCmd, home, taggers, value) { function applyTaggers(x) { var temp = taggers; while (temp) { x = temp.tagger(x); temp = temp.rest; } return x; } var map = isCmd ? effectManagers[home].cmdMap : effectManagers[home].subMap; return A2(map, applyTaggers, value); } function insert(isCmd, newEffect, effects) { effects = effects || { cmds: _elm_lang$core$Native_List.Nil, subs: _elm_lang$core$Native_List.Nil }; if (isCmd) { effects.cmds = _elm_lang$core$Native_List.Cons(newEffect, effects.cmds); return effects; } effects.subs = _elm_lang$core$Native_List.Cons(newEffect, effects.subs); return effects; } // PORTS function checkPortName(name) { if (name in effectManagers) { throw new Error('There can only be one port named `' + name + '`, but your program has multiple.'); } } // OUTGOING PORTS function outgoingPort(name, converter) { checkPortName(name); effectManagers[name] = { tag: 'cmd', cmdMap: outgoingPortMap, converter: converter, isForeign: true }; return leaf(name); } var outgoingPortMap = F2(function cmdMap(tagger, value) { return value; }); function setupOutgoingPort(name) { var subs = []; var converter = effectManagers[name].converter; // CREATE MANAGER var init = _elm_lang$core$Native_Scheduler.succeed(null); function onEffects(router, cmdList, state) { while (cmdList.ctor !== '[]') { // grab a separate reference to subs in case unsubscribe is called var currentSubs = subs; var value = converter(cmdList._0); for (var i = 0; i < currentSubs.length; i++) { currentSubs[i](value); } cmdList = cmdList._1; } return init; } effectManagers[name].init = init; effectManagers[name].onEffects = F3(onEffects); // PUBLIC API function subscribe(callback) { subs.push(callback); } function unsubscribe(callback) { // copy subs into a new array in case unsubscribe is called within a // subscribed callback subs = subs.slice(); var index = subs.indexOf(callback); if (index >= 0) { subs.splice(index, 1); } } return { subscribe: subscribe, unsubscribe: unsubscribe }; } // INCOMING PORTS function incomingPort(name, converter) { checkPortName(name); effectManagers[name] = { tag: 'sub', subMap: incomingPortMap, converter: converter, isForeign: true }; return leaf(name); } var incomingPortMap = F2(function subMap(tagger, finalTagger) { return function (value) { return tagger(finalTagger(value)); }; }); function setupIncomingPort(name, callback) { var sentBeforeInit = []; var subs = _elm_lang$core$Native_List.Nil; var converter = effectManagers[name].converter; var currentOnEffects = preInitOnEffects; var currentSend = preInitSend; // CREATE MANAGER var init = _elm_lang$core$Native_Scheduler.succeed(null); function preInitOnEffects(router, subList, state) { var postInitResult = postInitOnEffects(router, subList, state); for (var i = 0; i < sentBeforeInit.length; i++) { postInitSend(sentBeforeInit[i]); } sentBeforeInit = null; // to release objects held in queue currentSend = postInitSend; currentOnEffects = postInitOnEffects; return postInitResult; } function postInitOnEffects(router, subList, state) { subs = subList; return init; } function onEffects(router, subList, state) { return currentOnEffects(router, subList, state); } effectManagers[name].init = init; effectManagers[name].onEffects = F3(onEffects); // PUBLIC API function preInitSend(value) { sentBeforeInit.push(value); } function postInitSend(value) { var temp = subs; while (temp.ctor !== '[]') { callback(temp._0(value)); temp = temp._1; } } function send(incomingValue) { var result = A2(_elm_lang$core$Json_Decode$decodeValue, converter, incomingValue); if (result.ctor === 'Err') { throw new Error('Trying to send an unexpected type of value through port `' + name + '`:\n' + result._0); } currentSend(result._0); } return { send: send }; } return { // routers sendToApp: F2(sendToApp), sendToSelf: F2(sendToSelf), // global setup effectManagers: effectManagers, outgoingPort: outgoingPort, incomingPort: incomingPort, htmlToProgram: htmlToProgram, program: program, programWithFlags: programWithFlags, initialize: initialize, // effect bags leaf: leaf, batch: batch, map: F2(map) }; }(); var _elm_lang$core$Platform_Cmd$batch = _elm_lang$core$Native_Platform.batch; var _elm_lang$core$Platform_Cmd$none = _elm_lang$core$Platform_Cmd$batch({ ctor: '[]' }); var _elm_lang$core$Platform_Cmd_ops = _elm_lang$core$Platform_Cmd_ops || {}; _elm_lang$core$Platform_Cmd_ops['!'] = F2(function (model, commands) { return { ctor: '_Tuple2', _0: model, _1: _elm_lang$core$Platform_Cmd$batch(commands) }; }); var _elm_lang$core$Platform_Cmd$map = _elm_lang$core$Native_Platform.map; var _elm_lang$core$Platform_Cmd$Cmd = { ctor: 'Cmd' }; var _elm_lang$core$Platform_Sub$batch = _elm_lang$core$Native_Platform.batch; var _elm_lang$core$Platform_Sub$none = _elm_lang$core$Platform_Sub$batch({ ctor: '[]' }); var _elm_lang$core$Platform_Sub$map = _elm_lang$core$Native_Platform.map; var _elm_lang$core$Platform_Sub$Sub = { ctor: 'Sub' }; var _elm_lang$core$Platform$hack = _elm_lang$core$Native_Scheduler.succeed; var _elm_lang$core$Platform$sendToSelf = _elm_lang$core$Native_Platform.sendToSelf; var _elm_lang$core$Platform$sendToApp = _elm_lang$core$Native_Platform.sendToApp; var _elm_lang$core$Platform$programWithFlags = _elm_lang$core$Native_Platform.programWithFlags; var _elm_lang$core$Platform$program = _elm_lang$core$Native_Platform.program; var _elm_lang$core$Platform$Program = { ctor: 'Program' }; var _elm_lang$core$Platform$Task = { ctor: 'Task' }; var _elm_lang$core$Platform$ProcessId = { ctor: 'ProcessId' }; var _elm_lang$core$Platform$Router = { ctor: 'Router' }; var _elm_lang$core$Task$onError = _elm_lang$core$Native_Scheduler.onError; var _elm_lang$core$Task$andThen = _elm_lang$core$Native_Scheduler.andThen; var _elm_lang$core$Task$spawnCmd = F2(function (router, _p0) { var _p1 = _p0; return _elm_lang$core$Native_Scheduler.spawn(A2(_elm_lang$core$Task$andThen, _elm_lang$core$Platform$sendToApp(router), _p1._0)); }); var _elm_lang$core$Task$fail = _elm_lang$core$Native_Scheduler.fail; var _elm_lang$core$Task$mapError = F2(function (convert, task) { return A2(_elm_lang$core$Task$onError, function (_p2) { return _elm_lang$core$Task$fail(convert(_p2)); }, task); }); var _elm_lang$core$Task$succeed = _elm_lang$core$Native_Scheduler.succeed; var _elm_lang$core$Task$map = F2(function (func, taskA) { return A2(_elm_lang$core$Task$andThen, function (a) { return _elm_lang$core$Task$succeed(func(a)); }, taskA); }); var _elm_lang$core$Task$map2 = F3(function (func, taskA, taskB) { return A2(_elm_lang$core$Task$andThen, function (a) { return A2(_elm_lang$core$Task$andThen, function (b) { return _elm_lang$core$Task$succeed(A2(func, a, b)); }, taskB); }, taskA); }); var _elm_lang$core$Task$map3 = F4(function (func, taskA, taskB, taskC) { return A2(_elm_lang$core$Task$andThen, function (a) { return A2(_elm_lang$core$Task$andThen, function (b) { return A2(_elm_lang$core$Task$andThen, function (c) { return _elm_lang$core$Task$succeed(A3(func, a, b, c)); }, taskC); }, taskB); }, taskA); }); var _elm_lang$core$Task$map4 = F5(function (func, taskA, taskB, taskC, taskD) { return A2(_elm_lang$core$Task$andThen, function (a) { return A2(_elm_lang$core$Task$andThen, function (b) { return A2(_elm_lang$core$Task$andThen, function (c) { return A2(_elm_lang$core$Task$andThen, function (d) { return _elm_lang$core$Task$succeed(A4(func, a, b, c, d)); }, taskD); }, taskC); }, taskB); }, taskA); }); var _elm_lang$core$Task$map5 = F6(function (func, taskA, taskB, taskC, taskD, taskE) { return A2(_elm_lang$core$Task$andThen, function (a) { return A2(_elm_lang$core$Task$andThen, function (b) { return A2(_elm_lang$core$Task$andThen, function (c) { return A2(_elm_lang$core$Task$andThen, function (d) { return A2(_elm_lang$core$Task$andThen, function (e) { return _elm_lang$core$Task$succeed(A5(func, a, b, c, d, e)); }, taskE); }, taskD); }, taskC); }, taskB); }, taskA); }); var _elm_lang$core$Task$sequence = function _elm_lang$core$Task$sequence(tasks) { var _p3 = tasks; if (_p3.ctor === '[]') { return _elm_lang$core$Task$succeed({ ctor: '[]' }); } else { return A3(_elm_lang$core$Task$map2, F2(function (x, y) { return { ctor: '::', _0: x, _1: y }; }), _p3._0, _elm_lang$core$Task$sequence(_p3._1)); } }; var _elm_lang$core$Task$onEffects = F3(function (router, commands, state) { return A2(_elm_lang$core$Task$map, function (_p4) { return { ctor: '_Tuple0' }; }, _elm_lang$core$Task$sequence(A2(_elm_lang$core$List$map, _elm_lang$core$Task$spawnCmd(router), commands))); }); var _elm_lang$core$Task$init = _elm_lang$core$Task$succeed({ ctor: '_Tuple0' }); var _elm_lang$core$Task$onSelfMsg = F3(function (_p7, _p6, _p5) { return _elm_lang$core$Task$succeed({ ctor: '_Tuple0' }); }); var _elm_lang$core$Task$command = _elm_lang$core$Native_Platform.leaf('Task'); var _elm_lang$core$Task$Perform = function _elm_lang$core$Task$Perform(a) { return { ctor: 'Perform', _0: a }; }; var _elm_lang$core$Task$perform = F2(function (toMessage, task) { return _elm_lang$core$Task$command(_elm_lang$core$Task$Perform(A2(_elm_lang$core$Task$map, toMessage, task))); }); var _elm_lang$core$Task$attempt = F2(function (resultToMessage, task) { return _elm_lang$core$Task$command(_elm_lang$core$Task$Perform(A2(_elm_lang$core$Task$onError, function (_p8) { return _elm_lang$core$Task$succeed(resultToMessage(_elm_lang$core$Result$Err(_p8))); }, A2(_elm_lang$core$Task$andThen, function (_p9) { return _elm_lang$core$Task$succeed(resultToMessage(_elm_lang$core$Result$Ok(_p9))); }, task)))); }); var _elm_lang$core$Task$cmdMap = F2(function (tagger, _p10) { var _p11 = _p10; return _elm_lang$core$Task$Perform(A2(_elm_lang$core$Task$map, tagger, _p11._0)); }); _elm_lang$core$Native_Platform.effectManagers['Task'] = { pkg: 'elm-lang/core', init: _elm_lang$core$Task$init, onEffects: _elm_lang$core$Task$onEffects, onSelfMsg: _elm_lang$core$Task$onSelfMsg, tag: 'cmd', cmdMap: _elm_lang$core$Task$cmdMap }; var _elm_lang$core$Time$setInterval = _elm_lang$core$Native_Time.setInterval_; var _elm_lang$core$Time$spawnHelp = F3(function (router, intervals, processes) { var _p0 = intervals; if (_p0.ctor === '[]') { return _elm_lang$core$Task$succeed(processes); } else { var _p1 = _p0._0; var spawnRest = function spawnRest(id) { return A3(_elm_lang$core$Time$spawnHelp, router, _p0._1, A3(_elm_lang$core$Dict$insert, _p1, id, processes)); }; var spawnTimer = _elm_lang$core$Native_Scheduler.spawn(A2(_elm_lang$core$Time$setInterval, _p1, A2(_elm_lang$core$Platform$sendToSelf, router, _p1))); return A2(_elm_lang$core$Task$andThen, spawnRest, spawnTimer); } }); var _elm_lang$core$Time$addMySub = F2(function (_p2, state) { var _p3 = _p2; var _p6 = _p3._1; var _p5 = _p3._0; var _p4 = A2(_elm_lang$core$Dict$get, _p5, state); if (_p4.ctor === 'Nothing') { return A3(_elm_lang$core$Dict$insert, _p5, { ctor: '::', _0: _p6, _1: { ctor: '[]' } }, state); } else { return A3(_elm_lang$core$Dict$insert, _p5, { ctor: '::', _0: _p6, _1: _p4._0 }, state); } }); var _elm_lang$core$Time$inMilliseconds = function _elm_lang$core$Time$inMilliseconds(t) { return t; }; var _elm_lang$core$Time$millisecond = 1; var _elm_lang$core$Time$second = 1000 * _elm_lang$core$Time$millisecond; var _elm_lang$core$Time$minute = 60 * _elm_lang$core$Time$second; var _elm_lang$core$Time$hour = 60 * _elm_lang$core$Time$minute; var _elm_lang$core$Time$inHours = function _elm_lang$core$Time$inHours(t) { return t / _elm_lang$core$Time$hour; }; var _elm_lang$core$Time$inMinutes = function _elm_lang$core$Time$inMinutes(t) { return t / _elm_lang$core$Time$minute; }; var _elm_lang$core$Time$inSeconds = function _elm_lang$core$Time$inSeconds(t) { return t / _elm_lang$core$Time$second; }; var _elm_lang$core$Time$now = _elm_lang$core$Native_Time.now; var _elm_lang$core$Time$onSelfMsg = F3(function (router, interval, state) { var _p7 = A2(_elm_lang$core$Dict$get, interval, state.taggers); if (_p7.ctor === 'Nothing') { return _elm_lang$core$Task$succeed(state); } else { var tellTaggers = function tellTaggers(time) { return _elm_lang$core$Task$sequence(A2(_elm_lang$core$List$map, function (tagger) { return A2(_elm_lang$core$Platform$sendToApp, router, tagger(time)); }, _p7._0)); }; return A2(_elm_lang$core$Task$andThen, function (_p8) { return _elm_lang$core$Task$succeed(state); }, A2(_elm_lang$core$Task$andThen, tellTaggers, _elm_lang$core$Time$now)); } }); var _elm_lang$core$Time$subscription = _elm_lang$core$Native_Platform.leaf('Time'); var _elm_lang$core$Time$State = F2(function (a, b) { return { taggers: a, processes: b }; }); var _elm_lang$core$Time$init = _elm_lang$core$Task$succeed(A2(_elm_lang$core$Time$State, _elm_lang$core$Dict$empty, _elm_lang$core$Dict$empty)); var _elm_lang$core$Time$onEffects = F3(function (router, subs, _p9) { var _p10 = _p9; var rightStep = F3(function (_p12, id, _p11) { var _p13 = _p11; return { ctor: '_Tuple3', _0: _p13._0, _1: _p13._1, _2: A2(_elm_lang$core$Task$andThen, function (_p14) { return _p13._2; }, _elm_lang$core$Native_Scheduler.kill(id)) }; }); var bothStep = F4(function (interval, taggers, id, _p15) { var _p16 = _p15; return { ctor: '_Tuple3', _0: _p16._0, _1: A3(_elm_lang$core$Dict$insert, interval, id, _p16._1), _2: _p16._2 }; }); var leftStep = F3(function (interval, taggers, _p17) { var _p18 = _p17; return { ctor: '_Tuple3', _0: { ctor: '::', _0: interval, _1: _p18._0 }, _1: _p18._1, _2: _p18._2 }; }); var newTaggers = A3(_elm_lang$core$List$foldl, _elm_lang$core$Time$addMySub, _elm_lang$core$Dict$empty, subs); var _p19 = A6(_elm_lang$core$Dict$merge, leftStep, bothStep, rightStep, newTaggers, _p10.processes, { ctor: '_Tuple3', _0: { ctor: '[]' }, _1: _elm_lang$core$Dict$empty, _2: _elm_lang$core$Task$succeed({ ctor: '_Tuple0' }) }); var spawnList = _p19._0; var existingDict = _p19._1; var killTask = _p19._2; return A2(_elm_lang$core$Task$andThen, function (newProcesses) { return _elm_lang$core$Task$succeed(A2(_elm_lang$core$Time$State, newTaggers, newProcesses)); }, A2(_elm_lang$core$Task$andThen, function (_p20) { return A3(_elm_lang$core$Time$spawnHelp, router, spawnList, existingDict); }, killTask)); }); var _elm_lang$core$Time$Every = F2(function (a, b) { return { ctor: 'Every', _0: a, _1: b }; }); var _elm_lang$core$Time$every = F2(function (interval, tagger) { return _elm_lang$core$Time$subscription(A2(_elm_lang$core$Time$Every, interval, tagger)); }); var _elm_lang$core$Time$subMap = F2(function (f, _p21) { var _p22 = _p21; return A2(_elm_lang$core$Time$Every, _p22._0, function (_p23) { return f(_p22._1(_p23)); }); }); _elm_lang$core$Native_Platform.effectManagers['Time'] = { pkg: 'elm-lang/core', init: _elm_lang$core$Time$init, onEffects: _elm_lang$core$Time$onEffects, onSelfMsg: _elm_lang$core$Time$onSelfMsg, tag: 'sub', subMap: _elm_lang$core$Time$subMap }; var _elm_lang$core$Debug$crash = _elm_lang$core$Native_Debug.crash; var _elm_lang$core$Debug$log = _elm_lang$core$Native_Debug.log; var _elm_lang$core$Tuple$mapSecond = F2(function (func, _p0) { var _p1 = _p0; return { ctor: '_Tuple2', _0: _p1._0, _1: func(_p1._1) }; }); var _elm_lang$core$Tuple$mapFirst = F2(function (func, _p2) { var _p3 = _p2; return { ctor: '_Tuple2', _0: func(_p3._0), _1: _p3._1 }; }); var _elm_lang$core$Tuple$second = function _elm_lang$core$Tuple$second(_p4) { var _p5 = _p4; return _p5._1; }; var _elm_lang$core$Tuple$first = function _elm_lang$core$Tuple$first(_p6) { var _p7 = _p6; return _p7._0; }; var _elm_lang$http$Http_Internal$map = F2(function (func, request) { return _elm_lang$core$Native_Utils.update(request, { expect: A2(_elm_lang$http$Native_Http.mapExpect, func, request.expect) }); }); var _elm_lang$http$Http_Internal$RawRequest = F7(function (a, b, c, d, e, f, g) { return { method: a, headers: b, url: c, body: d, expect: e, timeout: f, withCredentials: g }; }); var _elm_lang$http$Http_Internal$Request = function _elm_lang$http$Http_Internal$Request(a) { return { ctor: 'Request', _0: a }; }; var _elm_lang$http$Http_Internal$Expect = { ctor: 'Expect' }; var _elm_lang$http$Http_Internal$FormDataBody = { ctor: 'FormDataBody' }; var _elm_lang$http$Http_Internal$StringBody = F2(function (a, b) { return { ctor: 'StringBody', _0: a, _1: b }; }); var _elm_lang$http$Http_Internal$EmptyBody = { ctor: 'EmptyBody' }; var _elm_lang$http$Http_Internal$Header = F2(function (a, b) { return { ctor: 'Header', _0: a, _1: b }; }); var _elm_lang$http$Http$decodeUri = _elm_lang$http$Native_Http.decodeUri; var _elm_lang$http$Http$encodeUri = _elm_lang$http$Native_Http.encodeUri; var _elm_lang$http$Http$expectStringResponse = _elm_lang$http$Native_Http.expectStringResponse; var _elm_lang$http$Http$expectJson = function _elm_lang$http$Http$expectJson(decoder) { return _elm_lang$http$Http$expectStringResponse(function (response) { return A2(_elm_lang$core$Json_Decode$decodeString, decoder, response.body); }); }; var _elm_lang$http$Http$expectString = _elm_lang$http$Http$expectStringResponse(function (response) { return _elm_lang$core$Result$Ok(response.body); }); var _elm_lang$http$Http$multipartBody = _elm_lang$http$Native_Http.multipart; var _elm_lang$http$Http$stringBody = _elm_lang$http$Http_Internal$StringBody; var _elm_lang$http$Http$jsonBody = function _elm_lang$http$Http$jsonBody(value) { return A2(_elm_lang$http$Http_Internal$StringBody, 'application/json', A2(_elm_lang$core$Json_Encode$encode, 0, value)); }; var _elm_lang$http$Http$emptyBody = _elm_lang$http$Http_Internal$EmptyBody; var _elm_lang$http$Http$header = _elm_lang$http$Http_Internal$Header; var _elm_lang$http$Http$request = _elm_lang$http$Http_Internal$Request; var _elm_lang$http$Http$post = F3(function (url, body, decoder) { return _elm_lang$http$Http$request({ method: 'POST', headers: { ctor: '[]' }, url: url, body: body, expect: _elm_lang$http$Http$expectJson(decoder), timeout: _elm_lang$core$Maybe$Nothing, withCredentials: false }); }); var _elm_lang$http$Http$get = F2(function (url, decoder) { return _elm_lang$http$Http$request({ method: 'GET', headers: { ctor: '[]' }, url: url, body: _elm_lang$http$Http$emptyBody, expect: _elm_lang$http$Http$expectJson(decoder), timeout: _elm_lang$core$Maybe$Nothing, withCredentials: false }); }); var _elm_lang$http$Http$getString = function _elm_lang$http$Http$getString(url) { return _elm_lang$http$Http$request({ method: 'GET', headers: { ctor: '[]' }, url: url, body: _elm_lang$http$Http$emptyBody, expect: _elm_lang$http$Http$expectString, timeout: _elm_lang$core$Maybe$Nothing, withCredentials: false }); }; var _elm_lang$http$Http$toTask = function _elm_lang$http$Http$toTask(_p0) { var _p1 = _p0; return A2(_elm_lang$http$Native_Http.toTask, _p1._0, _elm_lang$core$Maybe$Nothing); }; var _elm_lang$http$Http$send = F2(function (resultToMessage, request) { return A2(_elm_lang$core$Task$attempt, resultToMessage, _elm_lang$http$Http$toTask(request)); }); var _elm_lang$http$Http$Response = F4(function (a, b, c, d) { return { url: a, status: b, headers: c, body: d }; }); var _elm_lang$http$Http$BadPayload = F2(function (a, b) { return { ctor: 'BadPayload', _0: a, _1: b }; }); var _elm_lang$http$Http$BadStatus = function _elm_lang$http$Http$BadStatus(a) { return { ctor: 'BadStatus', _0: a }; }; var _elm_lang$http$Http$NetworkError = { ctor: 'NetworkError' }; var _elm_lang$http$Http$Timeout = { ctor: 'Timeout' }; var _elm_lang$http$Http$BadUrl = function _elm_lang$http$Http$BadUrl(a) { return { ctor: 'BadUrl', _0: a }; }; var _elm_lang$http$Http$StringPart = F2(function (a, b) { return { ctor: 'StringPart', _0: a, _1: b }; }); var _elm_lang$http$Http$stringPart = _elm_lang$http$Http$StringPart; //import Result // var _elm_lang$core$Native_Date = function () { function fromString(str) { var date = new Date(str); return isNaN(date.getTime()) ? _elm_lang$core$Result$Err('Unable to parse \'' + str + '\' as a date. Dates must be in the ISO 8601 format.') : _elm_lang$core$Result$Ok(date); } var dayTable = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var monthTable = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; return { fromString: fromString, year: function year(d) { return d.getFullYear(); }, month: function month(d) { return { ctor: monthTable[d.getMonth()] }; }, day: function day(d) { return d.getDate(); }, hour: function hour(d) { return d.getHours(); }, minute: function minute(d) { return d.getMinutes(); }, second: function second(d) { return d.getSeconds(); }, millisecond: function millisecond(d) { return d.getMilliseconds(); }, toTime: function toTime(d) { return d.getTime(); }, fromTime: function fromTime(t) { return new Date(t); }, dayOfWeek: function dayOfWeek(d) { return { ctor: dayTable[d.getDay()] }; } }; }(); var _elm_lang$core$Date$millisecond = _elm_lang$core$Native_Date.millisecond; var _elm_lang$core$Date$second = _elm_lang$core$Native_Date.second; var _elm_lang$core$Date$minute = _elm_lang$core$Native_Date.minute; var _elm_lang$core$Date$hour = _elm_lang$core$Native_Date.hour; var _elm_lang$core$Date$dayOfWeek = _elm_lang$core$Native_Date.dayOfWeek; var _elm_lang$core$Date$day = _elm_lang$core$Native_Date.day; var _elm_lang$core$Date$month = _elm_lang$core$Native_Date.month; var _elm_lang$core$Date$year = _elm_lang$core$Native_Date.year; var _elm_lang$core$Date$fromTime = _elm_lang$core$Native_Date.fromTime; var _elm_lang$core$Date$toTime = _elm_lang$core$Native_Date.toTime; var _elm_lang$core$Date$fromString = _elm_lang$core$Native_Date.fromString; var _elm_lang$core$Date$now = A2(_elm_lang$core$Task$map, _elm_lang$core$Date$fromTime, _elm_lang$core$Time$now); var _elm_lang$core$Date$Date = { ctor: 'Date' }; var _elm_lang$core$Date$Sun = { ctor: 'Sun' }; var _elm_lang$core$Date$Sat = { ctor: 'Sat' }; var _elm_lang$core$Date$Fri = { ctor: 'Fri' }; var _elm_lang$core$Date$Thu = { ctor: 'Thu' }; var _elm_lang$core$Date$Wed = { ctor: 'Wed' }; var _elm_lang$core$Date$Tue = { ctor: 'Tue' }; var _elm_lang$core$Date$Mon = { ctor: 'Mon' }; var _elm_lang$core$Date$Dec = { ctor: 'Dec' }; var _elm_lang$core$Date$Nov = { ctor: 'Nov' }; var _elm_lang$core$Date$Oct = { ctor: 'Oct' }; var _elm_lang$core$Date$Sep = { ctor: 'Sep' }; var _elm_lang$core$Date$Aug = { ctor: 'Aug' }; var _elm_lang$core$Date$Jul = { ctor: 'Jul' }; var _elm_lang$core$Date$Jun = { ctor: 'Jun' }; var _elm_lang$core$Date$May = { ctor: 'May' }; var _elm_lang$core$Date$Apr = { ctor: 'Apr' }; var _elm_lang$core$Date$Mar = { ctor: 'Mar' }; var _elm_lang$core$Date$Feb = { ctor: 'Feb' }; var _elm_lang$core$Date$Jan = { ctor: 'Jan' }; var _elm_lang$core$Process$kill = _elm_lang$core$Native_Scheduler.kill; var _elm_lang$core$Process$sleep = _elm_lang$core$Native_Scheduler.sleep; var _elm_lang$core$Process$spawn = _elm_lang$core$Native_Scheduler.spawn; var _elm_lang$core$Random$onSelfMsg = F3(function (_p1, _p0, seed) { return _elm_lang$core$Task$succeed(seed); }); var _elm_lang$core$Random$magicNum8 = 2147483562; var _elm_lang$core$Random$range = function _elm_lang$core$Random$range(_p2) { return { ctor: '_Tuple2', _0: 0, _1: _elm_lang$core$Random$magicNum8 }; }; var _elm_lang$core$Random$magicNum7 = 2147483399; var _elm_lang$core$Random$magicNum6 = 2147483563; var _elm_lang$core$Random$magicNum5 = 3791; var _elm_lang$core$Random$magicNum4 = 40692; var _elm_lang$core$Random$magicNum3 = 52774; var _elm_lang$core$Random$magicNum2 = 12211; var _elm_lang$core$Random$magicNum1 = 53668; var _elm_lang$core$Random$magicNum0 = 40014; var _elm_lang$core$Random$step = F2(function (_p3, seed) { var _p4 = _p3; return _p4._0(seed); }); var _elm_lang$core$Random$onEffects = F3(function (router, commands, seed) { var _p5 = commands; if (_p5.ctor === '[]') { return _elm_lang$core$Task$succeed(seed); } else { var _p6 = A2(_elm_lang$core$Random$step, _p5._0._0, seed); var value = _p6._0; var newSeed = _p6._1; return A2(_elm_lang$core$Task$andThen, function (_p7) { return A3(_elm_lang$core$Random$onEffects, router, _p5._1, newSeed); }, A2(_elm_lang$core$Platform$sendToApp, router, value)); } }); var _elm_lang$core$Random$listHelp = F4(function (list, n, generate, seed) { listHelp: while (true) { if (_elm_lang$core$Native_Utils.cmp(n, 1) < 0) { return { ctor: '_Tuple2', _0: _elm_lang$core$List$reverse(list), _1: seed }; } else { var _p8 = generate(seed); var value = _p8._0; var newSeed = _p8._1; var _v2 = { ctor: '::', _0: value, _1: list }, _v3 = n - 1, _v4 = generate, _v5 = newSeed; list = _v2; n = _v3; generate = _v4; seed = _v5; continue listHelp; } } }); var _elm_lang$core$Random$minInt = -2147483648; var _elm_lang$core$Random$maxInt = 2147483647; var _elm_lang$core$Random$iLogBase = F2(function (b, i) { return _elm_lang$core$Native_Utils.cmp(i, b) < 0 ? 1 : 1 + A2(_elm_lang$core$Random$iLogBase, b, i / b | 0); }); var _elm_lang$core$Random$command = _elm_lang$core$Native_Platform.leaf('Random'); var _elm_lang$core$Random$Generator = function _elm_lang$core$Random$Generator(a) { return { ctor: 'Generator', _0: a }; }; var _elm_lang$core$Random$list = F2(function (n, _p9) { var _p10 = _p9; return _elm_lang$core$Random$Generator(function (seed) { return A4(_elm_lang$core$Random$listHelp, { ctor: '[]' }, n, _p10._0, seed); }); }); var _elm_lang$core$Random$map = F2(function (func, _p11) { var _p12 = _p11; return _elm_lang$core$Random$Generator(function (seed0) { var _p13 = _p12._0(seed0); var a = _p13._0; var seed1 = _p13._1; return { ctor: '_Tuple2', _0: func(a), _1: seed1 }; }); }); var _elm_lang$core$Random$map2 = F3(function (func, _p15, _p14) { var _p16 = _p15; var _p17 = _p14; return _elm_lang$core$Random$Generator(function (seed0) { var _p18 = _p16._0(seed0); var a = _p18._0; var seed1 = _p18._1; var _p19 = _p17._0(seed1); var b = _p19._0; var seed2 = _p19._1; return { ctor: '_Tuple2', _0: A2(func, a, b), _1: seed2 }; }); }); var _elm_lang$core$Random$pair = F2(function (genA, genB) { return A3(_elm_lang$core$Random$map2, F2(function (v0, v1) { return { ctor: '_Tuple2', _0: v0, _1: v1 }; }), genA, genB); }); var _elm_lang$core$Random$map3 = F4(function (func, _p22, _p21, _p20) { var _p23 = _p22; var _p24 = _p21; var _p25 = _p20; return _elm_lang$core$Random$Generator(function (seed0) { var _p26 = _p23._0(seed0); var a = _p26._0; var seed1 = _p26._1; var _p27 = _p24._0(seed1); var b = _p27._0; var seed2 = _p27._1; var _p28 = _p25._0(seed2); var c = _p28._0; var seed3 = _p28._1; return { ctor: '_Tuple2', _0: A3(func, a, b, c), _1: seed3 }; }); }); var _elm_lang$core$Random$map4 = F5(function (func, _p32, _p31, _p30, _p29) { var _p33 = _p32; var _p34 = _p31; var _p35 = _p30; var _p36 = _p29; return _elm_lang$core$Random$Generator(function (seed0) { var _p37 = _p33._0(seed0); var a = _p37._0; var seed1 = _p37._1; var _p38 = _p34._0(seed1); var b = _p38._0; var seed2 = _p38._1; var _p39 = _p35._0(seed2); var c = _p39._0; var seed3 = _p39._1; var _p40 = _p36._0(seed3); var d = _p40._0; var seed4 = _p40._1; return { ctor: '_Tuple2', _0: A4(func, a, b, c, d), _1: seed4 }; }); }); var _elm_lang$core$Random$map5 = F6(function (func, _p45, _p44, _p43, _p42, _p41) { var _p46 = _p45; var _p47 = _p44; var _p48 = _p43; var _p49 = _p42; var _p50 = _p41; return _elm_lang$core$Random$Generator(function (seed0) { var _p51 = _p46._0(seed0); var a = _p51._0; var seed1 = _p51._1; var _p52 = _p47._0(seed1); var b = _p52._0; var seed2 = _p52._1; var _p53 = _p48._0(seed2); var c = _p53._0; var seed3 = _p53._1; var _p54 = _p49._0(seed3); var d = _p54._0; var seed4 = _p54._1; var _p55 = _p50._0(seed4); var e = _p55._0; var seed5 = _p55._1; return { ctor: '_Tuple2', _0: A5(func, a, b, c, d, e), _1: seed5 }; }); }); var _elm_lang$core$Random$andThen = F2(function (callback, _p56) { var _p57 = _p56; return _elm_lang$core$Random$Generator(function (seed) { var _p58 = _p57._0(seed); var result = _p58._0; var newSeed = _p58._1; var _p59 = callback(result); var genB = _p59._0; return genB(newSeed); }); }); var _elm_lang$core$Random$State = F2(function (a, b) { return { ctor: 'State', _0: a, _1: b }; }); var _elm_lang$core$Random$initState = function _elm_lang$core$Random$initState(seed) { var s = A2(_elm_lang$core$Basics$max, seed, 0 - seed); var q = s / (_elm_lang$core$Random$magicNum6 - 1) | 0; var s2 = A2(_elm_lang$core$Basics_ops['%'], q, _elm_lang$core$Random$magicNum7 - 1); var s1 = A2(_elm_lang$core$Basics_ops['%'], s, _elm_lang$core$Random$magicNum6 - 1); return A2(_elm_lang$core$Random$State, s1 + 1, s2 + 1); }; var _elm_lang$core$Random$next = function _elm_lang$core$Random$next(_p60) { var _p61 = _p60; var _p63 = _p61._1; var _p62 = _p61._0; var k2 = _p63 / _elm_lang$core$Random$magicNum3 | 0; var rawState2 = _elm_lang$core$Random$magicNum4 * (_p63 - k2 * _elm_lang$core$Random$magicNum3) - k2 * _elm_lang$core$Random$magicNum5; var newState2 = _elm_lang$core$Native_Utils.cmp(rawState2, 0) < 0 ? rawState2 + _elm_lang$core$Random$magicNum7 : rawState2; var k1 = _p62 / _elm_lang$core$Random$magicNum1 | 0; var rawState1 = _elm_lang$core$Random$magicNum0 * (_p62 - k1 * _elm_lang$core$Random$magicNum1) - k1 * _elm_lang$core$Random$magicNum2; var newState1 = _elm_lang$core$Native_Utils.cmp(rawState1, 0) < 0 ? rawState1 + _elm_lang$core$Random$magicNum6 : rawState1; var z = newState1 - newState2; var newZ = _elm_lang$core$Native_Utils.cmp(z, 1) < 0 ? z + _elm_lang$core$Random$magicNum8 : z; return { ctor: '_Tuple2', _0: newZ, _1: A2(_elm_lang$core$Random$State, newState1, newState2) }; }; var _elm_lang$core$Random$split = function _elm_lang$core$Random$split(_p64) { var _p65 = _p64; var _p68 = _p65._1; var _p67 = _p65._0; var _p66 = _elm_lang$core$Tuple$second(_elm_lang$core$Random$next(_p65)); var t1 = _p66._0; var t2 = _p66._1; var new_s2 = _elm_lang$core$Native_Utils.eq(_p68, 1) ? _elm_lang$core$Random$magicNum7 - 1 : _p68 - 1; var new_s1 = _elm_lang$core$Native_Utils.eq(_p67, _elm_lang$core$Random$magicNum6 - 1) ? 1 : _p67 + 1; return { ctor: '_Tuple2', _0: A2(_elm_lang$core$Random$State, new_s1, t2), _1: A2(_elm_lang$core$Random$State, t1, new_s2) }; }; var _elm_lang$core$Random$Seed = function _elm_lang$core$Random$Seed(a) { return { ctor: 'Seed', _0: a }; }; var _elm_lang$core$Random$int = F2(function (a, b) { return _elm_lang$core$Random$Generator(function (_p69) { var _p70 = _p69; var _p75 = _p70._0; var base = 2147483561; var f = F3(function (n, acc, state) { f: while (true) { var _p71 = n; if (_p71 === 0) { return { ctor: '_Tuple2', _0: acc, _1: state }; } else { var _p72 = _p75.next(state); var x = _p72._0; var nextState = _p72._1; var _v27 = n - 1, _v28 = x + acc * base, _v29 = nextState; n = _v27; acc = _v28; state = _v29; continue f; } } }); var _p73 = _elm_lang$core$Native_Utils.cmp(a, b) < 0 ? { ctor: '_Tuple2', _0: a, _1: b } : { ctor: '_Tuple2', _0: b, _1: a }; var lo = _p73._0; var hi = _p73._1; var k = hi - lo + 1; var n = A2(_elm_lang$core$Random$iLogBase, base, k); var _p74 = A3(f, n, 1, _p75.state); var v = _p74._0; var nextState = _p74._1; return { ctor: '_Tuple2', _0: lo + A2(_elm_lang$core$Basics_ops['%'], v, k), _1: _elm_lang$core$Random$Seed(_elm_lang$core$Native_Utils.update(_p75, { state: nextState })) }; }); }); var _elm_lang$core$Random$bool = A2(_elm_lang$core$Random$map, F2(function (x, y) { return _elm_lang$core$Native_Utils.eq(x, y); })(1), A2(_elm_lang$core$Random$int, 0, 1)); var _elm_lang$core$Random$float = F2(function (a, b) { return _elm_lang$core$Random$Generator(function (seed) { var _p76 = A2(_elm_lang$core$Random$step, A2(_elm_lang$core$Random$int, _elm_lang$core$Random$minInt, _elm_lang$core$Random$maxInt), seed); var number = _p76._0; var newSeed = _p76._1; var negativeOneToOne = _elm_lang$core$Basics$toFloat(number) / _elm_lang$core$Basics$toFloat(_elm_lang$core$Random$maxInt - _elm_lang$core$Random$minInt); var _p77 = _elm_lang$core$Native_Utils.cmp(a, b) < 0 ? { ctor: '_Tuple2', _0: a, _1: b } : { ctor: '_Tuple2', _0: b, _1: a }; var lo = _p77._0; var hi = _p77._1; var scaled = (lo + hi) / 2 + (hi - lo) * negativeOneToOne; return { ctor: '_Tuple2', _0: scaled, _1: newSeed }; }); }); var _elm_lang$core$Random$initialSeed = function _elm_lang$core$Random$initialSeed(n) { return _elm_lang$core$Random$Seed({ state: _elm_lang$core$Random$initState(n), next: _elm_lang$core$Random$next, split: _elm_lang$core$Random$split, range: _elm_lang$core$Random$range }); }; var _elm_lang$core$Random$init = A2(_elm_lang$core$Task$andThen, function (t) { return _elm_lang$core$Task$succeed(_elm_lang$core$Random$initialSeed(_elm_lang$core$Basics$round(t))); }, _elm_lang$core$Time$now); var _elm_lang$core$Random$Generate = function _elm_lang$core$Random$Generate(a) { return { ctor: 'Generate', _0: a }; }; var _elm_lang$core$Random$generate = F2(function (tagger, generator) { return _elm_lang$core$Random$command(_elm_lang$core$Random$Generate(A2(_elm_lang$core$Random$map, tagger, generator))); }); var _elm_lang$core$Random$cmdMap = F2(function (func, _p78) { var _p79 = _p78; return _elm_lang$core$Random$Generate(A2(_elm_lang$core$Random$map, func, _p79._0)); }); _elm_lang$core$Native_Platform.effectManagers['Random'] = { pkg: 'elm-lang/core', init: _elm_lang$core$Random$init, onEffects: _elm_lang$core$Random$onEffects, onSelfMsg: _elm_lang$core$Random$onSelfMsg, tag: 'cmd', cmdMap: _elm_lang$core$Random$cmdMap }; var _elm_lang$dom$Native_Dom = function () { var fakeNode = { addEventListener: function addEventListener() {}, removeEventListener: function removeEventListener() {} }; var onDocument = on(typeof document !== 'undefined' ? document : fakeNode); var onWindow = on(typeof window !== 'undefined' ? window : fakeNode); function on(node) { return function (eventName, decoder, toTask) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { function performTask(event) { var result = A2(_elm_lang$core$Json_Decode$decodeValue, decoder, event); if (result.ctor === 'Ok') { _elm_lang$core$Native_Scheduler.rawSpawn(toTask(result._0)); } } node.addEventListener(eventName, performTask); return function () { node.removeEventListener(eventName, performTask); }; }); }; } var rAF = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : function (callback) { callback(); }; function withNode(id, doStuff) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { rAF(function () { var node = document.getElementById(id); if (node === null) { callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'NotFound', _0: id })); return; } callback(_elm_lang$core$Native_Scheduler.succeed(doStuff(node))); }); }); } // FOCUS function focus(id) { return withNode(id, function (node) { node.focus(); return _elm_lang$core$Native_Utils.Tuple0; }); } function blur(id) { return withNode(id, function (node) { node.blur(); return _elm_lang$core$Native_Utils.Tuple0; }); } // SCROLLING function getScrollTop(id) { return withNode(id, function (node) { return node.scrollTop; }); } function setScrollTop(id, desiredScrollTop) { return withNode(id, function (node) { node.scrollTop = desiredScrollTop; return _elm_lang$core$Native_Utils.Tuple0; }); } function toBottom(id) { return withNode(id, function (node) { node.scrollTop = node.scrollHeight; return _elm_lang$core$Native_Utils.Tuple0; }); } function getScrollLeft(id) { return withNode(id, function (node) { return node.scrollLeft; }); } function setScrollLeft(id, desiredScrollLeft) { return withNode(id, function (node) { node.scrollLeft = desiredScrollLeft; return _elm_lang$core$Native_Utils.Tuple0; }); } function toRight(id) { return withNode(id, function (node) { node.scrollLeft = node.scrollWidth; return _elm_lang$core$Native_Utils.Tuple0; }); } // SIZE function width(options, id) { return withNode(id, function (node) { switch (options.ctor) { case 'Content': return node.scrollWidth; case 'VisibleContent': return node.clientWidth; case 'VisibleContentWithBorders': return node.offsetWidth; case 'VisibleContentWithBordersAndMargins': var rect = node.getBoundingClientRect(); return rect.right - rect.left; } }); } function height(options, id) { return withNode(id, function (node) { switch (options.ctor) { case 'Content': return node.scrollHeight; case 'VisibleContent': return node.clientHeight; case 'VisibleContentWithBorders': return node.offsetHeight; case 'VisibleContentWithBordersAndMargins': var rect = node.getBoundingClientRect(); return rect.bottom - rect.top; } }); } return { onDocument: F3(onDocument), onWindow: F3(onWindow), focus: focus, blur: blur, getScrollTop: getScrollTop, setScrollTop: F2(setScrollTop), getScrollLeft: getScrollLeft, setScrollLeft: F2(setScrollLeft), toBottom: toBottom, toRight: toRight, height: F2(height), width: F2(width) }; }(); var _elm_lang$dom$Dom_LowLevel$onWindow = _elm_lang$dom$Native_Dom.onWindow; var _elm_lang$dom$Dom_LowLevel$onDocument = _elm_lang$dom$Native_Dom.onDocument; var _elm_lang$virtual_dom$VirtualDom_Debug$wrap; var _elm_lang$virtual_dom$VirtualDom_Debug$wrapWithFlags; var _elm_lang$virtual_dom$Native_VirtualDom = function () { var STYLE_KEY = 'STYLE'; var EVENT_KEY = 'EVENT'; var ATTR_KEY = 'ATTR'; var ATTR_NS_KEY = 'ATTR_NS'; var localDoc = typeof document !== 'undefined' ? document : {}; //////////// VIRTUAL DOM NODES //////////// function text(string) { return { type: 'text', text: string }; } function node(tag) { return F2(function (factList, kidList) { return nodeHelp(tag, factList, kidList); }); } function nodeHelp(tag, factList, kidList) { var organized = organizeFacts(factList); var namespace = organized.namespace; var facts = organized.facts; var children = []; var descendantsCount = 0; while (kidList.ctor !== '[]') { var kid = kidList._0; descendantsCount += kid.descendantsCount || 0; children.push(kid); kidList = kidList._1; } descendantsCount += children.length; return { type: 'node', tag: tag, facts: facts, children: children, namespace: namespace, descendantsCount: descendantsCount }; } function keyedNode(tag, factList, kidList) { var organized = organizeFacts(factList); var namespace = organized.namespace; var facts = organized.facts; var children = []; var descendantsCount = 0; while (kidList.ctor !== '[]') { var kid = kidList._0; descendantsCount += kid._1.descendantsCount || 0; children.push(kid); kidList = kidList._1; } descendantsCount += children.length; return { type: 'keyed-node', tag: tag, facts: facts, children: children, namespace: namespace, descendantsCount: descendantsCount }; } function custom(factList, model, impl) { var facts = organizeFacts(factList).facts; return { type: 'custom', facts: facts, model: model, impl: impl }; } function map(tagger, node) { return { type: 'tagger', tagger: tagger, node: node, descendantsCount: 1 + (node.descendantsCount || 0) }; } function thunk(func, args, thunk) { return { type: 'thunk', func: func, args: args, thunk: thunk, node: undefined }; } function lazy(fn, a) { return thunk(fn, [a], function () { return fn(a); }); } function lazy2(fn, a, b) { return thunk(fn, [a, b], function () { return A2(fn, a, b); }); } function lazy3(fn, a, b, c) { return thunk(fn, [a, b, c], function () { return A3(fn, a, b, c); }); } // FACTS function organizeFacts(factList) { var namespace, facts = {}; while (factList.ctor !== '[]') { var entry = factList._0; var key = entry.key; if (key === ATTR_KEY || key === ATTR_NS_KEY || key === EVENT_KEY) { var subFacts = facts[key] || {}; subFacts[entry.realKey] = entry.value; facts[key] = subFacts; } else if (key === STYLE_KEY) { var styles = facts[key] || {}; var styleList = entry.value; while (styleList.ctor !== '[]') { var style = styleList._0; styles[style._0] = style._1; styleList = styleList._1; } facts[key] = styles; } else if (key === 'namespace') { namespace = entry.value; } else if (key === 'className') { var classes = facts[key]; facts[key] = typeof classes === 'undefined' ? entry.value : classes + ' ' + entry.value; } else { facts[key] = entry.value; } factList = factList._1; } return { facts: facts, namespace: namespace }; } //////////// PROPERTIES AND ATTRIBUTES //////////// function style(value) { return { key: STYLE_KEY, value: value }; } function property(key, value) { return { key: key, value: value }; } function attribute(key, value) { return { key: ATTR_KEY, realKey: key, value: value }; } function attributeNS(namespace, key, value) { return { key: ATTR_NS_KEY, realKey: key, value: { value: value, namespace: namespace } }; } function on(name, options, decoder) { return { key: EVENT_KEY, realKey: name, value: { options: options, decoder: decoder } }; } function equalEvents(a, b) { if (a.options !== b.options) { if (a.options.stopPropagation !== b.options.stopPropagation || a.options.preventDefault !== b.options.preventDefault) { return false; } } return _elm_lang$core$Native_Json.equality(a.decoder, b.decoder); } function mapProperty(func, property) { if (property.key !== EVENT_KEY) { return property; } return on(property.realKey, property.value.options, A2(_elm_lang$core$Json_Decode$map, func, property.value.decoder)); } //////////// RENDER //////////// function render(vNode, eventNode) { switch (vNode.type) { case 'thunk': if (!vNode.node) { vNode.node = vNode.thunk(); } return render(vNode.node, eventNode); case 'tagger': var subNode = vNode.node; var tagger = vNode.tagger; while (subNode.type === 'tagger') { (typeof tagger === 'undefined' ? 'undefined' : _typeof(tagger)) !== 'object' ? tagger = [tagger, subNode.tagger] : tagger.push(subNode.tagger); subNode = subNode.node; } var subEventRoot = { tagger: tagger, parent: eventNode }; var domNode = render(subNode, subEventRoot); domNode.elm_event_node_ref = subEventRoot; return domNode; case 'text': return localDoc.createTextNode(vNode.text); case 'node': var domNode = vNode.namespace ? localDoc.createElementNS(vNode.namespace, vNode.tag) : localDoc.createElement(vNode.tag); applyFacts(domNode, eventNode, vNode.facts); var children = vNode.children; for (var i = 0; i < children.length; i++) { domNode.appendChild(render(children[i], eventNode)); } return domNode; case 'keyed-node': var domNode = vNode.namespace ? localDoc.createElementNS(vNode.namespace, vNode.tag) : localDoc.createElement(vNode.tag); applyFacts(domNode, eventNode, vNode.facts); var children = vNode.children; for (var i = 0; i < children.length; i++) { domNode.appendChild(render(children[i]._1, eventNode)); } return domNode; case 'custom': var domNode = vNode.impl.render(vNode.model); applyFacts(domNode, eventNode, vNode.facts); return domNode; } } //////////// APPLY FACTS //////////// function applyFacts(domNode, eventNode, facts) { for (var key in facts) { var value = facts[key]; switch (key) { case STYLE_KEY: applyStyles(domNode, value); break; case EVENT_KEY: applyEvents(domNode, eventNode, value); break; case ATTR_KEY: applyAttrs(domNode, value); break; case ATTR_NS_KEY: applyAttrsNS(domNode, value); break; case 'value': if (domNode[key] !== value) { domNode[key] = value; } break; default: domNode[key] = value; break; } } } function applyStyles(domNode, styles) { var domNodeStyle = domNode.style; for (var key in styles) { domNodeStyle[key] = styles[key]; } } function applyEvents(domNode, eventNode, events) { var allHandlers = domNode.elm_handlers || {}; for (var key in events) { var handler = allHandlers[key]; var value = events[key]; if (typeof value === 'undefined') { domNode.removeEventListener(key, handler); allHandlers[key] = undefined; } else if (typeof handler === 'undefined') { var handler = makeEventHandler(eventNode, value); domNode.addEventListener(key, handler); allHandlers[key] = handler; } else { handler.info = value; } } domNode.elm_handlers = allHandlers; } function makeEventHandler(eventNode, info) { function eventHandler(event) { var info = eventHandler.info; var value = A2(_elm_lang$core$Native_Json.run, info.decoder, event); if (value.ctor === 'Ok') { var options = info.options; if (options.stopPropagation) { event.stopPropagation(); } if (options.preventDefault) { event.preventDefault(); } var message = value._0; var currentEventNode = eventNode; while (currentEventNode) { var tagger = currentEventNode.tagger; if (typeof tagger === 'function') { message = tagger(message); } else { for (var i = tagger.length; i--;) { message = tagger[i](message); } } currentEventNode = currentEventNode.parent; } } }; eventHandler.info = info; return eventHandler; } function applyAttrs(domNode, attrs) { for (var key in attrs) { var value = attrs[key]; if (typeof value === 'undefined') { domNode.removeAttribute(key); } else { domNode.setAttribute(key, value); } } } function applyAttrsNS(domNode, nsAttrs) { for (var key in nsAttrs) { var pair = nsAttrs[key]; var namespace = pair.namespace; var value = pair.value; if (typeof value === 'undefined') { domNode.removeAttributeNS(namespace, key); } else { domNode.setAttributeNS(namespace, key, value); } } } //////////// DIFF //////////// function diff(a, b) { var patches = []; diffHelp(a, b, patches, 0); return patches; } function makePatch(type, index, data) { return { index: index, type: type, data: data, domNode: undefined, eventNode: undefined }; } function diffHelp(a, b, patches, index) { if (a === b) { return; } var aType = a.type; var bType = b.type; // Bail if you run into different types of nodes. Implies that the // structure has changed significantly and it's not worth a diff. if (aType !== bType) { patches.push(makePatch('p-redraw', index, b)); return; } // Now we know that both nodes are the same type. switch (bType) { case 'thunk': var aArgs = a.args; var bArgs = b.args; var i = aArgs.length; var same = a.func === b.func && i === bArgs.length; while (same && i--) { same = aArgs[i] === bArgs[i]; } if (same) { b.node = a.node; return; } b.node = b.thunk(); var subPatches = []; diffHelp(a.node, b.node, subPatches, 0); if (subPatches.length > 0) { patches.push(makePatch('p-thunk', index, subPatches)); } return; case 'tagger': // gather nested taggers var aTaggers = a.tagger; var bTaggers = b.tagger; var nesting = false; var aSubNode = a.node; while (aSubNode.type === 'tagger') { nesting = true; (typeof aTaggers === 'undefined' ? 'undefined' : _typeof(aTaggers)) !== 'object' ? aTaggers = [aTaggers, aSubNode.tagger] : aTaggers.push(aSubNode.tagger); aSubNode = aSubNode.node; } var bSubNode = b.node; while (bSubNode.type === 'tagger') { nesting = true; (typeof bTaggers === 'undefined' ? 'undefined' : _typeof(bTaggers)) !== 'object' ? bTaggers = [bTaggers, bSubNode.tagger] : bTaggers.push(bSubNode.tagger); bSubNode = bSubNode.node; } // Just bail if different numbers of taggers. This implies the // structure of the virtual DOM has changed. if (nesting && aTaggers.length !== bTaggers.length) { patches.push(makePatch('p-redraw', index, b)); return; } // check if taggers are "the same" if (nesting ? !pairwiseRefEqual(aTaggers, bTaggers) : aTaggers !== bTaggers) { patches.push(makePatch('p-tagger', index, bTaggers)); } // diff everything below the taggers diffHelp(aSubNode, bSubNode, patches, index + 1); return; case 'text': if (a.text !== b.text) { patches.push(makePatch('p-text', index, b.text)); return; } return; case 'node': // Bail if obvious indicators have changed. Implies more serious // structural changes such that it's not worth it to diff. if (a.tag !== b.tag || a.namespace !== b.namespace) { patches.push(makePatch('p-redraw', index, b)); return; } var factsDiff = diffFacts(a.facts, b.facts); if (typeof factsDiff !== 'undefined') { patches.push(makePatch('p-facts', index, factsDiff)); } diffChildren(a, b, patches, index); return; case 'keyed-node': // Bail if obvious indicators have changed. Implies more serious // structural changes such that it's not worth it to diff. if (a.tag !== b.tag || a.namespace !== b.namespace) { patches.push(makePatch('p-redraw', index, b)); return; } var factsDiff = diffFacts(a.facts, b.facts); if (typeof factsDiff !== 'undefined') { patches.push(makePatch('p-facts', index, factsDiff)); } diffKeyedChildren(a, b, patches, index); return; case 'custom': if (a.impl !== b.impl) { patches.push(makePatch('p-redraw', index, b)); return; } var factsDiff = diffFacts(a.facts, b.facts); if (typeof factsDiff !== 'undefined') { patches.push(makePatch('p-facts', index, factsDiff)); } var patch = b.impl.diff(a, b); if (patch) { patches.push(makePatch('p-custom', index, patch)); return; } return; } } // assumes the incoming arrays are the same length function pairwiseRefEqual(as, bs) { for (var i = 0; i < as.length; i++) { if (as[i] !== bs[i]) { return false; } } return true; } // TODO Instead of creating a new diff object, it's possible to just test if // there *is* a diff. During the actual patch, do the diff again and make the // modifications directly. This way, there's no new allocations. Worth it? function diffFacts(a, b, category) { var diff; // look for changes and removals for (var aKey in a) { if (aKey === STYLE_KEY || aKey === EVENT_KEY || aKey === ATTR_KEY || aKey === ATTR_NS_KEY) { var subDiff = diffFacts(a[aKey], b[aKey] || {}, aKey); if (subDiff) { diff = diff || {}; diff[aKey] = subDiff; } continue; } // remove if not in the new facts if (!(aKey in b)) { diff = diff || {}; diff[aKey] = typeof category === 'undefined' ? typeof a[aKey] === 'string' ? '' : null : category === STYLE_KEY ? '' : category === EVENT_KEY || category === ATTR_KEY ? undefined : { namespace: a[aKey].namespace, value: undefined }; continue; } var aValue = a[aKey]; var bValue = b[aKey]; // reference equal, so don't worry about it if (aValue === bValue && aKey !== 'value' || category === EVENT_KEY && equalEvents(aValue, bValue)) { continue; } diff = diff || {}; diff[aKey] = bValue; } // add new stuff for (var bKey in b) { if (!(bKey in a)) { diff = diff || {}; diff[bKey] = b[bKey]; } } return diff; } function diffChildren(aParent, bParent, patches, rootIndex) { var aChildren = aParent.children; var bChildren = bParent.children; var aLen = aChildren.length; var bLen = bChildren.length; // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS if (aLen > bLen) { patches.push(makePatch('p-remove-last', rootIndex, aLen - bLen)); } else if (aLen < bLen) { patches.push(makePatch('p-append', rootIndex, bChildren.slice(aLen))); } // PAIRWISE DIFF EVERYTHING ELSE var index = rootIndex; var minLen = aLen < bLen ? aLen : bLen; for (var i = 0; i < minLen; i++) { index++; var aChild = aChildren[i]; diffHelp(aChild, bChildren[i], patches, index); index += aChild.descendantsCount || 0; } } //////////// KEYED DIFF //////////// function diffKeyedChildren(aParent, bParent, patches, rootIndex) { var localPatches = []; var changes = {}; // Dict String Entry var inserts = []; // Array { index : Int, entry : Entry } // type Entry = { tag : String, vnode : VNode, index : Int, data : _ } var aChildren = aParent.children; var bChildren = bParent.children; var aLen = aChildren.length; var bLen = bChildren.length; var aIndex = 0; var bIndex = 0; var index = rootIndex; while (aIndex < aLen && bIndex < bLen) { var a = aChildren[aIndex]; var b = bChildren[bIndex]; var aKey = a._0; var bKey = b._0; var aNode = a._1; var bNode = b._1; // check if keys match if (aKey === bKey) { index++; diffHelp(aNode, bNode, localPatches, index); index += aNode.descendantsCount || 0; aIndex++; bIndex++; continue; } // look ahead 1 to detect insertions and removals. var aLookAhead = aIndex + 1 < aLen; var bLookAhead = bIndex + 1 < bLen; if (aLookAhead) { var aNext = aChildren[aIndex + 1]; var aNextKey = aNext._0; var aNextNode = aNext._1; var oldMatch = bKey === aNextKey; } if (bLookAhead) { var bNext = bChildren[bIndex + 1]; var bNextKey = bNext._0; var bNextNode = bNext._1; var newMatch = aKey === bNextKey; } // swap a and b if (aLookAhead && bLookAhead && newMatch && oldMatch) { index++; diffHelp(aNode, bNextNode, localPatches, index); insertNode(changes, localPatches, aKey, bNode, bIndex, inserts); index += aNode.descendantsCount || 0; index++; removeNode(changes, localPatches, aKey, aNextNode, index); index += aNextNode.descendantsCount || 0; aIndex += 2; bIndex += 2; continue; } // insert b if (bLookAhead && newMatch) { index++; insertNode(changes, localPatches, bKey, bNode, bIndex, inserts); diffHelp(aNode, bNextNode, localPatches, index); index += aNode.descendantsCount || 0; aIndex += 1; bIndex += 2; continue; } // remove a if (aLookAhead && oldMatch) { index++; removeNode(changes, localPatches, aKey, aNode, index); index += aNode.descendantsCount || 0; index++; diffHelp(aNextNode, bNode, localPatches, index); index += aNextNode.descendantsCount || 0; aIndex += 2; bIndex += 1; continue; } // remove a, insert b if (aLookAhead && bLookAhead && aNextKey === bNextKey) { index++; removeNode(changes, localPatches, aKey, aNode, index); insertNode(changes, localPatches, bKey, bNode, bIndex, inserts); index += aNode.descendantsCount || 0; index++; diffHelp(aNextNode, bNextNode, localPatches, index); index += aNextNode.descendantsCount || 0; aIndex += 2; bIndex += 2; continue; } break; } // eat up any remaining nodes with removeNode and insertNode while (aIndex < aLen) { index++; var a = aChildren[aIndex]; var aNode = a._1; removeNode(changes, localPatches, a._0, aNode, index); index += aNode.descendantsCount || 0; aIndex++; } var endInserts; while (bIndex < bLen) { endInserts = endInserts || []; var b = bChildren[bIndex]; insertNode(changes, localPatches, b._0, b._1, undefined, endInserts); bIndex++; } if (localPatches.length > 0 || inserts.length > 0 || typeof endInserts !== 'undefined') { patches.push(makePatch('p-reorder', rootIndex, { patches: localPatches, inserts: inserts, endInserts: endInserts })); } } //////////// CHANGES FROM KEYED DIFF //////////// var POSTFIX = '_elmW6BL'; function insertNode(changes, localPatches, key, vnode, bIndex, inserts) { var entry = changes[key]; // never seen this key before if (typeof entry === 'undefined') { entry = { tag: 'insert', vnode: vnode, index: bIndex, data: undefined }; inserts.push({ index: bIndex, entry: entry }); changes[key] = entry; return; } // this key was removed earlier, a match! if (entry.tag === 'remove') { inserts.push({ index: bIndex, entry: entry }); entry.tag = 'move'; var subPatches = []; diffHelp(entry.vnode, vnode, subPatches, entry.index); entry.index = bIndex; entry.data.data = { patches: subPatches, entry: entry }; return; } // this key has already been inserted or moved, a duplicate! insertNode(changes, localPatches, key + POSTFIX, vnode, bIndex, inserts); } function removeNode(changes, localPatches, key, vnode, index) { var entry = changes[key]; // never seen this key before if (typeof entry === 'undefined') { var patch = makePatch('p-remove', index, undefined); localPatches.push(patch); changes[key] = { tag: 'remove', vnode: vnode, index: index, data: patch }; return; } // this key was inserted earlier, a match! if (entry.tag === 'insert') { entry.tag = 'move'; var subPatches = []; diffHelp(vnode, entry.vnode, subPatches, index); var patch = makePatch('p-remove', index, { patches: subPatches, entry: entry }); localPatches.push(patch); return; } // this key has already been removed or moved, a duplicate! removeNode(changes, localPatches, key + POSTFIX, vnode, index); } //////////// ADD DOM NODES //////////// // // Each DOM node has an "index" assigned in order of traversal. It is important // to minimize our crawl over the actual DOM, so these indexes (along with the // descendantsCount of virtual nodes) let us skip touching entire subtrees of // the DOM if we know there are no patches there. function addDomNodes(domNode, vNode, patches, eventNode) { addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.descendantsCount, eventNode); } // assumes `patches` is non-empty and indexes increase monotonically. function addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode) { var patch = patches[i]; var index = patch.index; while (index === low) { var patchType = patch.type; if (patchType === 'p-thunk') { addDomNodes(domNode, vNode.node, patch.data, eventNode); } else if (patchType === 'p-reorder') { patch.domNode = domNode; patch.eventNode = eventNode; var subPatches = patch.data.patches; if (subPatches.length > 0) { addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); } } else if (patchType === 'p-remove') { patch.domNode = domNode; patch.eventNode = eventNode; var data = patch.data; if (typeof data !== 'undefined') { data.entry.data = domNode; var subPatches = data.patches; if (subPatches.length > 0) { addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); } } } else { patch.domNode = domNode; patch.eventNode = eventNode; } i++; if (!(patch = patches[i]) || (index = patch.index) > high) { return i; } } switch (vNode.type) { case 'tagger': var subNode = vNode.node; while (subNode.type === "tagger") { subNode = subNode.node; } return addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref); case 'node': var vChildren = vNode.children; var childNodes = domNode.childNodes; for (var j = 0; j < vChildren.length; j++) { low++; var vChild = vChildren[j]; var nextLow = low + (vChild.descendantsCount || 0); if (low <= index && index <= nextLow) { i = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode); if (!(patch = patches[i]) || (index = patch.index) > high) { return i; } } low = nextLow; } return i; case 'keyed-node': var vChildren = vNode.children; var childNodes = domNode.childNodes; for (var j = 0; j < vChildren.length; j++) { low++; var vChild = vChildren[j]._1; var nextLow = low + (vChild.descendantsCount || 0); if (low <= index && index <= nextLow) { i = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode); if (!(patch = patches[i]) || (index = patch.index) > high) { return i; } } low = nextLow; } return i; case 'text': case 'thunk': throw new Error('should never traverse `text` or `thunk` nodes like this'); } } //////////// APPLY PATCHES //////////// function applyPatches(rootDomNode, oldVirtualNode, patches, eventNode) { if (patches.length === 0) { return rootDomNode; } addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode); return applyPatchesHelp(rootDomNode, patches); } function applyPatchesHelp(rootDomNode, patches) { for (var i = 0; i < patches.length; i++) { var patch = patches[i]; var localDomNode = patch.domNode; var newNode = applyPatch(localDomNode, patch); if (localDomNode === rootDomNode) { rootDomNode = newNode; } } return rootDomNode; } function applyPatch(domNode, patch) { switch (patch.type) { case 'p-redraw': return applyPatchRedraw(domNode, patch.data, patch.eventNode); case 'p-facts': applyFacts(domNode, patch.eventNode, patch.data); return domNode; case 'p-text': domNode.replaceData(0, domNode.length, patch.data); return domNode; case 'p-thunk': return applyPatchesHelp(domNode, patch.data); case 'p-tagger': if (typeof domNode.elm_event_node_ref !== 'undefined') { domNode.elm_event_node_ref.tagger = patch.data; } else { domNode.elm_event_node_ref = { tagger: patch.data, parent: patch.eventNode }; } return domNode; case 'p-remove-last': var i = patch.data; while (i--) { domNode.removeChild(domNode.lastChild); } return domNode; case 'p-append': var newNodes = patch.data; for (var i = 0; i < newNodes.length; i++) { domNode.appendChild(render(newNodes[i], patch.eventNode)); } return domNode; case 'p-remove': var data = patch.data; if (typeof data === 'undefined') { domNode.parentNode.removeChild(domNode); return domNode; } var entry = data.entry; if (typeof entry.index !== 'undefined') { domNode.parentNode.removeChild(domNode); } entry.data = applyPatchesHelp(domNode, data.patches); return domNode; case 'p-reorder': return applyPatchReorder(domNode, patch); case 'p-custom': var impl = patch.data; return impl.applyPatch(domNode, impl.data); default: throw new Error('Ran into an unknown patch!'); } } function applyPatchRedraw(domNode, vNode, eventNode) { var parentNode = domNode.parentNode; var newNode = render(vNode, eventNode); if (typeof newNode.elm_event_node_ref === 'undefined') { newNode.elm_event_node_ref = domNode.elm_event_node_ref; } if (parentNode && newNode !== domNode) { parentNode.replaceChild(newNode, domNode); } return newNode; } function applyPatchReorder(domNode, patch) { var data = patch.data; // remove end inserts var frag = applyPatchReorderEndInsertsHelp(data.endInserts, patch); // removals domNode = applyPatchesHelp(domNode, data.patches); // inserts var inserts = data.inserts; for (var i = 0; i < inserts.length; i++) { var insert = inserts[i]; var entry = insert.entry; var node = entry.tag === 'move' ? entry.data : render(entry.vnode, patch.eventNode); domNode.insertBefore(node, domNode.childNodes[insert.index]); } // add end inserts if (typeof frag !== 'undefined') { domNode.appendChild(frag); } return domNode; } function applyPatchReorderEndInsertsHelp(endInserts, patch) { if (typeof endInserts === 'undefined') { return; } var frag = localDoc.createDocumentFragment(); for (var i = 0; i < endInserts.length; i++) { var insert = endInserts[i]; var entry = insert.entry; frag.appendChild(entry.tag === 'move' ? entry.data : render(entry.vnode, patch.eventNode)); } return frag; } // PROGRAMS var program = makeProgram(checkNoFlags); var programWithFlags = makeProgram(checkYesFlags); function makeProgram(flagChecker) { return F2(function (debugWrap, impl) { return function (flagDecoder) { return function (object, moduleName, debugMetadata) { var checker = flagChecker(flagDecoder, moduleName); if (typeof debugMetadata === 'undefined') { normalSetup(impl, object, moduleName, checker); } else { debugSetup(A2(debugWrap, debugMetadata, impl), object, moduleName, checker); } }; }; }); } function staticProgram(vNode) { var nothing = _elm_lang$core$Native_Utils.Tuple2(_elm_lang$core$Native_Utils.Tuple0, _elm_lang$core$Platform_Cmd$none); return A2(program, _elm_lang$virtual_dom$VirtualDom_Debug$wrap, { init: nothing, view: function view() { return vNode; }, update: F2(function () { return nothing; }), subscriptions: function subscriptions() { return _elm_lang$core$Platform_Sub$none; } })(); } // FLAG CHECKERS function checkNoFlags(flagDecoder, moduleName) { return function (init, flags, domNode) { if (typeof flags === 'undefined') { return init; } var errorMessage = 'The `' + moduleName + '` module does not need flags.\n' + 'Initialize it with no arguments and you should be all set!'; crash(errorMessage, domNode); }; } function checkYesFlags(flagDecoder, moduleName) { return function (init, flags, domNode) { if (typeof flagDecoder === 'undefined') { var errorMessage = 'Are you trying to sneak a Never value into Elm? Trickster!\n' + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\n' + 'Use `program` instead if you do not want flags.'; crash(errorMessage, domNode); } var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags); if (result.ctor === 'Ok') { return init(result._0); } var errorMessage = 'Trying to initialize the `' + moduleName + '` module with an unexpected flag.\n' + 'I tried to convert it to an Elm value, but ran into this problem:\n\n' + result._0; crash(errorMessage, domNode); }; } function crash(errorMessage, domNode) { if (domNode) { domNode.innerHTML = '<div style="padding-left:1em;">' + '<h2 style="font-weight:normal;"><b>Oops!</b> Something went wrong when starting your Elm program.</h2>' + '<pre style="padding-left:1em;">' + errorMessage + '</pre>' + '</div>'; } throw new Error(errorMessage); } // NORMAL SETUP function normalSetup(impl, object, moduleName, flagChecker) { object['embed'] = function embed(node, flags) { while (node.lastChild) { node.removeChild(node.lastChild); } return _elm_lang$core$Native_Platform.initialize(flagChecker(impl.init, flags, node), impl.update, impl.subscriptions, normalRenderer(node, impl.view)); }; object['fullscreen'] = function fullscreen(flags) { return _elm_lang$core$Native_Platform.initialize(flagChecker(impl.init, flags, document.body), impl.update, impl.subscriptions, normalRenderer(document.body, impl.view)); }; } function normalRenderer(parentNode, view) { return function (tagger, initialModel) { var eventNode = { tagger: tagger, parent: undefined }; var initialVirtualNode = view(initialModel); var domNode = render(initialVirtualNode, eventNode); parentNode.appendChild(domNode); return makeStepper(domNode, view, initialVirtualNode, eventNode); }; } // STEPPER var rAF = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : function (callback) { setTimeout(callback, 1000 / 60); }; function makeStepper(domNode, view, initialVirtualNode, eventNode) { var state = 'NO_REQUEST'; var currNode = initialVirtualNode; var nextModel; function updateIfNeeded() { switch (state) { case 'NO_REQUEST': throw new Error('Unexpected draw callback.\n' + 'Please report this to <https://github.com/elm-lang/virtual-dom/issues>.'); case 'PENDING_REQUEST': rAF(updateIfNeeded); state = 'EXTRA_REQUEST'; var nextNode = view(nextModel); var patches = diff(currNode, nextNode); domNode = applyPatches(domNode, currNode, patches, eventNode); currNode = nextNode; return; case 'EXTRA_REQUEST': state = 'NO_REQUEST'; return; } } return function stepper(model) { if (state === 'NO_REQUEST') { rAF(updateIfNeeded); } state = 'PENDING_REQUEST'; nextModel = model; }; } // DEBUG SETUP function debugSetup(impl, object, moduleName, flagChecker) { object['fullscreen'] = function fullscreen(flags) { var popoutRef = { doc: undefined }; return _elm_lang$core$Native_Platform.initialize(flagChecker(impl.init, flags, document.body), impl.update(scrollTask(popoutRef)), impl.subscriptions, debugRenderer(moduleName, document.body, popoutRef, impl.view, impl.viewIn, impl.viewOut)); }; object['embed'] = function fullscreen(node, flags) { var popoutRef = { doc: undefined }; return _elm_lang$core$Native_Platform.initialize(flagChecker(impl.init, flags, node), impl.update(scrollTask(popoutRef)), impl.subscriptions, debugRenderer(moduleName, node, popoutRef, impl.view, impl.viewIn, impl.viewOut)); }; } function scrollTask(popoutRef) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { var doc = popoutRef.doc; if (doc) { var msgs = doc.getElementsByClassName('debugger-sidebar-messages')[0]; if (msgs) { msgs.scrollTop = msgs.scrollHeight; } } callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function debugRenderer(moduleName, parentNode, popoutRef, view, viewIn, viewOut) { return function (tagger, initialModel) { var appEventNode = { tagger: tagger, parent: undefined }; var eventNode = { tagger: tagger, parent: undefined }; // make normal stepper var appVirtualNode = view(initialModel); var appNode = render(appVirtualNode, appEventNode); parentNode.appendChild(appNode); var appStepper = makeStepper(appNode, view, appVirtualNode, appEventNode); // make overlay stepper var overVirtualNode = viewIn(initialModel)._1; var overNode = render(overVirtualNode, eventNode); parentNode.appendChild(overNode); var wrappedViewIn = wrapViewIn(appEventNode, overNode, viewIn); var overStepper = makeStepper(overNode, wrappedViewIn, overVirtualNode, eventNode); // make debugger stepper var debugStepper = makeDebugStepper(initialModel, viewOut, eventNode, parentNode, moduleName, popoutRef); return function stepper(model) { appStepper(model); overStepper(model); debugStepper(model); }; }; } function makeDebugStepper(initialModel, view, eventNode, parentNode, moduleName, popoutRef) { var curr; var domNode; return function stepper(model) { if (!model.isDebuggerOpen) { return; } if (!popoutRef.doc) { curr = view(model); domNode = openDebugWindow(moduleName, popoutRef, curr, eventNode); return; } // switch to document of popout localDoc = popoutRef.doc; var next = view(model); var patches = diff(curr, next); domNode = applyPatches(domNode, curr, patches, eventNode); curr = next; // switch back to normal document localDoc = document; }; } function openDebugWindow(moduleName, popoutRef, virtualNode, eventNode) { var w = 900; var h = 360; var x = screen.width - w; var y = screen.height - h; var debugWindow = window.open('', '', 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y); // switch to window document localDoc = debugWindow.document; popoutRef.doc = localDoc; localDoc.title = 'Debugger - ' + moduleName; localDoc.body.style.margin = '0'; localDoc.body.style.padding = '0'; var domNode = render(virtualNode, eventNode); localDoc.body.appendChild(domNode); localDoc.addEventListener('keydown', function (event) { if (event.metaKey && event.which === 82) { window.location.reload(); } if (event.which === 38) { eventNode.tagger({ ctor: 'Up' }); event.preventDefault(); } if (event.which === 40) { eventNode.tagger({ ctor: 'Down' }); event.preventDefault(); } }); function close() { popoutRef.doc = undefined; debugWindow.close(); } window.addEventListener('unload', close); debugWindow.addEventListener('unload', function () { popoutRef.doc = undefined; window.removeEventListener('unload', close); eventNode.tagger({ ctor: 'Close' }); }); // switch back to the normal document localDoc = document; return domNode; } // BLOCK EVENTS function wrapViewIn(appEventNode, overlayNode, viewIn) { var ignorer = makeIgnorer(overlayNode); var blocking = 'Normal'; var overflow; var normalTagger = appEventNode.tagger; var blockTagger = function blockTagger() {}; return function (model) { var tuple = viewIn(model); var newBlocking = tuple._0.ctor; appEventNode.tagger = newBlocking === 'Normal' ? normalTagger : blockTagger; if (blocking !== newBlocking) { traverse('removeEventListener', ignorer, blocking); traverse('addEventListener', ignorer, newBlocking); if (blocking === 'Normal') { overflow = document.body.style.overflow; document.body.style.overflow = 'hidden'; } if (newBlocking === 'Normal') { document.body.style.overflow = overflow; } blocking = newBlocking; } return tuple._1; }; } function traverse(verbEventListener, ignorer, blocking) { switch (blocking) { case 'Normal': return; case 'Pause': return traverseHelp(verbEventListener, ignorer, mostEvents); case 'Message': return traverseHelp(verbEventListener, ignorer, allEvents); } } function traverseHelp(verbEventListener, handler, eventNames) { for (var i = 0; i < eventNames.length; i++) { document.body[verbEventListener](eventNames[i], handler, true); } } function makeIgnorer(overlayNode) { return function (event) { if (event.type === 'keydown' && event.metaKey && event.which === 82) { return; } var isScroll = event.type === 'scroll' || event.type === 'wheel'; var node = event.target; while (node !== null) { if (node.className === 'elm-overlay-message-details' && isScroll) { return; } if (node === overlayNode && !isScroll) { return; } node = node.parentNode; } event.stopPropagation(); event.preventDefault(); }; } var mostEvents = ['click', 'dblclick', 'mousemove', 'mouseup', 'mousedown', 'mouseenter', 'mouseleave', 'touchstart', 'touchend', 'touchcancel', 'touchmove', 'pointerdown', 'pointerup', 'pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove', 'pointercancel', 'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop', 'keyup', 'keydown', 'keypress', 'input', 'change', 'focus', 'blur']; var allEvents = mostEvents.concat('wheel', 'scroll'); return { node: node, text: text, custom: custom, map: F2(map), on: F3(on), style: style, property: F2(property), attribute: F2(attribute), attributeNS: F3(attributeNS), mapProperty: F2(mapProperty), lazy: F2(lazy), lazy2: F3(lazy2), lazy3: F4(lazy3), keyedNode: F3(keyedNode), program: program, programWithFlags: programWithFlags, staticProgram: staticProgram }; }(); var _elm_lang$virtual_dom$VirtualDom$programWithFlags = function _elm_lang$virtual_dom$VirtualDom$programWithFlags(impl) { return A2(_elm_lang$virtual_dom$Native_VirtualDom.programWithFlags, _elm_lang$virtual_dom$VirtualDom_Debug$wrapWithFlags, impl); }; var _elm_lang$virtual_dom$VirtualDom$program = function _elm_lang$virtual_dom$VirtualDom$program(impl) { return A2(_elm_lang$virtual_dom$Native_VirtualDom.program, _elm_lang$virtual_dom$VirtualDom_Debug$wrap, impl); }; var _elm_lang$virtual_dom$VirtualDom$keyedNode = _elm_lang$virtual_dom$Native_VirtualDom.keyedNode; var _elm_lang$virtual_dom$VirtualDom$lazy3 = _elm_lang$virtual_dom$Native_VirtualDom.lazy3; var _elm_lang$virtual_dom$VirtualDom$lazy2 = _elm_lang$virtual_dom$Native_VirtualDom.lazy2; var _elm_lang$virtual_dom$VirtualDom$lazy = _elm_lang$virtual_dom$Native_VirtualDom.lazy; var _elm_lang$virtual_dom$VirtualDom$defaultOptions = { stopPropagation: false, preventDefault: false }; var _elm_lang$virtual_dom$VirtualDom$onWithOptions = _elm_lang$virtual_dom$Native_VirtualDom.on; var _elm_lang$virtual_dom$VirtualDom$on = F2(function (eventName, decoder) { return A3(_elm_lang$virtual_dom$VirtualDom$onWithOptions, eventName, _elm_lang$virtual_dom$VirtualDom$defaultOptions, decoder); }); var _elm_lang$virtual_dom$VirtualDom$style = _elm_lang$virtual_dom$Native_VirtualDom.style; var _elm_lang$virtual_dom$VirtualDom$mapProperty = _elm_lang$virtual_dom$Native_VirtualDom.mapProperty; var _elm_lang$virtual_dom$VirtualDom$attributeNS = _elm_lang$virtual_dom$Native_VirtualDom.attributeNS; var _elm_lang$virtual_dom$VirtualDom$attribute = _elm_lang$virtual_dom$Native_VirtualDom.attribute; var _elm_lang$virtual_dom$VirtualDom$property = _elm_lang$virtual_dom$Native_VirtualDom.property; var _elm_lang$virtual_dom$VirtualDom$map = _elm_lang$virtual_dom$Native_VirtualDom.map; var _elm_lang$virtual_dom$VirtualDom$text = _elm_lang$virtual_dom$Native_VirtualDom.text; var _elm_lang$virtual_dom$VirtualDom$node = _elm_lang$virtual_dom$Native_VirtualDom.node; var _elm_lang$virtual_dom$VirtualDom$Options = F2(function (a, b) { return { stopPropagation: a, preventDefault: b }; }); var _elm_lang$virtual_dom$VirtualDom$Node = { ctor: 'Node' }; var _elm_lang$virtual_dom$VirtualDom$Property = { ctor: 'Property' }; var _elm_lang$html$Html$programWithFlags = _elm_lang$virtual_dom$VirtualDom$programWithFlags; var _elm_lang$html$Html$program = _elm_lang$virtual_dom$VirtualDom$program; var _elm_lang$html$Html$beginnerProgram = function _elm_lang$html$Html$beginnerProgram(_p0) { var _p1 = _p0; return _elm_lang$html$Html$program({ init: A2(_elm_lang$core$Platform_Cmd_ops['!'], _p1.model, { ctor: '[]' }), update: F2(function (msg, model) { return A2(_elm_lang$core$Platform_Cmd_ops['!'], A2(_p1.update, msg, model), { ctor: '[]' }); }), view: _p1.view, subscriptions: function subscriptions(_p2) { return _elm_lang$core$Platform_Sub$none; } }); }; var _elm_lang$html$Html$map = _elm_lang$virtual_dom$VirtualDom$map; var _elm_lang$html$Html$text = _elm_lang$virtual_dom$VirtualDom$text; var _elm_lang$html$Html$node = _elm_lang$virtual_dom$VirtualDom$node; var _elm_lang$html$Html$body = _elm_lang$html$Html$node('body'); var _elm_lang$html$Html$section = _elm_lang$html$Html$node('section'); var _elm_lang$html$Html$nav = _elm_lang$html$Html$node('nav'); var _elm_lang$html$Html$article = _elm_lang$html$Html$node('article'); var _elm_lang$html$Html$aside = _elm_lang$html$Html$node('aside'); var _elm_lang$html$Html$h1 = _elm_lang$html$Html$node('h1'); var _elm_lang$html$Html$h2 = _elm_lang$html$Html$node('h2'); var _elm_lang$html$Html$h3 = _elm_lang$html$Html$node('h3'); var _elm_lang$html$Html$h4 = _elm_lang$html$Html$node('h4'); var _elm_lang$html$Html$h5 = _elm_lang$html$Html$node('h5'); var _elm_lang$html$Html$h6 = _elm_lang$html$Html$node('h6'); var _elm_lang$html$Html$header = _elm_lang$html$Html$node('header'); var _elm_lang$html$Html$footer = _elm_lang$html$Html$node('footer'); var _elm_lang$html$Html$address = _elm_lang$html$Html$node('address'); var _elm_lang$html$Html$main_ = _elm_lang$html$Html$node('main'); var _elm_lang$html$Html$p = _elm_lang$html$Html$node('p'); var _elm_lang$html$Html$hr = _elm_lang$html$Html$node('hr'); var _elm_lang$html$Html$pre = _elm_lang$html$Html$node('pre'); var _elm_lang$html$Html$blockquote = _elm_lang$html$Html$node('blockquote'); var _elm_lang$html$Html$ol = _elm_lang$html$Html$node('ol'); var _elm_lang$html$Html$ul = _elm_lang$html$Html$node('ul'); var _elm_lang$html$Html$li = _elm_lang$html$Html$node('li'); var _elm_lang$html$Html$dl = _elm_lang$html$Html$node('dl'); var _elm_lang$html$Html$dt = _elm_lang$html$Html$node('dt'); var _elm_lang$html$Html$dd = _elm_lang$html$Html$node('dd'); var _elm_lang$html$Html$figure = _elm_lang$html$Html$node('figure'); var _elm_lang$html$Html$figcaption = _elm_lang$html$Html$node('figcaption'); var _elm_lang$html$Html$div = _elm_lang$html$Html$node('div'); var _elm_lang$html$Html$a = _elm_lang$html$Html$node('a'); var _elm_lang$html$Html$em = _elm_lang$html$Html$node('em'); var _elm_lang$html$Html$strong = _elm_lang$html$Html$node('strong'); var _elm_lang$html$Html$small = _elm_lang$html$Html$node('small'); var _elm_lang$html$Html$s = _elm_lang$html$Html$node('s'); var _elm_lang$html$Html$cite = _elm_lang$html$Html$node('cite'); var _elm_lang$html$Html$q = _elm_lang$html$Html$node('q'); var _elm_lang$html$Html$dfn = _elm_lang$html$Html$node('dfn'); var _elm_lang$html$Html$abbr = _elm_lang$html$Html$node('abbr'); var _elm_lang$html$Html$time = _elm_lang$html$Html$node('time'); var _elm_lang$html$Html$code = _elm_lang$html$Html$node('code'); var _elm_lang$html$Html$var = _elm_lang$html$Html$node('var'); var _elm_lang$html$Html$samp = _elm_lang$html$Html$node('samp'); var _elm_lang$html$Html$kbd = _elm_lang$html$Html$node('kbd'); var _elm_lang$html$Html$sub = _elm_lang$html$Html$node('sub'); var _elm_lang$html$Html$sup = _elm_lang$html$Html$node('sup'); var _elm_lang$html$Html$i = _elm_lang$html$Html$node('i'); var _elm_lang$html$Html$b = _elm_lang$html$Html$node('b'); var _elm_lang$html$Html$u = _elm_lang$html$Html$node('u'); var _elm_lang$html$Html$mark = _elm_lang$html$Html$node('mark'); var _elm_lang$html$Html$ruby = _elm_lang$html$Html$node('ruby'); var _elm_lang$html$Html$rt = _elm_lang$html$Html$node('rt'); var _elm_lang$html$Html$rp = _elm_lang$html$Html$node('rp'); var _elm_lang$html$Html$bdi = _elm_lang$html$Html$node('bdi'); var _elm_lang$html$Html$bdo = _elm_lang$html$Html$node('bdo'); var _elm_lang$html$Html$span = _elm_lang$html$Html$node('span'); var _elm_lang$html$Html$br = _elm_lang$html$Html$node('br'); var _elm_lang$html$Html$wbr = _elm_lang$html$Html$node('wbr'); var _elm_lang$html$Html$ins = _elm_lang$html$Html$node('ins'); var _elm_lang$html$Html$del = _elm_lang$html$Html$node('del'); var _elm_lang$html$Html$img = _elm_lang$html$Html$node('img'); var _elm_lang$html$Html$iframe = _elm_lang$html$Html$node('iframe'); var _elm_lang$html$Html$embed = _elm_lang$html$Html$node('embed'); var _elm_lang$html$Html$object = _elm_lang$html$Html$node('object'); var _elm_lang$html$Html$param = _elm_lang$html$Html$node('param'); var _elm_lang$html$Html$video = _elm_lang$html$Html$node('video'); var _elm_lang$html$Html$audio = _elm_lang$html$Html$node('audio'); var _elm_lang$html$Html$source = _elm_lang$html$Html$node('source'); var _elm_lang$html$Html$track = _elm_lang$html$Html$node('track'); var _elm_lang$html$Html$canvas = _elm_lang$html$Html$node('canvas'); var _elm_lang$html$Html$math = _elm_lang$html$Html$node('math'); var _elm_lang$html$Html$table = _elm_lang$html$Html$node('table'); var _elm_lang$html$Html$caption = _elm_lang$html$Html$node('caption'); var _elm_lang$html$Html$colgroup = _elm_lang$html$Html$node('colgroup'); var _elm_lang$html$Html$col = _elm_lang$html$Html$node('col'); var _elm_lang$html$Html$tbody = _elm_lang$html$Html$node('tbody'); var _elm_lang$html$Html$thead = _elm_lang$html$Html$node('thead'); var _elm_lang$html$Html$tfoot = _elm_lang$html$Html$node('tfoot'); var _elm_lang$html$Html$tr = _elm_lang$html$Html$node('tr'); var _elm_lang$html$Html$td = _elm_lang$html$Html$node('td'); var _elm_lang$html$Html$th = _elm_lang$html$Html$node('th'); var _elm_lang$html$Html$form = _elm_lang$html$Html$node('form'); var _elm_lang$html$Html$fieldset = _elm_lang$html$Html$node('fieldset'); var _elm_lang$html$Html$legend = _elm_lang$html$Html$node('legend'); var _elm_lang$html$Html$label = _elm_lang$html$Html$node('label'); var _elm_lang$html$Html$input = _elm_lang$html$Html$node('input'); var _elm_lang$html$Html$button = _elm_lang$html$Html$node('button'); var _elm_lang$html$Html$select = _elm_lang$html$Html$node('select'); var _elm_lang$html$Html$datalist = _elm_lang$html$Html$node('datalist'); var _elm_lang$html$Html$optgroup = _elm_lang$html$Html$node('optgroup'); var _elm_lang$html$Html$option = _elm_lang$html$Html$node('option'); var _elm_lang$html$Html$textarea = _elm_lang$html$Html$node('textarea'); var _elm_lang$html$Html$keygen = _elm_lang$html$Html$node('keygen'); var _elm_lang$html$Html$output = _elm_lang$html$Html$node('output'); var _elm_lang$html$Html$progress = _elm_lang$html$Html$node('progress'); var _elm_lang$html$Html$meter = _elm_lang$html$Html$node('meter'); var _elm_lang$html$Html$details = _elm_lang$html$Html$node('details'); var _elm_lang$html$Html$summary = _elm_lang$html$Html$node('summary'); var _elm_lang$html$Html$menuitem = _elm_lang$html$Html$node('menuitem'); var _elm_lang$html$Html$menu = _elm_lang$html$Html$node('menu'); var _elm_lang$html$Html_Attributes$map = _elm_lang$virtual_dom$VirtualDom$mapProperty; var _elm_lang$html$Html_Attributes$attribute = _elm_lang$virtual_dom$VirtualDom$attribute; var _elm_lang$html$Html_Attributes$contextmenu = function _elm_lang$html$Html_Attributes$contextmenu(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'contextmenu', value); }; var _elm_lang$html$Html_Attributes$draggable = function _elm_lang$html$Html_Attributes$draggable(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'draggable', value); }; var _elm_lang$html$Html_Attributes$itemprop = function _elm_lang$html$Html_Attributes$itemprop(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'itemprop', value); }; var _elm_lang$html$Html_Attributes$tabindex = function _elm_lang$html$Html_Attributes$tabindex(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'tabIndex', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$charset = function _elm_lang$html$Html_Attributes$charset(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'charset', value); }; var _elm_lang$html$Html_Attributes$height = function _elm_lang$html$Html_Attributes$height(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'height', _elm_lang$core$Basics$toString(value)); }; var _elm_lang$html$Html_Attributes$width = function _elm_lang$html$Html_Attributes$width(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'width', _elm_lang$core$Basics$toString(value)); }; var _elm_lang$html$Html_Attributes$formaction = function _elm_lang$html$Html_Attributes$formaction(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'formAction', value); }; var _elm_lang$html$Html_Attributes$list = function _elm_lang$html$Html_Attributes$list(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'list', value); }; var _elm_lang$html$Html_Attributes$minlength = function _elm_lang$html$Html_Attributes$minlength(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'minLength', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$maxlength = function _elm_lang$html$Html_Attributes$maxlength(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'maxlength', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$size = function _elm_lang$html$Html_Attributes$size(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'size', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$form = function _elm_lang$html$Html_Attributes$form(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'form', value); }; var _elm_lang$html$Html_Attributes$cols = function _elm_lang$html$Html_Attributes$cols(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'cols', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$rows = function _elm_lang$html$Html_Attributes$rows(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'rows', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$challenge = function _elm_lang$html$Html_Attributes$challenge(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'challenge', value); }; var _elm_lang$html$Html_Attributes$media = function _elm_lang$html$Html_Attributes$media(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'media', value); }; var _elm_lang$html$Html_Attributes$rel = function _elm_lang$html$Html_Attributes$rel(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'rel', value); }; var _elm_lang$html$Html_Attributes$datetime = function _elm_lang$html$Html_Attributes$datetime(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'datetime', value); }; var _elm_lang$html$Html_Attributes$pubdate = function _elm_lang$html$Html_Attributes$pubdate(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'pubdate', value); }; var _elm_lang$html$Html_Attributes$colspan = function _elm_lang$html$Html_Attributes$colspan(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'colspan', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$rowspan = function _elm_lang$html$Html_Attributes$rowspan(n) { return A2(_elm_lang$html$Html_Attributes$attribute, 'rowspan', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$manifest = function _elm_lang$html$Html_Attributes$manifest(value) { return A2(_elm_lang$html$Html_Attributes$attribute, 'manifest', value); }; var _elm_lang$html$Html_Attributes$property = _elm_lang$virtual_dom$VirtualDom$property; var _elm_lang$html$Html_Attributes$stringProperty = F2(function (name, string) { return A2(_elm_lang$html$Html_Attributes$property, name, _elm_lang$core$Json_Encode$string(string)); }); var _elm_lang$html$Html_Attributes$class = function _elm_lang$html$Html_Attributes$class(name) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'className', name); }; var _elm_lang$html$Html_Attributes$id = function _elm_lang$html$Html_Attributes$id(name) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'id', name); }; var _elm_lang$html$Html_Attributes$title = function _elm_lang$html$Html_Attributes$title(name) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'title', name); }; var _elm_lang$html$Html_Attributes$accesskey = function _elm_lang$html$Html_Attributes$accesskey($char) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'accessKey', _elm_lang$core$String$fromChar($char)); }; var _elm_lang$html$Html_Attributes$dir = function _elm_lang$html$Html_Attributes$dir(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'dir', value); }; var _elm_lang$html$Html_Attributes$dropzone = function _elm_lang$html$Html_Attributes$dropzone(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'dropzone', value); }; var _elm_lang$html$Html_Attributes$lang = function _elm_lang$html$Html_Attributes$lang(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'lang', value); }; var _elm_lang$html$Html_Attributes$content = function _elm_lang$html$Html_Attributes$content(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'content', value); }; var _elm_lang$html$Html_Attributes$httpEquiv = function _elm_lang$html$Html_Attributes$httpEquiv(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'httpEquiv', value); }; var _elm_lang$html$Html_Attributes$language = function _elm_lang$html$Html_Attributes$language(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'language', value); }; var _elm_lang$html$Html_Attributes$src = function _elm_lang$html$Html_Attributes$src(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'src', value); }; var _elm_lang$html$Html_Attributes$alt = function _elm_lang$html$Html_Attributes$alt(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'alt', value); }; var _elm_lang$html$Html_Attributes$preload = function _elm_lang$html$Html_Attributes$preload(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'preload', value); }; var _elm_lang$html$Html_Attributes$poster = function _elm_lang$html$Html_Attributes$poster(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'poster', value); }; var _elm_lang$html$Html_Attributes$kind = function _elm_lang$html$Html_Attributes$kind(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'kind', value); }; var _elm_lang$html$Html_Attributes$srclang = function _elm_lang$html$Html_Attributes$srclang(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'srclang', value); }; var _elm_lang$html$Html_Attributes$sandbox = function _elm_lang$html$Html_Attributes$sandbox(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'sandbox', value); }; var _elm_lang$html$Html_Attributes$srcdoc = function _elm_lang$html$Html_Attributes$srcdoc(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'srcdoc', value); }; var _elm_lang$html$Html_Attributes$type_ = function _elm_lang$html$Html_Attributes$type_(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'type', value); }; var _elm_lang$html$Html_Attributes$value = function _elm_lang$html$Html_Attributes$value(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'value', value); }; var _elm_lang$html$Html_Attributes$defaultValue = function _elm_lang$html$Html_Attributes$defaultValue(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'defaultValue', value); }; var _elm_lang$html$Html_Attributes$placeholder = function _elm_lang$html$Html_Attributes$placeholder(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'placeholder', value); }; var _elm_lang$html$Html_Attributes$accept = function _elm_lang$html$Html_Attributes$accept(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'accept', value); }; var _elm_lang$html$Html_Attributes$acceptCharset = function _elm_lang$html$Html_Attributes$acceptCharset(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'acceptCharset', value); }; var _elm_lang$html$Html_Attributes$action = function _elm_lang$html$Html_Attributes$action(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'action', value); }; var _elm_lang$html$Html_Attributes$autocomplete = function _elm_lang$html$Html_Attributes$autocomplete(bool) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'autocomplete', bool ? 'on' : 'off'); }; var _elm_lang$html$Html_Attributes$enctype = function _elm_lang$html$Html_Attributes$enctype(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'enctype', value); }; var _elm_lang$html$Html_Attributes$method = function _elm_lang$html$Html_Attributes$method(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'method', value); }; var _elm_lang$html$Html_Attributes$name = function _elm_lang$html$Html_Attributes$name(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'name', value); }; var _elm_lang$html$Html_Attributes$pattern = function _elm_lang$html$Html_Attributes$pattern(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'pattern', value); }; var _elm_lang$html$Html_Attributes$for = function _elm_lang$html$Html_Attributes$for(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'htmlFor', value); }; var _elm_lang$html$Html_Attributes$max = function _elm_lang$html$Html_Attributes$max(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'max', value); }; var _elm_lang$html$Html_Attributes$min = function _elm_lang$html$Html_Attributes$min(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'min', value); }; var _elm_lang$html$Html_Attributes$step = function _elm_lang$html$Html_Attributes$step(n) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'step', n); }; var _elm_lang$html$Html_Attributes$wrap = function _elm_lang$html$Html_Attributes$wrap(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'wrap', value); }; var _elm_lang$html$Html_Attributes$usemap = function _elm_lang$html$Html_Attributes$usemap(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'useMap', value); }; var _elm_lang$html$Html_Attributes$shape = function _elm_lang$html$Html_Attributes$shape(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'shape', value); }; var _elm_lang$html$Html_Attributes$coords = function _elm_lang$html$Html_Attributes$coords(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'coords', value); }; var _elm_lang$html$Html_Attributes$keytype = function _elm_lang$html$Html_Attributes$keytype(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'keytype', value); }; var _elm_lang$html$Html_Attributes$align = function _elm_lang$html$Html_Attributes$align(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'align', value); }; var _elm_lang$html$Html_Attributes$cite = function _elm_lang$html$Html_Attributes$cite(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'cite', value); }; var _elm_lang$html$Html_Attributes$href = function _elm_lang$html$Html_Attributes$href(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'href', value); }; var _elm_lang$html$Html_Attributes$target = function _elm_lang$html$Html_Attributes$target(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'target', value); }; var _elm_lang$html$Html_Attributes$downloadAs = function _elm_lang$html$Html_Attributes$downloadAs(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'download', value); }; var _elm_lang$html$Html_Attributes$hreflang = function _elm_lang$html$Html_Attributes$hreflang(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'hreflang', value); }; var _elm_lang$html$Html_Attributes$ping = function _elm_lang$html$Html_Attributes$ping(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'ping', value); }; var _elm_lang$html$Html_Attributes$start = function _elm_lang$html$Html_Attributes$start(n) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'start', _elm_lang$core$Basics$toString(n)); }; var _elm_lang$html$Html_Attributes$headers = function _elm_lang$html$Html_Attributes$headers(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'headers', value); }; var _elm_lang$html$Html_Attributes$scope = function _elm_lang$html$Html_Attributes$scope(value) { return A2(_elm_lang$html$Html_Attributes$stringProperty, 'scope', value); }; var _elm_lang$html$Html_Attributes$boolProperty = F2(function (name, bool) { return A2(_elm_lang$html$Html_Attributes$property, name, _elm_lang$core$Json_Encode$bool(bool)); }); var _elm_lang$html$Html_Attributes$hidden = function _elm_lang$html$Html_Attributes$hidden(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'hidden', bool); }; var _elm_lang$html$Html_Attributes$contenteditable = function _elm_lang$html$Html_Attributes$contenteditable(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'contentEditable', bool); }; var _elm_lang$html$Html_Attributes$spellcheck = function _elm_lang$html$Html_Attributes$spellcheck(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'spellcheck', bool); }; var _elm_lang$html$Html_Attributes$async = function _elm_lang$html$Html_Attributes$async(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'async', bool); }; var _elm_lang$html$Html_Attributes$defer = function _elm_lang$html$Html_Attributes$defer(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'defer', bool); }; var _elm_lang$html$Html_Attributes$scoped = function _elm_lang$html$Html_Attributes$scoped(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'scoped', bool); }; var _elm_lang$html$Html_Attributes$autoplay = function _elm_lang$html$Html_Attributes$autoplay(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'autoplay', bool); }; var _elm_lang$html$Html_Attributes$controls = function _elm_lang$html$Html_Attributes$controls(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'controls', bool); }; var _elm_lang$html$Html_Attributes$loop = function _elm_lang$html$Html_Attributes$loop(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'loop', bool); }; var _elm_lang$html$Html_Attributes$default = function _elm_lang$html$Html_Attributes$default(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'default', bool); }; var _elm_lang$html$Html_Attributes$seamless = function _elm_lang$html$Html_Attributes$seamless(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'seamless', bool); }; var _elm_lang$html$Html_Attributes$checked = function _elm_lang$html$Html_Attributes$checked(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'checked', bool); }; var _elm_lang$html$Html_Attributes$selected = function _elm_lang$html$Html_Attributes$selected(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'selected', bool); }; var _elm_lang$html$Html_Attributes$autofocus = function _elm_lang$html$Html_Attributes$autofocus(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'autofocus', bool); }; var _elm_lang$html$Html_Attributes$disabled = function _elm_lang$html$Html_Attributes$disabled(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'disabled', bool); }; var _elm_lang$html$Html_Attributes$multiple = function _elm_lang$html$Html_Attributes$multiple(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'multiple', bool); }; var _elm_lang$html$Html_Attributes$novalidate = function _elm_lang$html$Html_Attributes$novalidate(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'noValidate', bool); }; var _elm_lang$html$Html_Attributes$readonly = function _elm_lang$html$Html_Attributes$readonly(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'readOnly', bool); }; var _elm_lang$html$Html_Attributes$required = function _elm_lang$html$Html_Attributes$required(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'required', bool); }; var _elm_lang$html$Html_Attributes$ismap = function _elm_lang$html$Html_Attributes$ismap(value) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'isMap', value); }; var _elm_lang$html$Html_Attributes$download = function _elm_lang$html$Html_Attributes$download(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'download', bool); }; var _elm_lang$html$Html_Attributes$reversed = function _elm_lang$html$Html_Attributes$reversed(bool) { return A2(_elm_lang$html$Html_Attributes$boolProperty, 'reversed', bool); }; var _elm_lang$html$Html_Attributes$classList = function _elm_lang$html$Html_Attributes$classList(list) { return _elm_lang$html$Html_Attributes$class(A2(_elm_lang$core$String$join, ' ', A2(_elm_lang$core$List$map, _elm_lang$core$Tuple$first, A2(_elm_lang$core$List$filter, _elm_lang$core$Tuple$second, list)))); }; var _elm_lang$html$Html_Attributes$style = _elm_lang$virtual_dom$VirtualDom$style; var _elm_lang$html$Html_Events$keyCode = A2(_elm_lang$core$Json_Decode$field, 'keyCode', _elm_lang$core$Json_Decode$int); var _elm_lang$html$Html_Events$targetChecked = A2(_elm_lang$core$Json_Decode$at, { ctor: '::', _0: 'target', _1: { ctor: '::', _0: 'checked', _1: { ctor: '[]' } } }, _elm_lang$core$Json_Decode$bool); var _elm_lang$html$Html_Events$targetValue = A2(_elm_lang$core$Json_Decode$at, { ctor: '::', _0: 'target', _1: { ctor: '::', _0: 'value', _1: { ctor: '[]' } } }, _elm_lang$core$Json_Decode$string); var _elm_lang$html$Html_Events$defaultOptions = _elm_lang$virtual_dom$VirtualDom$defaultOptions; var _elm_lang$html$Html_Events$onWithOptions = _elm_lang$virtual_dom$VirtualDom$onWithOptions; var _elm_lang$html$Html_Events$on = _elm_lang$virtual_dom$VirtualDom$on; var _elm_lang$html$Html_Events$onFocus = function _elm_lang$html$Html_Events$onFocus(msg) { return A2(_elm_lang$html$Html_Events$on, 'focus', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onBlur = function _elm_lang$html$Html_Events$onBlur(msg) { return A2(_elm_lang$html$Html_Events$on, 'blur', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onSubmitOptions = _elm_lang$core$Native_Utils.update(_elm_lang$html$Html_Events$defaultOptions, { preventDefault: true }); var _elm_lang$html$Html_Events$onSubmit = function _elm_lang$html$Html_Events$onSubmit(msg) { return A3(_elm_lang$html$Html_Events$onWithOptions, 'submit', _elm_lang$html$Html_Events$onSubmitOptions, _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onCheck = function _elm_lang$html$Html_Events$onCheck(tagger) { return A2(_elm_lang$html$Html_Events$on, 'change', A2(_elm_lang$core$Json_Decode$map, tagger, _elm_lang$html$Html_Events$targetChecked)); }; var _elm_lang$html$Html_Events$onInput = function _elm_lang$html$Html_Events$onInput(tagger) { return A2(_elm_lang$html$Html_Events$on, 'input', A2(_elm_lang$core$Json_Decode$map, tagger, _elm_lang$html$Html_Events$targetValue)); }; var _elm_lang$html$Html_Events$onMouseOut = function _elm_lang$html$Html_Events$onMouseOut(msg) { return A2(_elm_lang$html$Html_Events$on, 'mouseout', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onMouseOver = function _elm_lang$html$Html_Events$onMouseOver(msg) { return A2(_elm_lang$html$Html_Events$on, 'mouseover', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onMouseLeave = function _elm_lang$html$Html_Events$onMouseLeave(msg) { return A2(_elm_lang$html$Html_Events$on, 'mouseleave', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onMouseEnter = function _elm_lang$html$Html_Events$onMouseEnter(msg) { return A2(_elm_lang$html$Html_Events$on, 'mouseenter', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onMouseUp = function _elm_lang$html$Html_Events$onMouseUp(msg) { return A2(_elm_lang$html$Html_Events$on, 'mouseup', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onMouseDown = function _elm_lang$html$Html_Events$onMouseDown(msg) { return A2(_elm_lang$html$Html_Events$on, 'mousedown', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onDoubleClick = function _elm_lang$html$Html_Events$onDoubleClick(msg) { return A2(_elm_lang$html$Html_Events$on, 'dblclick', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$onClick = function _elm_lang$html$Html_Events$onClick(msg) { return A2(_elm_lang$html$Html_Events$on, 'click', _elm_lang$core$Json_Decode$succeed(msg)); }; var _elm_lang$html$Html_Events$Options = F2(function (a, b) { return { stopPropagation: a, preventDefault: b }; }); var _elm_lang$http$Http_Progress$onSelfMsg = F3(function (router, _p0, state) { return _elm_lang$core$Task$succeed(state); }); var _elm_lang$http$Http_Progress$addSub = F2(function (_p1, subDict) { var _p2 = _p1; var _p3 = _p2._1; var request = _p3.request; var uid = A2(_elm_lang$core$Basics_ops['++'], _p2._0, A2(_elm_lang$core$Basics_ops['++'], request.method, request.url)); return A3(_elm_lang$core$Dict$insert, uid, _p3, subDict); }); var _elm_lang$http$Http_Progress$collectSubs = function _elm_lang$http$Http_Progress$collectSubs(subs) { return A3(_elm_lang$core$List$foldl, _elm_lang$http$Http_Progress$addSub, _elm_lang$core$Dict$empty, subs); }; var _elm_lang$http$Http_Progress$toTask = F2(function (router, _p4) { var _p5 = _p4; return A2(_elm_lang$core$Task$onError, function (_p6) { return A2(_elm_lang$core$Platform$sendToApp, router, _p5.toError(_p6)); }, A2(_elm_lang$core$Task$andThen, _elm_lang$core$Platform$sendToApp(router), A2(_elm_lang$http$Native_Http.toTask, _p5.request, _elm_lang$core$Maybe$Just(function (_p7) { return A2(_elm_lang$core$Platform$sendToApp, router, _p5.toProgress(_p7)); })))); }); var _elm_lang$http$Http_Progress$spawnRequests = F3(function (router, trackedRequests, state) { var _p8 = trackedRequests; if (_p8.ctor === '[]') { return _elm_lang$core$Task$succeed(state); } else { return A2(_elm_lang$core$Task$andThen, function (process) { return A3(_elm_lang$http$Http_Progress$spawnRequests, router, _p8._1, A3(_elm_lang$core$Dict$insert, _p8._0._0, process, state)); }, _elm_lang$core$Process$spawn(A2(_elm_lang$http$Http_Progress$toTask, router, _p8._0._1))); } }); var _elm_lang$http$Http_Progress$onEffects = F3(function (router, subs, state) { var rightStep = F3(function (id, trackedRequest, _p9) { var _p10 = _p9; return { ctor: '_Tuple3', _0: _p10._0, _1: _p10._1, _2: { ctor: '::', _0: { ctor: '_Tuple2', _0: id, _1: trackedRequest }, _1: _p10._2 } }; }); var bothStep = F4(function (id, process, _p12, _p11) { var _p13 = _p11; return { ctor: '_Tuple3', _0: _p13._0, _1: A3(_elm_lang$core$Dict$insert, id, process, _p13._1), _2: _p13._2 }; }); var leftStep = F3(function (id, process, _p14) { var _p15 = _p14; return { ctor: '_Tuple3', _0: { ctor: '::', _0: _elm_lang$core$Process$kill(process), _1: _p15._0 }, _1: _p15._1, _2: _p15._2 }; }); var subDict = _elm_lang$http$Http_Progress$collectSubs(subs); var _p16 = A6(_elm_lang$core$Dict$merge, leftStep, bothStep, rightStep, state, subDict, { ctor: '_Tuple3', _0: { ctor: '[]' }, _1: _elm_lang$core$Dict$empty, _2: { ctor: '[]' } }); var dead = _p16._0; var ongoing = _p16._1; var $new = _p16._2; return A2(_elm_lang$core$Task$andThen, function (_p17) { return A3(_elm_lang$http$Http_Progress$spawnRequests, router, $new, ongoing); }, _elm_lang$core$Task$sequence(dead)); }); var _elm_lang$http$Http_Progress$init = _elm_lang$core$Task$succeed(_elm_lang$core$Dict$empty); var _elm_lang$http$Http_Progress$map = F2(function (func, _p18) { var _p19 = _p18; return { request: A2(_elm_lang$http$Http_Internal$map, func, _p19.request), toProgress: function toProgress(_p20) { return func(_p19.toProgress(_p20)); }, toError: function toError(_p21) { return func(_p19.toError(_p21)); } }; }); var _elm_lang$http$Http_Progress$subscription = _elm_lang$core$Native_Platform.leaf('Http.Progress'); var _elm_lang$http$Http_Progress$TrackedRequest = F3(function (a, b, c) { return { request: a, toProgress: b, toError: c }; }); var _elm_lang$http$Http_Progress$Done = function _elm_lang$http$Http_Progress$Done(a) { return { ctor: 'Done', _0: a }; }; var _elm_lang$http$Http_Progress$Fail = function _elm_lang$http$Http_Progress$Fail(a) { return { ctor: 'Fail', _0: a }; }; var _elm_lang$http$Http_Progress$Some = function _elm_lang$http$Http_Progress$Some(a) { return { ctor: 'Some', _0: a }; }; var _elm_lang$http$Http_Progress$None = { ctor: 'None' }; var _elm_lang$http$Http_Progress$Track = F2(function (a, b) { return { ctor: 'Track', _0: a, _1: b }; }); var _elm_lang$http$Http_Progress$track = F3(function (id, toMessage, _p22) { var _p23 = _p22; return _elm_lang$http$Http_Progress$subscription(A2(_elm_lang$http$Http_Progress$Track, id, { request: A2(_elm_lang$http$Http_Internal$map, function (_p24) { return toMessage(_elm_lang$http$Http_Progress$Done(_p24)); }, _p23._0), toProgress: function toProgress(_p25) { return toMessage(_elm_lang$http$Http_Progress$Some(_p25)); }, toError: function toError(_p26) { return toMessage(_elm_lang$http$Http_Progress$Fail(_p26)); } })); }); var _elm_lang$http$Http_Progress$subMap = F2(function (func, _p27) { var _p28 = _p27; return A2(_elm_lang$http$Http_Progress$Track, _p28._0, A2(_elm_lang$http$Http_Progress$map, func, _p28._1)); }); _elm_lang$core$Native_Platform.effectManagers['Http.Progress'] = { pkg: 'elm-lang/http', init: _elm_lang$http$Http_Progress$init, onEffects: _elm_lang$http$Http_Progress$onEffects, onSelfMsg: _elm_lang$http$Http_Progress$onSelfMsg, tag: 'sub', subMap: _elm_lang$http$Http_Progress$subMap }; var _elm_lang$navigation$Native_Navigation = function () { // FAKE NAVIGATION function go(n) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { if (n !== 0) { history.go(n); } callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function pushState(url) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { history.pushState({}, '', url); callback(_elm_lang$core$Native_Scheduler.succeed(getLocation())); }); } function replaceState(url) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { history.replaceState({}, '', url); callback(_elm_lang$core$Native_Scheduler.succeed(getLocation())); }); } // REAL NAVIGATION function reloadPage(skipCache) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { document.location.reload(skipCache); callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } function setLocation(url) { return _elm_lang$core$Native_Scheduler.nativeBinding(function (callback) { try { window.location = url; } catch (err) { // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. // Other browsers reload the page, so let's be consistent about that. document.location.reload(false); } callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); }); } // GET LOCATION function getLocation() { var location = document.location; return { href: location.href, host: location.host, hostname: location.hostname, protocol: location.protocol, origin: location.origin, port_: location.port, pathname: location.pathname, search: location.search, hash: location.hash, username: location.username, password: location.password }; } // DETECT IE11 PROBLEMS function isInternetExplorer11() { return window.navigator.userAgent.indexOf('Trident') !== -1; } return { go: go, setLocation: setLocation, reloadPage: reloadPage, pushState: pushState, replaceState: replaceState, getLocation: getLocation, isInternetExplorer11: isInternetExplorer11 }; }(); var _elm_lang$navigation$Navigation$replaceState = _elm_lang$navigation$Native_Navigation.replaceState; var _elm_lang$navigation$Navigation$pushState = _elm_lang$navigation$Native_Navigation.pushState; var _elm_lang$navigation$Navigation$go = _elm_lang$navigation$Native_Navigation.go; var _elm_lang$navigation$Navigation$reloadPage = _elm_lang$navigation$Native_Navigation.reloadPage; var _elm_lang$navigation$Navigation$setLocation = _elm_lang$navigation$Native_Navigation.setLocation; var _elm_lang$navigation$Navigation_ops = _elm_lang$navigation$Navigation_ops || {}; _elm_lang$navigation$Navigation_ops['&>'] = F2(function (task1, task2) { return A2(_elm_lang$core$Task$andThen, function (_p0) { return task2; }, task1); }); var _elm_lang$navigation$Navigation$notify = F3(function (router, subs, location) { var send = function send(_p1) { var _p2 = _p1; return A2(_elm_lang$core$Platform$sendToApp, router, _p2._0(location)); }; return A2(_elm_lang$navigation$Navigation_ops['&>'], _elm_lang$core$Task$sequence(A2(_elm_lang$core$List$map, send, subs)), _elm_lang$core$Task$succeed({ ctor: '_Tuple0' })); }); var _elm_lang$navigation$Navigation$cmdHelp = F3(function (router, subs, cmd) { var _p3 = cmd; switch (_p3.ctor) { case 'Jump': return _elm_lang$navigation$Navigation$go(_p3._0); case 'New': return A2(_elm_lang$core$Task$andThen, A2(_elm_lang$navigation$Navigation$notify, router, subs), _elm_lang$navigation$Navigation$pushState(_p3._0)); case 'Modify': return A2(_elm_lang$core$Task$andThen, A2(_elm_lang$navigation$Navigation$notify, router, subs), _elm_lang$navigation$Navigation$replaceState(_p3._0)); case 'Visit': return _elm_lang$navigation$Navigation$setLocation(_p3._0); default: return _elm_lang$navigation$Navigation$reloadPage(_p3._0); } }); var _elm_lang$navigation$Navigation$killPopWatcher = function _elm_lang$navigation$Navigation$killPopWatcher(popWatcher) { var _p4 = popWatcher; if (_p4.ctor === 'Normal') { return _elm_lang$core$Process$kill(_p4._0); } else { return A2(_elm_lang$navigation$Navigation_ops['&>'], _elm_lang$core$Process$kill(_p4._0), _elm_lang$core$Process$kill(_p4._1)); } }; var _elm_lang$navigation$Navigation$onSelfMsg = F3(function (router, location, state) { return A2(_elm_lang$navigation$Navigation_ops['&>'], A3(_elm_lang$navigation$Navigation$notify, router, state.subs, location), _elm_lang$core$Task$succeed(state)); }); var _elm_lang$navigation$Navigation$subscription = _elm_lang$core$Native_Platform.leaf('Navigation'); var _elm_lang$navigation$Navigation$command = _elm_lang$core$Native_Platform.leaf('Navigation'); var _elm_lang$navigation$Navigation$Location = function _elm_lang$navigation$Navigation$Location(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return function (g) { return function (h) { return function (i) { return function (j) { return function (k) { return { href: a, host: b, hostname: c, protocol: d, origin: e, port_: f, pathname: g, search: h, hash: i, username: j, password: k }; }; }; }; }; }; }; }; }; }; }; }; var _elm_lang$navigation$Navigation$State = F2(function (a, b) { return { subs: a, popWatcher: b }; }); var _elm_lang$navigation$Navigation$init = _elm_lang$core$Task$succeed(A2(_elm_lang$navigation$Navigation$State, { ctor: '[]' }, _elm_lang$core$Maybe$Nothing)); var _elm_lang$navigation$Navigation$Reload = function _elm_lang$navigation$Navigation$Reload(a) { return { ctor: 'Reload', _0: a }; }; var _elm_lang$navigation$Navigation$reload = _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Reload(false)); var _elm_lang$navigation$Navigation$reloadAndSkipCache = _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Reload(true)); var _elm_lang$navigation$Navigation$Visit = function _elm_lang$navigation$Navigation$Visit(a) { return { ctor: 'Visit', _0: a }; }; var _elm_lang$navigation$Navigation$load = function _elm_lang$navigation$Navigation$load(url) { return _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Visit(url)); }; var _elm_lang$navigation$Navigation$Modify = function _elm_lang$navigation$Navigation$Modify(a) { return { ctor: 'Modify', _0: a }; }; var _elm_lang$navigation$Navigation$modifyUrl = function _elm_lang$navigation$Navigation$modifyUrl(url) { return _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Modify(url)); }; var _elm_lang$navigation$Navigation$New = function _elm_lang$navigation$Navigation$New(a) { return { ctor: 'New', _0: a }; }; var _elm_lang$navigation$Navigation$newUrl = function _elm_lang$navigation$Navigation$newUrl(url) { return _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$New(url)); }; var _elm_lang$navigation$Navigation$Jump = function _elm_lang$navigation$Navigation$Jump(a) { return { ctor: 'Jump', _0: a }; }; var _elm_lang$navigation$Navigation$back = function _elm_lang$navigation$Navigation$back(n) { return _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Jump(0 - n)); }; var _elm_lang$navigation$Navigation$forward = function _elm_lang$navigation$Navigation$forward(n) { return _elm_lang$navigation$Navigation$command(_elm_lang$navigation$Navigation$Jump(n)); }; var _elm_lang$navigation$Navigation$cmdMap = F2(function (_p5, myCmd) { var _p6 = myCmd; switch (_p6.ctor) { case 'Jump': return _elm_lang$navigation$Navigation$Jump(_p6._0); case 'New': return _elm_lang$navigation$Navigation$New(_p6._0); case 'Modify': return _elm_lang$navigation$Navigation$Modify(_p6._0); case 'Visit': return _elm_lang$navigation$Navigation$Visit(_p6._0); default: return _elm_lang$navigation$Navigation$Reload(_p6._0); } }); var _elm_lang$navigation$Navigation$Monitor = function _elm_lang$navigation$Navigation$Monitor(a) { return { ctor: 'Monitor', _0: a }; }; var _elm_lang$navigation$Navigation$program = F2(function (locationToMessage, stuff) { var init = stuff.init(_elm_lang$navigation$Native_Navigation.getLocation({ ctor: '_Tuple0' })); var subs = function subs(model) { return _elm_lang$core$Platform_Sub$batch({ ctor: '::', _0: _elm_lang$navigation$Navigation$subscription(_elm_lang$navigation$Navigation$Monitor(locationToMessage)), _1: { ctor: '::', _0: stuff.subscriptions(model), _1: { ctor: '[]' } } }); }; return _elm_lang$html$Html$program({ init: init, view: stuff.view, update: stuff.update, subscriptions: subs }); }); var _elm_lang$navigation$Navigation$programWithFlags = F2(function (locationToMessage, stuff) { var init = function init(flags) { return A2(stuff.init, flags, _elm_lang$navigation$Native_Navigation.getLocation({ ctor: '_Tuple0' })); }; var subs = function subs(model) { return _elm_lang$core$Platform_Sub$batch({ ctor: '::', _0: _elm_lang$navigation$Navigation$subscription(_elm_lang$navigation$Navigation$Monitor(locationToMessage)), _1: { ctor: '::', _0: stuff.subscriptions(model), _1: { ctor: '[]' } } }); }; return _elm_lang$html$Html$programWithFlags({ init: init, view: stuff.view, update: stuff.update, subscriptions: subs }); }); var _elm_lang$navigation$Navigation$subMap = F2(function (func, _p7) { var _p8 = _p7; return _elm_lang$navigation$Navigation$Monitor(function (_p9) { return func(_p8._0(_p9)); }); }); var _elm_lang$navigation$Navigation$InternetExplorer = F2(function (a, b) { return { ctor: 'InternetExplorer', _0: a, _1: b }; }); var _elm_lang$navigation$Navigation$Normal = function _elm_lang$navigation$Navigation$Normal(a) { return { ctor: 'Normal', _0: a }; }; var _elm_lang$navigation$Navigation$spawnPopWatcher = function _elm_lang$navigation$Navigation$spawnPopWatcher(router) { var reportLocation = function reportLocation(_p10) { return A2(_elm_lang$core$Platform$sendToSelf, router, _elm_lang$navigation$Native_Navigation.getLocation({ ctor: '_Tuple0' })); }; return _elm_lang$navigation$Native_Navigation.isInternetExplorer11({ ctor: '_Tuple0' }) ? A3(_elm_lang$core$Task$map2, _elm_lang$navigation$Navigation$InternetExplorer, _elm_lang$core$Process$spawn(A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'popstate', _elm_lang$core$Json_Decode$value, reportLocation)), _elm_lang$core$Process$spawn(A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'hashchange', _elm_lang$core$Json_Decode$value, reportLocation))) : A2(_elm_lang$core$Task$map, _elm_lang$navigation$Navigation$Normal, _elm_lang$core$Process$spawn(A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'popstate', _elm_lang$core$Json_Decode$value, reportLocation))); }; var _elm_lang$navigation$Navigation$onEffects = F4(function (router, cmds, subs, _p11) { var _p12 = _p11; var _p15 = _p12.popWatcher; var stepState = function () { var _p13 = { ctor: '_Tuple2', _0: subs, _1: _p15 }; _v6_2: do { if (_p13._0.ctor === '[]') { if (_p13._1.ctor === 'Just') { return A2(_elm_lang$navigation$Navigation_ops['&>'], _elm_lang$navigation$Navigation$killPopWatcher(_p13._1._0), _elm_lang$core$Task$succeed(A2(_elm_lang$navigation$Navigation$State, subs, _elm_lang$core$Maybe$Nothing))); } else { break _v6_2; } } else { if (_p13._1.ctor === 'Nothing') { return A2(_elm_lang$core$Task$map, function (_p14) { return A2(_elm_lang$navigation$Navigation$State, subs, _elm_lang$core$Maybe$Just(_p14)); }, _elm_lang$navigation$Navigation$spawnPopWatcher(router)); } else { break _v6_2; } } } while (false); return _elm_lang$core$Task$succeed(A2(_elm_lang$navigation$Navigation$State, subs, _p15)); }(); return A2(_elm_lang$navigation$Navigation_ops['&>'], _elm_lang$core$Task$sequence(A2(_elm_lang$core$List$map, A2(_elm_lang$navigation$Navigation$cmdHelp, router, subs), cmds)), stepState); }); _elm_lang$core$Native_Platform.effectManagers['Navigation'] = { pkg: 'elm-lang/navigation', init: _elm_lang$navigation$Navigation$init, onEffects: _elm_lang$navigation$Navigation$onEffects, onSelfMsg: _elm_lang$navigation$Navigation$onSelfMsg, tag: 'fx', cmdMap: _elm_lang$navigation$Navigation$cmdMap, subMap: _elm_lang$navigation$Navigation$subMap }; var _evancz$url_parser$UrlParser$toKeyValuePair = function _evancz$url_parser$UrlParser$toKeyValuePair(segment) { var _p0 = A2(_elm_lang$core$String$split, '=', segment); if (_p0.ctor === '::' && _p0._1.ctor === '::' && _p0._1._1.ctor === '[]') { return A3(_elm_lang$core$Maybe$map2, F2(function (v0, v1) { return { ctor: '_Tuple2', _0: v0, _1: v1 }; }), _elm_lang$http$Http$decodeUri(_p0._0), _elm_lang$http$Http$decodeUri(_p0._1._0)); } else { return _elm_lang$core$Maybe$Nothing; } }; var _evancz$url_parser$UrlParser$parseParams = function _evancz$url_parser$UrlParser$parseParams(queryString) { return _elm_lang$core$Dict$fromList(A2(_elm_lang$core$List$filterMap, _evancz$url_parser$UrlParser$toKeyValuePair, A2(_elm_lang$core$String$split, '&', A2(_elm_lang$core$String$dropLeft, 1, queryString)))); }; var _evancz$url_parser$UrlParser$splitUrl = function _evancz$url_parser$UrlParser$splitUrl(url) { var _p1 = A2(_elm_lang$core$String$split, '/', url); if (_p1.ctor === '::' && _p1._0 === '') { return _p1._1; } else { return _p1; } }; var _evancz$url_parser$UrlParser$parseHelp = function _evancz$url_parser$UrlParser$parseHelp(states) { parseHelp: while (true) { var _p2 = states; if (_p2.ctor === '[]') { return _elm_lang$core$Maybe$Nothing; } else { var _p4 = _p2._0; var _p3 = _p4.unvisited; if (_p3.ctor === '[]') { return _elm_lang$core$Maybe$Just(_p4.value); } else { if (_p3._0 === '' && _p3._1.ctor === '[]') { return _elm_lang$core$Maybe$Just(_p4.value); } else { var _v4 = _p2._1; states = _v4; continue parseHelp; } } } } }; var _evancz$url_parser$UrlParser$parse = F3(function (_p5, url, params) { var _p6 = _p5; return _evancz$url_parser$UrlParser$parseHelp(_p6._0({ visited: { ctor: '[]' }, unvisited: _evancz$url_parser$UrlParser$splitUrl(url), params: params, value: _elm_lang$core$Basics$identity })); }); var _evancz$url_parser$UrlParser$parseHash = F2(function (parser, location) { return A3(_evancz$url_parser$UrlParser$parse, parser, A2(_elm_lang$core$String$dropLeft, 1, location.hash), _evancz$url_parser$UrlParser$parseParams(location.search)); }); var _evancz$url_parser$UrlParser$parsePath = F2(function (parser, location) { return A3(_evancz$url_parser$UrlParser$parse, parser, location.pathname, _evancz$url_parser$UrlParser$parseParams(location.search)); }); var _evancz$url_parser$UrlParser$intParamHelp = function _evancz$url_parser$UrlParser$intParamHelp(maybeValue) { var _p7 = maybeValue; if (_p7.ctor === 'Nothing') { return _elm_lang$core$Maybe$Nothing; } else { return _elm_lang$core$Result$toMaybe(_elm_lang$core$String$toInt(_p7._0)); } }; var _evancz$url_parser$UrlParser$mapHelp = F2(function (func, _p8) { var _p9 = _p8; return { visited: _p9.visited, unvisited: _p9.unvisited, params: _p9.params, value: func(_p9.value) }; }); var _evancz$url_parser$UrlParser$State = F4(function (a, b, c, d) { return { visited: a, unvisited: b, params: c, value: d }; }); var _evancz$url_parser$UrlParser$Parser = function _evancz$url_parser$UrlParser$Parser(a) { return { ctor: 'Parser', _0: a }; }; var _evancz$url_parser$UrlParser$s = function _evancz$url_parser$UrlParser$s(str) { return _evancz$url_parser$UrlParser$Parser(function (_p10) { var _p11 = _p10; var _p12 = _p11.unvisited; if (_p12.ctor === '[]') { return { ctor: '[]' }; } else { var _p13 = _p12._0; return _elm_lang$core$Native_Utils.eq(_p13, str) ? { ctor: '::', _0: A4(_evancz$url_parser$UrlParser$State, { ctor: '::', _0: _p13, _1: _p11.visited }, _p12._1, _p11.params, _p11.value), _1: { ctor: '[]' } } : { ctor: '[]' }; } }); }; var _evancz$url_parser$UrlParser$custom = F2(function (tipe, stringToSomething) { return _evancz$url_parser$UrlParser$Parser(function (_p14) { var _p15 = _p14; var _p16 = _p15.unvisited; if (_p16.ctor === '[]') { return { ctor: '[]' }; } else { var _p18 = _p16._0; var _p17 = stringToSomething(_p18); if (_p17.ctor === 'Ok') { return { ctor: '::', _0: A4(_evancz$url_parser$UrlParser$State, { ctor: '::', _0: _p18, _1: _p15.visited }, _p16._1, _p15.params, _p15.value(_p17._0)), _1: { ctor: '[]' } }; } else { return { ctor: '[]' }; } } }); }); var _evancz$url_parser$UrlParser$string = A2(_evancz$url_parser$UrlParser$custom, 'STRING', _elm_lang$core$Result$Ok); var _evancz$url_parser$UrlParser$int = A2(_evancz$url_parser$UrlParser$custom, 'NUMBER', _elm_lang$core$String$toInt); var _evancz$url_parser$UrlParser_ops = _evancz$url_parser$UrlParser_ops || {}; _evancz$url_parser$UrlParser_ops['</>'] = F2(function (_p20, _p19) { var _p21 = _p20; var _p22 = _p19; return _evancz$url_parser$UrlParser$Parser(function (state) { return A2(_elm_lang$core$List$concatMap, _p22._0, _p21._0(state)); }); }); var _evancz$url_parser$UrlParser$map = F2(function (subValue, _p23) { var _p24 = _p23; return _evancz$url_parser$UrlParser$Parser(function (_p25) { var _p26 = _p25; return A2(_elm_lang$core$List$map, _evancz$url_parser$UrlParser$mapHelp(_p26.value), _p24._0({ visited: _p26.visited, unvisited: _p26.unvisited, params: _p26.params, value: subValue })); }); }); var _evancz$url_parser$UrlParser$oneOf = function _evancz$url_parser$UrlParser$oneOf(parsers) { return _evancz$url_parser$UrlParser$Parser(function (state) { return A2(_elm_lang$core$List$concatMap, function (_p27) { var _p28 = _p27; return _p28._0(state); }, parsers); }); }; var _evancz$url_parser$UrlParser$top = _evancz$url_parser$UrlParser$Parser(function (state) { return { ctor: '::', _0: state, _1: { ctor: '[]' } }; }); var _evancz$url_parser$UrlParser_ops = _evancz$url_parser$UrlParser_ops || {}; _evancz$url_parser$UrlParser_ops['<?>'] = F2(function (_p30, _p29) { var _p31 = _p30; var _p32 = _p29; return _evancz$url_parser$UrlParser$Parser(function (state) { return A2(_elm_lang$core$List$concatMap, _p32._0, _p31._0(state)); }); }); var _evancz$url_parser$UrlParser$QueryParser = function _evancz$url_parser$UrlParser$QueryParser(a) { return { ctor: 'QueryParser', _0: a }; }; var _evancz$url_parser$UrlParser$customParam = F2(function (key, func) { return _evancz$url_parser$UrlParser$QueryParser(function (_p33) { var _p34 = _p33; var _p35 = _p34.params; return { ctor: '::', _0: A4(_evancz$url_parser$UrlParser$State, _p34.visited, _p34.unvisited, _p35, _p34.value(func(A2(_elm_lang$core$Dict$get, key, _p35)))), _1: { ctor: '[]' } }; }); }); var _evancz$url_parser$UrlParser$stringParam = function _evancz$url_parser$UrlParser$stringParam(name) { return A2(_evancz$url_parser$UrlParser$customParam, name, _elm_lang$core$Basics$identity); }; var _evancz$url_parser$UrlParser$intParam = function _evancz$url_parser$UrlParser$intParam(name) { return A2(_evancz$url_parser$UrlParser$customParam, name, _evancz$url_parser$UrlParser$intParamHelp); }; var _thaterikperson$elm_blackjack$Blackjack$serializeType = function _thaterikperson$elm_blackjack$Blackjack$serializeType(type_) { var _p0 = type_; switch (_p0.ctor) { case 'Two': return 0; case 'Three': return 1; case 'Four': return 2; case 'Five': return 3; case 'Six': return 4; case 'Seven': return 5; case 'Eight': return 6; case 'Nine': return 7; case 'Ten': return 8; case 'Jack': return 9; case 'Queen': return 10; case 'King': return 11; default: return 12; } }; var _thaterikperson$elm_blackjack$Blackjack$serializeSuit = function _thaterikperson$elm_blackjack$Blackjack$serializeSuit(suit) { var _p1 = suit; switch (_p1.ctor) { case 'Clubs': return 0; case 'Diamonds': return 1; case 'Hearts': return 2; default: return 3; } }; var _thaterikperson$elm_blackjack$Blackjack$cardValue = function _thaterikperson$elm_blackjack$Blackjack$cardValue(_p2) { var _p3 = _p2; var _p4 = _p3._0.type_; switch (_p4.ctor) { case 'King': return 10; case 'Queen': return 10; case 'Jack': return 10; case 'Ten': return 10; case 'Nine': return 9; case 'Eight': return 8; case 'Seven': return 7; case 'Six': return 6; case 'Five': return 5; case 'Four': return 4; case 'Three': return 3; case 'Two': return 2; default: return 0; } }; var _thaterikperson$elm_blackjack$Blackjack$isVirtualTen = function _thaterikperson$elm_blackjack$Blackjack$isVirtualTen(_p5) { var _p6 = _p5; var _p7 = _p6._0.type_; switch (_p7.ctor) { case 'King': return true; case 'Queen': return true; case 'Ten': return true; case 'Jack': return true; default: return false; } }; var _thaterikperson$elm_blackjack$Blackjack$isBlackjack = function _thaterikperson$elm_blackjack$Blackjack$isBlackjack(_p8) { var _p9 = _p8; var _p10 = _p9._0; if (_p10.ctor === '::' && _p10._1.ctor === '::' && _p10._1._1.ctor === '[]') { var _p11 = { ctor: '_Tuple2', _0: _p10._0._0.type_, _1: _p10._1._0._0.type_ }; _v8_2: do { if (_p11.ctor === '_Tuple2') { if (_p11._0.ctor === 'Ace') { return _thaterikperson$elm_blackjack$Blackjack$isVirtualTen(_p10._1._0); } else { if (_p11._1.ctor === 'Ace') { return _thaterikperson$elm_blackjack$Blackjack$isVirtualTen(_p10._0); } else { break _v8_2; } } } else { break _v8_2; } } while (false); return false; } else { return false; } }; var _thaterikperson$elm_blackjack$Blackjack$isSplittable = function _thaterikperson$elm_blackjack$Blackjack$isSplittable(_p12) { var _p13 = _p12; var _p14 = _p13._0; if (_p14.ctor === '::' && _p14._1.ctor === '::' && _p14._1._1.ctor === '[]') { return _elm_lang$core$Native_Utils.eq(_p14._0._0.type_, _p14._1._0._0.type_) || _thaterikperson$elm_blackjack$Blackjack$isVirtualTen(_p14._0) && _thaterikperson$elm_blackjack$Blackjack$isVirtualTen(_p14._1._0); } else { return false; } }; var _thaterikperson$elm_blackjack$Blackjack$typeOfCard = function _thaterikperson$elm_blackjack$Blackjack$typeOfCard(_p15) { var _p16 = _p15; return _p16._0.type_; }; var _thaterikperson$elm_blackjack$Blackjack$suitOfCard = function _thaterikperson$elm_blackjack$Blackjack$suitOfCard(_p17) { var _p18 = _p17; return _p18._0.suit; }; var _thaterikperson$elm_blackjack$Blackjack$BjHand = function _thaterikperson$elm_blackjack$Blackjack$BjHand(a) { return { ctor: 'BjHand', _0: a }; }; var _thaterikperson$elm_blackjack$Blackjack$newHand = _thaterikperson$elm_blackjack$Blackjack$BjHand({ ctor: '[]' }); var _thaterikperson$elm_blackjack$Blackjack$addCardToHand = F2(function (card, _p19) { var _p20 = _p19; return _thaterikperson$elm_blackjack$Blackjack$BjHand({ ctor: '::', _0: card, _1: _p20._0 }); }); var _thaterikperson$elm_blackjack$Blackjack$addCardsToHand = F2(function (cards, _p21) { var _p22 = _p21; return _thaterikperson$elm_blackjack$Blackjack$BjHand(A2(_elm_lang$core$Basics_ops['++'], cards, _p22._0)); }); var _thaterikperson$elm_blackjack$Blackjack$BjCard = function _thaterikperson$elm_blackjack$Blackjack$BjCard(a) { return { ctor: 'BjCard', _0: a }; }; var _thaterikperson$elm_blackjack$Blackjack$newCard = F2(function (type_, suit) { return _thaterikperson$elm_blackjack$Blackjack$BjCard({ type_: type_, suit: suit }); }); var _thaterikperson$elm_blackjack$Blackjack$Two = { ctor: 'Two' }; var _thaterikperson$elm_blackjack$Blackjack$Three = { ctor: 'Three' }; var _thaterikperson$elm_blackjack$Blackjack$Four = { ctor: 'Four' }; var _thaterikperson$elm_blackjack$Blackjack$Five = { ctor: 'Five' }; var _thaterikperson$elm_blackjack$Blackjack$Six = { ctor: 'Six' }; var _thaterikperson$elm_blackjack$Blackjack$Seven = { ctor: 'Seven' }; var _thaterikperson$elm_blackjack$Blackjack$Eight = { ctor: 'Eight' }; var _thaterikperson$elm_blackjack$Blackjack$Nine = { ctor: 'Nine' }; var _thaterikperson$elm_blackjack$Blackjack$Ten = { ctor: 'Ten' }; var _thaterikperson$elm_blackjack$Blackjack$Jack = { ctor: 'Jack' }; var _thaterikperson$elm_blackjack$Blackjack$Queen = { ctor: 'Queen' }; var _thaterikperson$elm_blackjack$Blackjack$King = { ctor: 'King' }; var _thaterikperson$elm_blackjack$Blackjack$Ace = { ctor: 'Ace' }; var _thaterikperson$elm_blackjack$Blackjack$hasAce = function _thaterikperson$elm_blackjack$Blackjack$hasAce(_p23) { var _p24 = _p23; return A2(_elm_lang$core$List$any, function (_p25) { var _p26 = _p25; return _elm_lang$core$Native_Utils.eq(_p26._0.type_, _thaterikperson$elm_blackjack$Blackjack$Ace); }, _p24._0); }; var _thaterikperson$elm_blackjack$Blackjack$potentialScores = function _thaterikperson$elm_blackjack$Blackjack$potentialScores(_p27) { var _p28 = _p27; var func = F2(function (_p29, scores) { var _p30 = _p29; var plus11 = A2(_elm_lang$core$List$map, function (s) { return s + 11; }, scores); var plus1 = A2(_elm_lang$core$List$map, function (s) { return s + 1; }, scores); return A2(_elm_lang$core$Basics_ops['++'], plus11, plus1); }); var _p31 = A2(_elm_lang$core$List$partition, function (_p32) { var _p33 = _p32; return _elm_lang$core$Native_Utils.eq(_p33._0.type_, _thaterikperson$elm_blackjack$Blackjack$Ace); }, _p28._0); var aces = _p31._0; var noAces = _p31._1; var preAcesSum = _elm_lang$core$List$sum(A2(_elm_lang$core$List$map, _thaterikperson$elm_blackjack$Blackjack$cardValue, noAces)); var afterAces = A3(_elm_lang$core$List$foldl, func, { ctor: '::', _0: preAcesSum, _1: { ctor: '[]' } }, aces); return A2(_elm_lang$core$List$sortWith, F2(function (a, b) { return A2(_elm_lang$core$Basics$compare, b, a); }), afterAces); }; var _thaterikperson$elm_blackjack$Blackjack$bestScore = function _thaterikperson$elm_blackjack$Blackjack$bestScore(hand) { var goodScores = A2(_elm_lang$core$List$filter, function (c) { return _elm_lang$core$Native_Utils.cmp(c, 21) < 1; }, _thaterikperson$elm_blackjack$Blackjack$potentialScores(hand)); return A2(_elm_lang$core$Maybe$withDefault, 0, _elm_lang$core$List$head(goodScores)); }; var _thaterikperson$elm_blackjack$Blackjack$isBust = function _thaterikperson$elm_blackjack$Blackjack$isBust(hand) { return _elm_lang$core$Native_Utils.eq(_thaterikperson$elm_blackjack$Blackjack$bestScore(hand), 0); }; var _thaterikperson$elm_blackjack$Blackjack$isTwentyOne = function _thaterikperson$elm_blackjack$Blackjack$isTwentyOne(hand) { return _elm_lang$core$Native_Utils.eq(_thaterikperson$elm_blackjack$Blackjack$bestScore(hand), 21); }; var _thaterikperson$elm_blackjack$Blackjack$isHandBetterThan = F2(function (hand1, hand2) { return _elm_lang$core$Native_Utils.cmp(_thaterikperson$elm_blackjack$Blackjack$bestScore(hand1), _thaterikperson$elm_blackjack$Blackjack$bestScore(hand2)) > 0; }); var _thaterikperson$elm_blackjack$Blackjack$isHandTiedWith = F2(function (hand1, hand2) { return _elm_lang$core$Native_Utils.eq(_thaterikperson$elm_blackjack$Blackjack$bestScore(hand1), _thaterikperson$elm_blackjack$Blackjack$bestScore(hand2)); }); var _thaterikperson$elm_blackjack$Blackjack$deserializeType = function _thaterikperson$elm_blackjack$Blackjack$deserializeType(type_) { var _p34 = type_; switch (_p34) { case 0: return _thaterikperson$elm_blackjack$Blackjack$Two; case 1: return _thaterikperson$elm_blackjack$Blackjack$Three; case 2: return _thaterikperson$elm_blackjack$Blackjack$Four; case 3: return _thaterikperson$elm_blackjack$Blackjack$Five; case 4: return _thaterikperson$elm_blackjack$Blackjack$Six; case 5: return _thaterikperson$elm_blackjack$Blackjack$Seven; case 6: return _thaterikperson$elm_blackjack$Blackjack$Eight; case 7: return _thaterikperson$elm_blackjack$Blackjack$Nine; case 8: return _thaterikperson$elm_blackjack$Blackjack$Ten; case 9: return _thaterikperson$elm_blackjack$Blackjack$Jack; case 10: return _thaterikperson$elm_blackjack$Blackjack$Queen; case 11: return _thaterikperson$elm_blackjack$Blackjack$King; default: return _thaterikperson$elm_blackjack$Blackjack$Ace; } }; var _thaterikperson$elm_blackjack$Blackjack$Spades = { ctor: 'Spades' }; var _thaterikperson$elm_blackjack$Blackjack$Hearts = { ctor: 'Hearts' }; var _thaterikperson$elm_blackjack$Blackjack$Diamonds = { ctor: 'Diamonds' }; var _thaterikperson$elm_blackjack$Blackjack$Clubs = { ctor: 'Clubs' }; var _thaterikperson$elm_blackjack$Blackjack$deserializeSuit = function _thaterikperson$elm_blackjack$Blackjack$deserializeSuit(suit) { var _p35 = suit; switch (_p35) { case 0: return _thaterikperson$elm_blackjack$Blackjack$Clubs; case 1: return _thaterikperson$elm_blackjack$Blackjack$Diamonds; case 2: return _thaterikperson$elm_blackjack$Blackjack$Hearts; default: return _thaterikperson$elm_blackjack$Blackjack$Spades; } }; var _thaterikperson$elm_blackjack$Blackjack$deserializeCard = F2(function (type_, suit) { return _thaterikperson$elm_blackjack$Blackjack$BjCard({ type_: _thaterikperson$elm_blackjack$Blackjack$deserializeType(type_), suit: _thaterikperson$elm_blackjack$Blackjack$deserializeSuit(suit) }); }); var _user$project$Routes$pageToPath = function _user$project$Routes$pageToPath(page) { var _p0 = page; switch (_p0.ctor) { case 'Home': return '/'; case 'About': return '/about'; default: return A2(_elm_lang$core$Basics_ops['++'], '/theme/', _p0._0); } }; var _user$project$Routes$Theme = function _user$project$Routes$Theme(a) { return { ctor: 'Theme', _0: a }; }; var _user$project$Routes$About = { ctor: 'About' }; var _user$project$Routes$Home = { ctor: 'Home' }; var _user$project$Routes$pageParser = _evancz$url_parser$UrlParser$oneOf({ ctor: '::', _0: A2(_evancz$url_parser$UrlParser$map, _user$project$Routes$Home, _evancz$url_parser$UrlParser$s('')), _1: { ctor: '::', _0: A2(_evancz$url_parser$UrlParser$map, _user$project$Routes$About, _evancz$url_parser$UrlParser$s('about')), _1: { ctor: '::', _0: A2(_evancz$url_parser$UrlParser$map, _user$project$Routes$Theme, A2(_evancz$url_parser$UrlParser_ops['</>'], _evancz$url_parser$UrlParser$s('theme'), _evancz$url_parser$UrlParser$string)), _1: { ctor: '[]' } } } }); var _user$project$Routes$pathParser = function _user$project$Routes$pathParser(location) { return A2(_evancz$url_parser$UrlParser$parsePath, _user$project$Routes$pageParser, location); }; var _user$project$Model$shuffle = F3(function (unshuffled, i, seed) { shuffle: while (true) { var mAtI = A2(_elm_lang$core$Array$get, i, unshuffled); var g = A2(_elm_lang$core$Random$int, 0, _elm_lang$core$Array$length(unshuffled) - i - 1); var _p0 = A2(_elm_lang$core$Random$step, g, seed); var j = _p0._0; var nextSeed = _p0._1; var mAtIJ = A2(_elm_lang$core$Array$get, i + j, unshuffled); var shuffled = function () { var _p1 = { ctor: '_Tuple2', _0: mAtI, _1: mAtIJ }; if (_p1.ctor === '_Tuple2' && _p1._0.ctor === 'Just' && _p1._1.ctor === 'Just') { return A3(_elm_lang$core$Array$set, i + j, _p1._0._0, A3(_elm_lang$core$Array$set, i, _p1._1._0, unshuffled)); } else { return unshuffled; } }(); if (_elm_lang$core$Native_Utils.cmp(i, _elm_lang$core$Array$length(shuffled) - 2) > 0) { return shuffled; } else { var _v1 = shuffled, _v2 = i + 1, _v3 = nextSeed; unshuffled = _v1; i = _v2; seed = _v3; continue shuffle; } } }); var _user$project$Model$shuffledDeck = function _user$project$Model$shuffledDeck(time) { var seed = _elm_lang$core$Random$initialSeed(time); var types = { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Ace, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$King, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Queen, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Jack, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Ten, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Nine, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Eight, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Seven, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Six, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Five, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Four, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Three, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Two, _1: { ctor: '[]' } } } } } } } } } } } } } }; var suits = { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Clubs, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Diamonds, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Hearts, _1: { ctor: '::', _0: _thaterikperson$elm_blackjack$Blackjack$Spades, _1: { ctor: '[]' } } } } }; var cardsWithSuits = A2(_elm_lang$core$List$concatMap, function (type_) { return A2(_elm_lang$core$List$map, _thaterikperson$elm_blackjack$Blackjack$newCard(type_), suits); }, types); var fullDeck = _elm_lang$core$Array$fromList(cardsWithSuits); return _elm_lang$core$Array$toList(A3(_user$project$Model$shuffle, fullDeck, 0, seed)); }; var _user$project$Model$initialModel = { hand: { ctor: '[]' }, remainingCards: _user$project$Model$shuffledDeck(0), numberOfHands: 0, numberOfWins: 0, page: _user$project$Routes$Home, isMenuOpen: false, dealerHand: { ctor: '[]' }, base64Text: '', currentRequest: _elm_lang$core$Maybe$Nothing, currentRequestNumber: 0 }; var _user$project$Model$Model = function _user$project$Model$Model(a) { return function (b) { return function (c) { return function (d) { return function (e) { return function (f) { return function (g) { return function (h) { return function (i) { return function (j) { return { hand: a, remainingCards: b, numberOfHands: c, numberOfWins: d, page: e, isMenuOpen: f, dealerHand: g, base64Text: h, currentRequest: i, currentRequestNumber: j }; }; }; }; }; }; }; }; }; }; }; var _user$project$Model$FetchedBytesProgress = function _user$project$Model$FetchedBytesProgress(a) { return { ctor: 'FetchedBytesProgress', _0: a }; }; var _user$project$Model$ToggleMenu = { ctor: 'ToggleMenu' }; var _user$project$Model$NavigateTo = function _user$project$Model$NavigateTo(a) { return { ctor: 'NavigateTo', _0: a }; }; var _user$project$Model$UrlChange = function _user$project$Model$UrlChange(a) { return { ctor: 'UrlChange', _0: a }; }; var _user$project$Model$DealHand = { ctor: 'DealHand' }; var _user$project$ViewHelper$cardTypeText = function _user$project$ViewHelper$cardTypeText(card) { var _p0 = _thaterikperson$elm_blackjack$Blackjack$typeOfCard(card); switch (_p0.ctor) { case 'Ace': return 'A'; case 'King': return 'K'; case 'Queen': return 'Q'; case 'Jack': return 'J'; case 'Ten': return '10'; case 'Nine': return '9'; case 'Eight': return '8'; case 'Seven': return '7'; case 'Six': return '6'; case 'Five': return '5'; case 'Four': return '4'; case 'Three': return '3'; default: return '2'; } }; var _user$project$ViewHelper$suitText = function _user$project$ViewHelper$suitText(card) { var _p1 = _thaterikperson$elm_blackjack$Blackjack$suitOfCard(card); switch (_p1.ctor) { case 'Clubs': return 'C'; case 'Diamonds': return 'D'; case 'Hearts': return 'H'; default: return 'S'; } }; var _user$project$ViewHelper$isRedSuit = function _user$project$ViewHelper$isRedSuit(card) { var _p2 = _thaterikperson$elm_blackjack$Blackjack$suitOfCard(card); switch (_p2.ctor) { case 'Clubs': return false; case 'Spades': return false; default: return true; } }; var _user$project$View$customThemeView = F2(function (theme, model) { var deckView = A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('deck'), _1: { ctor: '[]' } }, { ctor: '[]' }); var cardRowChildren = { ctor: '::', _0: deckView, _1: { ctor: '[]' } }; return A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class(A2(_elm_lang$core$Basics_ops['++'], 'main container ', theme)), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('row'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('one-third column'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$button, { ctor: '::', _0: _elm_lang$html$Html_Events$onClick(_user$project$Model$DealHand), _1: { ctor: '[]' } }, { ctor: '::', _0: _elm_lang$html$Html$text('Deal'), _1: { ctor: '[]' } }), _1: { ctor: '[]' } }), _1: { ctor: '[]' } }), _1: { ctor: '::', _0: A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('row'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$p, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('all-text'), _1: { ctor: '[]' } }, { ctor: '::', _0: _elm_lang$html$Html$text(model.base64Text), _1: { ctor: '[]' } }), _1: { ctor: '[]' } }), _1: { ctor: '[]' } } }); }); var _user$project$View$homeView = function _user$project$View$homeView(model) { return A2(_user$project$View$customThemeView, 'black', model); }; var _user$project$View$onLinkClick = function _user$project$View$onLinkClick(msg) { return A3(_elm_lang$html$Html_Events$onWithOptions, 'click', { stopPropagation: true, preventDefault: true }, _elm_lang$core$Json_Decode$succeed(msg)); }; var _user$project$View$aboutView = function _user$project$View$aboutView(model) { return A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('main container'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('row'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$div, { ctor: '::', _0: _elm_lang$html$Html_Attributes$class('eight columns offset-by-two'), _1: { ctor: '[]' } }, { ctor: '::', _0: A2(_elm_lang$html$Html$h1, { ctor: '[]' }, { ctor: '::', _0: _elm_lang$html$Html$text('Blackjack by Elmseeds'), _1: { ctor: '[]' } }), _1: { ctor: '::', _0: A2(_elm_lang$html$Html$p, { ctor: '[]' }, { ctor: '::', _0: _elm_lang$html$Html$text('A work in progress Blackjack game.'), _1: { ctor: '[]' } }), _1: { ctor: '::', _0: A2(_elm_lang$html$Html$p, { ctor: '[]' }, { ctor: '::', _0: _elm_lang$html$Html$text('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus egestas augue porttitor est cursus, non interdum diam luctus. Duis ac auctor quam, eget auctor erat. In porttitor turpis et libero iaculis vestibulum. Cras interdum mi in arcu sagittis dapibus. Suspendisse potenti. Duis id lectus luctus lorem tristique interdum ornare eu lorem. Vivamus eleifend aliquet vulputate. Quisque pretium semper elementum. Vivamus at purus eleifend, viverra nibh nec, euismod felis. Nullam condimentum venenatis elit, id vestibulum leo accumsan at. Nulla sit amet turpis ipsum. Quisque placerat interdum erat a pulvinar. Sed tristique, nisl quis aliquam commodo, metus lectus blandit erat, non porttitor sapien eros eu enim. Sed hendrerit turpis nec risus congue, in lacinia ipsum pretium. Suspendisse a ultricies diam, sit amet ornare augue. Aenean mollis sapien sit amet ligula vestibulum rhoncus. In eget ipsum mollis, consectetur libero nec, venenatis odio. Etiam semper quam vel imperdiet varius.'), _1: { ctor: '[]' } }), _1: { ctor: '::', _0: A2(_elm_lang$html$Html$p, { ctor: '[]' }, { ctor: '::', _0: A2(_elm_lang$html$Html$a, { ctor: '::', _0: _elm_lang$html$Html_Attributes$href('/'), _1: { ctor: '::', _0: _user$project$View$onLinkClick(_user$project$Model$NavigateTo(_user$project$Routes$About)), _1: { ctor: '[]' } } }, { ctor: '::', _0: _elm_lang$html$Html$text('Home'), _1: { ctor: '[]' } }), _1: { ctor: '[]' } }), _1: { ctor: '[]' } } } } }), _1: { ctor: '[]' } }), _1: { ctor: '[]' } }); }; var _user$project$View$mainView = function _user$project$View$mainView(model) { var bodyView = function () { var _p0 = model.page; switch (_p0.ctor) { case 'Home': return _user$project$View$homeView(model); case 'About': return _user$project$View$aboutView(model); default: return A2(_user$project$View$customThemeView, _p0._0, model); } }(); return A2(_elm_lang$html$Html$div, { ctor: '[]' }, { ctor: '::', _0: bodyView, _1: { ctor: '[]' } }); }; var _user$project$Main$modelWithLocation = F2(function (location, model) { var page = A2(_elm_lang$core$Maybe$withDefault, _user$project$Routes$Home, _user$project$Routes$pathParser(location)); return _elm_lang$core$Native_Utils.update(model, { page: page }); }); var _user$project$Main$update = F2(function (msg, model) { var _p0 = msg; switch (_p0.ctor) { case 'DealHand': var currentRequestNumber = model.currentRequestNumber + 1; var req = _elm_lang$http$Http$getString('/large'); return A2(_elm_lang$core$Platform_Cmd_ops['!'], _elm_lang$core$Native_Utils.update(model, { base64Text: 'fetching…', currentRequest: _elm_lang$core$Maybe$Just(req), currentRequestNumber: currentRequestNumber }), { ctor: '[]' }); case 'FetchedBytesProgress': var text = function () { var _p1 = _p0._0; switch (_p1.ctor) { case 'None': return 'starting…'; case 'Some': return A3(_elm_lang$core$Basics$flip, F2(function (x, y) { return A2(_elm_lang$core$Basics_ops['++'], x, y); }), '%', _elm_lang$core$Basics$toString(100 * _elm_lang$core$Basics$toFloat(_p1._0.bytes) / _elm_lang$core$Basics$toFloat(_p1._0.bytesExpected))); case 'Done': return _p1._0; default: return 'Error'; } }(); return A2(_elm_lang$core$Platform_Cmd_ops['!'], _elm_lang$core$Native_Utils.update(model, { base64Text: text }), { ctor: '[]' }); case 'ToggleMenu': return A2(_elm_lang$core$Platform_Cmd_ops['!'], _elm_lang$core$Native_Utils.update(model, { isMenuOpen: !model.isMenuOpen }), { ctor: '[]' }); case 'UrlChange': return A2(_elm_lang$core$Platform_Cmd_ops['!'], A2(_user$project$Main$modelWithLocation, _p0._0, model), { ctor: '[]' }); default: var cmd = _elm_lang$navigation$Navigation$newUrl(_user$project$Routes$pageToPath(_p0._0)); return A2(_elm_lang$core$Platform_Cmd_ops['!'], model, { ctor: '::', _0: cmd, _1: { ctor: '[]' } }); } }); var _user$project$Main$initialState = function _user$project$Main$initialState(location) { return A2(_elm_lang$core$Platform_Cmd_ops['!'], A2(_user$project$Main$modelWithLocation, location, _user$project$Model$initialModel), { ctor: '[]' }); }; var _user$project$Main$main = A2(_elm_lang$navigation$Navigation$program, _user$project$Model$UrlChange, { init: _user$project$Main$initialState, update: _user$project$Main$update, view: _user$project$View$mainView, subscriptions: function subscriptions(model) { var _p2 = model.currentRequest; if (_p2.ctor === 'Nothing') { return _elm_lang$core$Platform_Sub$none; } else { return A3(_elm_lang$http$Http_Progress$track, _elm_lang$core$Basics$toString(model.currentRequestNumber), _user$project$Model$FetchedBytesProgress, _p2._0); } } })(); var Elm = {}; Elm['Main'] = Elm['Main'] || {}; if (typeof _user$project$Main$main !== 'undefined') { _user$project$Main$main(Elm['Main'], 'Main', undefined); } if (typeof define === "function" && define['amd']) { define([], function () { return Elm; }); return; } if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === "object") { module['exports'] = Elm; return; } var globalElm = this['Elm']; if (typeof globalElm === "undefined") { this['Elm'] = Elm; return; } for (var publicModule in Elm) { if (publicModule in globalElm) { throw new Error('There are two Elm modules called `' + publicModule + '` on this page! Rename one of them.'); } globalElm[publicModule] = Elm[publicModule]; } }).call(undefined); }); require.register("web/static/js/socket.js", function(exports, require, module) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _phoenix = require("phoenix"); var socket = new _phoenix.Socket("/socket", { params: { token: window.userToken } }); // When you connect, you'll often need to authenticate the client. // For example, imagine you have an authentication plug, `MyAuth`, // which authenticates the session and assigns a `:current_user`. // If the current user exists you can assign the user's token in // the connection for use in the layout. // // In your "web/router.ex": // // pipeline :browser do // ... // plug MyAuth // plug :put_user_token // end // // defp put_user_token(conn, _) do // if current_user = conn.assigns[:current_user] do // token = Phoenix.Token.sign(conn, "user socket", current_user.id) // assign(conn, :user_token, token) // else // conn // end // end // // Now you need to pass this token to JavaScript. You can do so // inside a script tag in "web/templates/layout/app.html.eex": // // <script>window.userToken = "<%= assigns[:user_token] %>";</script> // // You will need to verify the user token in the "connect/2" function // in "web/channels/user_socket.ex": // // def connect(%{"token" => token}, socket) do // # max_age: 1209600 is equivalent to two weeks in seconds // case Phoenix.Token.verify(socket, "user socket", token, max_age: 1209600) do // {:ok, user_id} -> // {:ok, assign(socket, :user, user_id)} // {:error, reason} -> // :error // end // end // // Finally, pass the token on connect as below. Or remove it // from connect if you don't care about authentication. // NOTE: The contents of this file will only be executed if // you uncomment its entry in "web/static/js/app.js". // To use Phoenix channels, the first step is to import Socket // and connect at the socket path in "lib/my_app/endpoint.ex": socket.connect(); // Now that you are connected, you can join channels with a topic: var channel = socket.channel("topic:subtopic", {}); channel.join().receive("ok", function (resp) { console.log("Joined successfully", resp); }).receive("error", function (resp) { console.log("Unable to join", resp); }); exports.default = socket; }); ;require.alias("process/browser.js", "process"); require.alias("phoenix/priv/static/phoenix.js", "phoenix"); require.alias("phoenix_html/priv/static/phoenix_html.js", "phoenix_html");process = require('process');require.register("___globals___", function(exports, require, module) { });})();require('___globals___'); require('web/static/js/app'); //# sourceMappingURL=app.js.map
src/smart/item/ItemRow.js
jeckhummer/ebidding-commercial
import React from 'react'; import {connect} from 'react-redux'; import {updateItem} from "../../actions"; import {TransitionStatus, Status, Mode} from "../../entities/ItemDescriptors"; import {getDuplicatedItems} from "../../selectors"; import {EditItemButton} from "../buttons/EditItemButton"; import {RemoveItemButton} from "../buttons/RemoveItemButton"; import {SaveItemButton} from "../buttons/SaveItemButton"; import {ProcessingItemRow} from "../../dumb/itemRows/ProcessingItemRow"; import {RestoreItemButton} from "../buttons/RestoreItemButton"; import {GenericItemRow} from '../../dumb/itemRows/GenericItemRow'; let ItemRow = (props) => { const allEditableOptions = { name: true, comment: true, cost: true, UOM: true, quantity: true, deliveryDays: true, }; const transitionViewMap = { [TransitionStatus.NONE]: null, [TransitionStatus.SAVING]: <ProcessingItemRow type={{positive: true}} text="Saving item ..."/> , [TransitionStatus.REMOVING]: <ProcessingItemRow type={{negative: true}} text="Removing item ..."/>, [TransitionStatus.RESTORING]: <ProcessingItemRow type={{positive: true}} text="Restoring item..."/>, }; const savedSubMap = { [Mode.EDIT]: <GenericItemRow {...props} actions={[SaveItemButton, RemoveItemButton]} isEditable={allEditableOptions}/>, [Mode.READ]: <GenericItemRow {...props} actions={[EditItemButton, RemoveItemButton]}/>, }; const staticViewMap = { [Status.PREDEFINED]: { [Mode.EDIT]: <GenericItemRow {...props} actions={[SaveItemButton]} isEditable={{cost: true, comment: true, deliveryDays: true}}/>, [Mode.READ]: <GenericItemRow {...props} actions={[EditItemButton]}/>, }, [Status.SAVED]: savedSubMap, [Status.DRAFT]: savedSubMap, [Status.REMOVED]: { [Mode.EDIT]: <GenericItemRow {...props} actions={[RestoreItemButton]}/>, [Mode.READ]: <GenericItemRow {...props} actions={[RestoreItemButton]}/>, }, }; return transitionViewMap[props.item.transitionStatus] !== null ? transitionViewMap[props.item.transitionStatus] : staticViewMap[props.item.status][props.item.mode]; }; const mapStateToProps = (state, ownProps) => { const {item} = ownProps; const duplicated = getDuplicatedItems(state) .some(x => x.id === item.id); return {duplicated}; }; const mapDispatchToProps = (dispatch) => { return { onUpdate: (item) => dispatch(updateItem(item)) }; }; ItemRow = connect(mapStateToProps, mapDispatchToProps)(ItemRow); export default ItemRow;
ajax/libs/react-router/0.11.0/react-router.min.js
shelsonjava/cdnjs
!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.ReactRouter=e()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&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}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module){var LocationActions={PUSH:"push",REPLACE:"replace",POP:"pop"};module.exports=LocationActions},{}],2:[function(_dereq_,module){var LocationActions=_dereq_("../actions/LocationActions"),ImitateBrowserBehavior={updateScrollPosition:function(position,actionType){switch(actionType){case LocationActions.PUSH:case LocationActions.REPLACE:window.scrollTo(0,0);break;case LocationActions.POP:position?window.scrollTo(position.x,position.y):window.scrollTo(0,0)}}};module.exports=ImitateBrowserBehavior},{"../actions/LocationActions":1}],3:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),DefaultRoute=React.createClass({displayName:"DefaultRoute",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:PropTypes.falsy,handler:React.PropTypes.func.isRequired}});module.exports=DefaultRoute},{"../mixins/FakeNode":13,"../utils/PropTypes":21}],4:[function(_dereq_,module){function isLeftClickEvent(event){return 0===event.button}function isModifiedEvent(event){return!!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,classSet=_dereq_("react/lib/cx"),assign=_dereq_("react/lib/Object.assign"),Navigation=_dereq_("../mixins/Navigation"),State=_dereq_("../mixins/State"),Link=React.createClass({displayName:"Link",mixins:[Navigation,State],propTypes:{activeClassName:React.PropTypes.string.isRequired,to:React.PropTypes.string.isRequired,params:React.PropTypes.object,query:React.PropTypes.object,onClick:React.PropTypes.func},getDefaultProps:function(){return{activeClassName:"active"}},handleClick:function(event){var clickResult,allowTransition=!0;this.props.onClick&&(clickResult=this.props.onClick(event)),!isModifiedEvent(event)&&isLeftClickEvent(event)&&((clickResult===!1||event.defaultPrevented===!0)&&(allowTransition=!1),event.preventDefault(),allowTransition&&this.transitionTo(this.props.to,this.props.params,this.props.query))},getHref:function(){return this.makeHref(this.props.to,this.props.params,this.props.query)},getClassName:function(){var classNames={};return this.props.className&&(classNames[this.props.className]=!0),this.isActive(this.props.to,this.props.params,this.props.query)&&(classNames[this.props.activeClassName]=!0),classSet(classNames)},render:function(){var props=assign({},this.props,{href:this.getHref(),className:this.getClassName(),onClick:this.handleClick});return React.DOM.a(props,this.props.children)}});module.exports=Link},{"../mixins/Navigation":14,"../mixins/State":17,"react/lib/Object.assign":36,"react/lib/cx":37}],5:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),NotFoundRoute=React.createClass({displayName:"NotFoundRoute",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:PropTypes.falsy,handler:React.PropTypes.func.isRequired}});module.exports=NotFoundRoute},{"../mixins/FakeNode":13,"../utils/PropTypes":21}],6:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),Redirect=React.createClass({displayName:"Redirect",mixins:[FakeNode],propTypes:{path:React.PropTypes.string,from:React.PropTypes.string,to:React.PropTypes.string,handler:PropTypes.falsy}});module.exports=Redirect},{"../mixins/FakeNode":13,"../utils/PropTypes":21}],7:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),Route=React.createClass({displayName:"Route",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:React.PropTypes.string,handler:React.PropTypes.func.isRequired,ignoreScrollBehavior:React.PropTypes.bool}});module.exports=Route},{"../mixins/FakeNode":13}],8:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,RouteHandler=React.createClass({displayName:"RouteHandler",getDefaultProps:function(){return{ref:"__routeHandler__"}},contextTypes:{getRouteAtDepth:React.PropTypes.func.isRequired,getRouteComponents:React.PropTypes.func.isRequired,routeHandlers:React.PropTypes.array.isRequired},childContextTypes:{routeHandlers:React.PropTypes.array.isRequired},getChildContext:function(){return{routeHandlers:this.context.routeHandlers.concat([this])}},getRouteDepth:function(){return this.context.routeHandlers.length-1},componentDidMount:function(){this._updateRouteComponent()},componentDidUpdate:function(){this._updateRouteComponent()},_updateRouteComponent:function(){var depth=this.getRouteDepth(),components=this.context.getRouteComponents();components[depth]=this.refs[this.props.ref]},render:function(){var route=this.context.getRouteAtDepth(this.getRouteDepth());return route?React.createElement(route.handler,this.props):null}});module.exports=RouteHandler},{}],9:[function(_dereq_,module,exports){exports.DefaultRoute=_dereq_("./components/DefaultRoute"),exports.Link=_dereq_("./components/Link"),exports.NotFoundRoute=_dereq_("./components/NotFoundRoute"),exports.Redirect=_dereq_("./components/Redirect"),exports.Route=_dereq_("./components/Route"),exports.RouteHandler=_dereq_("./components/RouteHandler"),exports.HashLocation=_dereq_("./locations/HashLocation"),exports.HistoryLocation=_dereq_("./locations/HistoryLocation"),exports.RefreshLocation=_dereq_("./locations/RefreshLocation"),exports.Navigation=_dereq_("./mixins/Navigation"),exports.State=_dereq_("./mixins/State"),exports.create=_dereq_("./utils/createRouter"),exports.run=_dereq_("./utils/runRouter")},{"./components/DefaultRoute":3,"./components/Link":4,"./components/NotFoundRoute":5,"./components/Redirect":6,"./components/Route":7,"./components/RouteHandler":8,"./locations/HashLocation":10,"./locations/HistoryLocation":11,"./locations/RefreshLocation":12,"./mixins/Navigation":14,"./mixins/State":17,"./utils/createRouter":24,"./utils/runRouter":28}],10:[function(_dereq_,module){function getHashPath(){return invariant(canUseDOM,"getHashPath needs a DOM"),Path.decode(window.location.hash.substr(1))}function ensureSlash(){var path=getHashPath();return"/"===path.charAt(0)?!0:(HashLocation.replace("/"+path),!1)}function notifyChange(type){var change={path:getHashPath(),type:type};_changeListeners.forEach(function(listener){listener(change)})}function onHashChange(){ensureSlash()&&(notifyChange(_actionType||LocationActions.POP),_actionType=null)}var _actionType,invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,LocationActions=_dereq_("../actions/LocationActions"),Path=_dereq_("../utils/Path"),_changeListeners=[],_isListening=!1,HashLocation={addChangeListener:function(listener){_changeListeners.push(listener),ensureSlash(),_isListening||(window.addEventListener?window.addEventListener("hashchange",onHashChange,!1):window.attachEvent("onhashchange",onHashChange),_isListening=!0)},push:function(path){_actionType=LocationActions.PUSH,window.location.hash=Path.encode(path)},replace:function(path){_actionType=LocationActions.REPLACE,window.location.replace(window.location.pathname+"#"+Path.encode(path))},pop:function(){_actionType=LocationActions.POP,window.history.back()},getCurrentPath:getHashPath,toString:function(){return"<HashLocation>"}};module.exports=HashLocation},{"../actions/LocationActions":1,"../utils/Path":19,"react/lib/ExecutionEnvironment":35,"react/lib/invariant":39}],11:[function(_dereq_,module){function getWindowPath(){return invariant(canUseDOM,"getWindowPath needs a DOM"),Path.decode(window.location.pathname+window.location.search)}function notifyChange(type){var change={path:getWindowPath(),type:type};_changeListeners.forEach(function(listener){listener(change)})}function onPopState(){notifyChange(LocationActions.POP)}var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,LocationActions=_dereq_("../actions/LocationActions"),Path=_dereq_("../utils/Path"),_changeListeners=[],_isListening=!1,HistoryLocation={addChangeListener:function(listener){_changeListeners.push(listener),_isListening||(window.addEventListener?window.addEventListener("popstate",onPopState,!1):window.attachEvent("popstate",onPopState),_isListening=!0)},push:function(path){window.history.pushState({path:path},"",Path.encode(path)),notifyChange(LocationActions.PUSH)},replace:function(path){window.history.replaceState({path:path},"",Path.encode(path)),notifyChange(LocationActions.REPLACE)},pop:function(){window.history.back()},getCurrentPath:getWindowPath,toString:function(){return"<HistoryLocation>"}};module.exports=HistoryLocation},{"../actions/LocationActions":1,"../utils/Path":19,"react/lib/ExecutionEnvironment":35,"react/lib/invariant":39}],12:[function(_dereq_,module){var HistoryLocation=_dereq_("./HistoryLocation"),Path=_dereq_("../utils/Path"),RefreshLocation={push:function(path){window.location=Path.encode(path)},replace:function(path){window.location.replace(Path.encode(path))},pop:function(){window.history.back()},getCurrentPath:HistoryLocation.getCurrentPath,toString:function(){return"<RefreshLocation>"}};module.exports=RefreshLocation},{"../utils/Path":19,"./HistoryLocation":11}],13:[function(_dereq_,module){var invariant=_dereq_("react/lib/invariant"),FakeNode={render:function(){invariant(!1,"%s elements should not be rendered",this.constructor.displayName)}};module.exports=FakeNode},{"react/lib/invariant":39}],14:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,Navigation={contextTypes:{makePath:React.PropTypes.func.isRequired,makeHref:React.PropTypes.func.isRequired,transitionTo:React.PropTypes.func.isRequired,replaceWith:React.PropTypes.func.isRequired,goBack:React.PropTypes.func.isRequired},makePath:function(to,params,query){return this.context.makePath(to,params,query)},makeHref:function(to,params,query){return this.context.makeHref(to,params,query)},transitionTo:function(to,params,query){this.context.transitionTo(to,params,query)},replaceWith:function(to,params,query){this.context.replaceWith(to,params,query)},goBack:function(){this.context.goBack()}};module.exports=Navigation},{}],15:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,NavigationContext={childContextTypes:{makePath:React.PropTypes.func.isRequired,makeHref:React.PropTypes.func.isRequired,transitionTo:React.PropTypes.func.isRequired,replaceWith:React.PropTypes.func.isRequired,goBack:React.PropTypes.func.isRequired},getChildContext:function(){return{makePath:this.constructor.makePath,makeHref:this.constructor.makeHref,transitionTo:this.constructor.transitionTo,replaceWith:this.constructor.replaceWith,goBack:this.constructor.goBack}}};module.exports=NavigationContext},{}],16:[function(_dereq_,module){var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,getWindowScrollPosition=_dereq_("../utils/getWindowScrollPosition"),Scrolling={componentWillMount:function(){invariant(null==this.getScrollBehavior()||canUseDOM,"Cannot use scroll behavior without a DOM"),this._scrollHistory={}},componentDidMount:function(){this._updateScroll()},componentWillUpdate:function(){this._scrollHistory[this.state.path]=getWindowScrollPosition()},componentDidUpdate:function(){this._updateScroll()},componentWillUnmount:function(){delete this._scrollHistory},getScrollPosition:function(path){return this._scrollHistory[path]||null},_updateScroll:function(){var scrollBehavior=this.getScrollBehavior();scrollBehavior&&scrollBehavior.updateScrollPosition(this.getScrollPosition(this.state.path),this.state.action)}};module.exports=Scrolling},{"../utils/getWindowScrollPosition":26,"react/lib/ExecutionEnvironment":35,"react/lib/invariant":39}],17:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,State={contextTypes:{getCurrentPath:React.PropTypes.func.isRequired,getCurrentRoutes:React.PropTypes.func.isRequired,getCurrentParams:React.PropTypes.func.isRequired,getCurrentQuery:React.PropTypes.func.isRequired,isActive:React.PropTypes.func.isRequired},getPath:function(){return this.context.getCurrentPath()},getRoutes:function(){return this.context.getCurrentRoutes()},getParams:function(){return this.context.getCurrentParams()},getQuery:function(){return this.context.getCurrentQuery()},isActive:function(to,params,query){return this.context.isActive(to,params,query)}};module.exports=State},{}],18:[function(_dereq_,module){function routeIsActive(activeRoutes,routeName){return activeRoutes.some(function(route){return route.name===routeName})}function paramsAreActive(activeParams,params){for(var property in params)if(String(activeParams[property])!==String(params[property]))return!1;return!0}function queryIsActive(activeQuery,query){for(var property in query)if(String(activeQuery[property])!==String(query[property]))return!1;return!0}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,assign=_dereq_("react/lib/Object.assign"),Path=_dereq_("../utils/Path"),StateContext={getCurrentPath:function(){return this.state.path},getCurrentRoutes:function(){return this.state.routes.slice(0)},getCurrentParams:function(){return assign({},this.state.params)},getCurrentQuery:function(){return assign({},this.state.query)},isActive:function(to,params,query){return Path.isAbsolute(to)?to===this.state.path:routeIsActive(this.state.routes,to)&&paramsAreActive(this.state.params,params)&&(null==query||queryIsActive(this.state.query,query))},childContextTypes:{getCurrentPath:React.PropTypes.func.isRequired,getCurrentRoutes:React.PropTypes.func.isRequired,getCurrentParams:React.PropTypes.func.isRequired,getCurrentQuery:React.PropTypes.func.isRequired,isActive:React.PropTypes.func.isRequired},getChildContext:function(){return{getCurrentPath:this.getCurrentPath,getCurrentRoutes:this.getCurrentRoutes,getCurrentParams:this.getCurrentParams,getCurrentQuery:this.getCurrentQuery,isActive:this.isActive}}};module.exports=StateContext},{"../utils/Path":19,"react/lib/Object.assign":36}],19:[function(_dereq_,module){function decodePathSegment(string){return decodeURIComponent(string.replace(/\+/g," "))}function encodePathSegment(string){return encodeURIComponent(string).replace(/%20/g,"+")}function compilePattern(pattern){if(!(pattern in _compiledPatterns)){var paramNames=[],source=pattern.replace(paramCompileMatcher,function(match,paramName){return paramName?(paramNames.push(paramName),"([^/?#]+)"):"*"===match?(paramNames.push("splat"),"(.*?)"):"\\"+match});_compiledPatterns[pattern]={matcher:new RegExp("^"+source+"$","i"),paramNames:paramNames}}return _compiledPatterns[pattern]}var invariant=_dereq_("react/lib/invariant"),merge=_dereq_("qs/lib/utils").merge,qs=_dereq_("qs"),paramCompileMatcher=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,paramInjectMatcher=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,paramInjectTrailingSlashMatcher=/\/\/\?|\/\?/g,queryMatcher=/\?(.+)/,_compiledPatterns={},Path={decode:function(path){return String(path).split("/").map(decodePathSegment).join("/")},encode:function(path){return String(path).split("/").map(encodePathSegment).join("/")},extractParamNames:function(pattern){return compilePattern(pattern).paramNames},extractParams:function(pattern,path){var object=compilePattern(pattern),match=path.match(object.matcher);if(!match)return null;var params={};return object.paramNames.forEach(function(paramName,index){params[paramName]=match[index+1]}),params},injectParams:function(pattern,params){params=params||{};var splatIndex=0;return pattern.replace(paramInjectMatcher,function(match,paramName){if(paramName=paramName||"splat","?"!==paramName.slice(-1))invariant(null!=params[paramName],'Missing "'+paramName+'" parameter for path "'+pattern+'"');else if(paramName=paramName.slice(0,-1),null==params[paramName])return"";var segment;return"splat"===paramName&&Array.isArray(params[paramName])?(segment=params[paramName][splatIndex++],invariant(null!=segment,"Missing splat # "+splatIndex+' for path "'+pattern+'"')):segment=params[paramName],segment}).replace(paramInjectTrailingSlashMatcher,"/")},extractQuery:function(path){var match=path.match(queryMatcher);return match&&qs.parse(match[1])},withoutQuery:function(path){return path.replace(queryMatcher,"")},withQuery:function(path,query){var existingQuery=Path.extractQuery(path);existingQuery&&(query=query?merge(existingQuery,query):existingQuery);var queryString=query&&qs.stringify(query);return queryString?Path.withoutQuery(path)+"?"+queryString:path},isAbsolute:function(path){return"/"===path.charAt(0)},normalize:function(path){return path.replace(/^\/*/,"/")},join:function(a,b){return a.replace(/\/*$/,"/")+b}};module.exports=Path},{qs:30,"qs/lib/utils":34,"react/lib/invariant":39}],20:[function(_dereq_,module){var Promise=_dereq_("when/lib/Promise");module.exports=Promise},{"when/lib/Promise":41}],21:[function(_dereq_,module){var PropTypes={falsy:function(props,propName,elementName){return props[propName]?new Error("<"+elementName+'> may not have a "'+propName+'" prop'):void 0}};module.exports=PropTypes},{}],22:[function(_dereq_,module){function Redirect(to,params,query){this.to=to,this.params=params,this.query=query}module.exports=Redirect},{}],23:[function(_dereq_,module){function runHooks(hooks,callback){try{var promise=hooks.reduce(function(promise,hook){return promise?promise.then(hook):hook()},null)}catch(error){return callback(error)}promise?promise.then(function(){setTimeout(callback)},function(error){setTimeout(function(){callback(error)})}):callback()}function runTransitionFromHooks(transition,routes,components,callback){components=reversedArray(components);var hooks=reversedArray(routes).map(function(route,index){return function(){var handler=route.handler;if(!transition.isAborted&&handler.willTransitionFrom)return handler.willTransitionFrom(transition,components[index]);var promise=transition._promise;return transition._promise=null,promise}});runHooks(hooks,callback)}function runTransitionToHooks(transition,routes,params,query,callback){var hooks=routes.map(function(route){return function(){var handler=route.handler;!transition.isAborted&&handler.willTransitionTo&&handler.willTransitionTo(transition,params,query);var promise=transition._promise;return transition._promise=null,promise}});runHooks(hooks,callback)}function Transition(path,retry){this.path=path,this.abortReason=null,this.isAborted=!1,this.retry=retry.bind(this),this._promise=null}var assign=_dereq_("react/lib/Object.assign"),reversedArray=_dereq_("./reversedArray"),Redirect=_dereq_("./Redirect"),Promise=_dereq_("./Promise");assign(Transition.prototype,{abort:function(reason){this.abortReason=reason,this.isAborted=!0},redirect:function(to,params,query){this.abort(new Redirect(to,params,query))},wait:function(value){this._promise=Promise.resolve(value)},from:function(routes,components,callback){return runTransitionFromHooks(this,routes,components,callback)},to:function(routes,params,query,callback){return runTransitionToHooks(this,routes,params,query,callback)}}),module.exports=Transition},{"./Promise":20,"./Redirect":22,"./reversedArray":27,"react/lib/Object.assign":36}],24:[function(_dereq_,module){function defaultErrorHandler(error){throw error}function defaultAbortHandler(abortReason,location){if("string"==typeof location)throw new Error("Unhandled aborted transition! Reason: "+abortReason);abortReason instanceof Redirect?location.replace(this.makePath(abortReason.to,abortReason.params,abortReason.query)):location.pop()}function findMatch(pathname,routes,defaultRoute,notFoundRoute){for(var match,route,params,i=0,len=routes.length;len>i;++i){if(route=routes[i],match=findMatch(pathname,route.childRoutes,route.defaultRoute,route.notFoundRoute),null!=match)return match.routes.unshift(route),match;if(params=Path.extractParams(route.path,pathname))return createMatch(route,params)}return defaultRoute&&(params=Path.extractParams(defaultRoute.path,pathname))?createMatch(defaultRoute,params):notFoundRoute&&(params=Path.extractParams(notFoundRoute.path,pathname))?createMatch(notFoundRoute,params):match}function createMatch(route,params){return{routes:[route],params:params}}function hasMatch(routes,route,prevParams,nextParams){return routes.some(function(r){if(r!==route)return!1;for(var paramName,paramNames=route.paramNames,i=0,len=paramNames.length;len>i;++i)if(paramName=paramNames[i],nextParams[paramName]!==prevParams[paramName])return!1;return!0})}function createRouter(options){options=options||{},"function"==typeof options?options={routes:options}:Array.isArray(options)&&(options={routes:options});var routes=[],namedRoutes={},components=[],location=options.location||DEFAULT_LOCATION,scrollBehavior=options.scrollBehavior||DEFAULT_SCROLL_BEHAVIOR,onError=options.onError||defaultErrorHandler,onAbort=options.onAbort||defaultAbortHandler,state={};location!==HistoryLocation||supportsHistory()||(location=RefreshLocation);var router=React.createClass({displayName:"Router",mixins:[NavigationContext,StateContext,Scrolling],statics:{defaultRoute:null,notFoundRoute:null,addRoutes:function(children){routes.push.apply(routes,createRoutesFromChildren(children,this,namedRoutes))},makePath:function(to,params,query){var path;if(Path.isAbsolute(to))path=Path.normalize(to);else{var route=namedRoutes[to];invariant(route,'Unable to find <Route name="%s">',to),path=route.path}return Path.withQuery(Path.injectParams(path,params),query)},makeHref:function(to,params,query){var path=this.makePath(to,params,query);return location===HashLocation?"#"+path:path},transitionTo:function(to,params,query){invariant("string"!=typeof location,"You cannot use transitionTo with a static location"),location.push(this.makePath(to,params,query))},replaceWith:function(to,params,query){invariant("string"!=typeof location,"You cannot use replaceWith with a static location"),location.replace(this.makePath(to,params,query))},goBack:function(){invariant("string"!=typeof location,"You cannot use goBack with a static location"),location.pop()},match:function(path){return findMatch(Path.withoutQuery(path),routes,this.defaultRoute,this.notFoundRoute)||null},dispatch:function(path,action,callback){if(state.path!==path){var match=this.match(path);warning(null!=match,'No route matches path "%s". Make sure you have <Route path="%s"> somewhere in your routes',path,path),null==match&&(match={});var fromRoutes,toRoutes,prevRoutes=state.routes||[],prevParams=state.params||{},nextRoutes=match.routes||[],nextParams=match.params||{},nextQuery=Path.extractQuery(path)||{};prevRoutes.length?(fromRoutes=prevRoutes.filter(function(route){return!hasMatch(nextRoutes,route,prevParams,nextParams)}),toRoutes=nextRoutes.filter(function(route){return!hasMatch(prevRoutes,route,prevParams,nextParams)})):(fromRoutes=[],toRoutes=nextRoutes);var transition=new Transition(path,this.replaceWith.bind(this,path));transition.from(fromRoutes,components,function(error){return error||transition.isAborted?callback.call(router,error,transition):void transition.to(toRoutes,nextParams,nextQuery,function(error){return error||transition.isAborted?callback.call(router,error,transition):(state.path=path,state.action=action,state.routes=nextRoutes,state.params=nextParams,state.query=nextQuery,void callback.call(router,null,transition))})})}},run:function(callback){function dispatchHandler(error,transition){error?onError.call(router,error):transition.isAborted?onAbort.call(router,transition.abortReason,location):callback.call(router,router,state)}function changeListener(change){router.dispatch(change.path,change.type,dispatchHandler)}"string"==typeof location?(warning(!canUseDOM||!1,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"),router.dispatch(location,null,dispatchHandler)):(invariant(canUseDOM,"You cannot use %s in a non-DOM environment",location),location.addChangeListener&&location.addChangeListener(changeListener),router.dispatch(location.getCurrentPath(),null,dispatchHandler))}},propTypes:{children:PropTypes.falsy},getLocation:function(){return location},getScrollBehavior:function(){return scrollBehavior},getRouteAtDepth:function(depth){var routes=this.state.routes;return routes&&routes[depth]},getRouteComponents:function(){return components},getInitialState:function(){return state},componentWillReceiveProps:function(){this.setState(state)},render:function(){return this.getRouteAtDepth(0)?React.createElement(RouteHandler,this.props):null},childContextTypes:{getRouteAtDepth:React.PropTypes.func.isRequired,getRouteComponents:React.PropTypes.func.isRequired,routeHandlers:React.PropTypes.array.isRequired},getChildContext:function(){return{getRouteComponents:this.getRouteComponents,getRouteAtDepth:this.getRouteAtDepth,routeHandlers:[this]}}});return options.routes&&router.addRoutes(options.routes),router}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,ImitateBrowserBehavior=_dereq_("../behaviors/ImitateBrowserBehavior"),RouteHandler=_dereq_("../components/RouteHandler"),HashLocation=_dereq_("../locations/HashLocation"),HistoryLocation=_dereq_("../locations/HistoryLocation"),NavigationContext=_dereq_("../mixins/NavigationContext"),StateContext=_dereq_("../mixins/StateContext"),Scrolling=_dereq_("../mixins/Scrolling"),createRoutesFromChildren=_dereq_("./createRoutesFromChildren"),supportsHistory=_dereq_("./supportsHistory"),Transition=_dereq_("./Transition"),PropTypes=_dereq_("./PropTypes"),Redirect=_dereq_("./Redirect"),Path=_dereq_("./Path"),DEFAULT_LOCATION=canUseDOM?HashLocation:"/",DEFAULT_SCROLL_BEHAVIOR=canUseDOM?ImitateBrowserBehavior:null;module.exports=createRouter},{"../behaviors/ImitateBrowserBehavior":2,"../components/RouteHandler":8,"../locations/HashLocation":10,"../locations/HistoryLocation":11,"../mixins/NavigationContext":15,"../mixins/Scrolling":16,"../mixins/StateContext":18,"./Path":19,"./PropTypes":21,"./Redirect":22,"./Transition":23,"./createRoutesFromChildren":25,"./supportsHistory":29,"react/lib/ExecutionEnvironment":35,"react/lib/invariant":39,"react/lib/warning":40}],25:[function(_dereq_,module){function createRedirectHandler(to,_params,_query){return React.createClass({statics:{willTransitionTo:function(transition,params,query){transition.redirect(to,_params||params,_query||query)}},render:function(){return null}})}function checkPropTypes(componentName,propTypes,props){for(var propName in propTypes)if(propTypes.hasOwnProperty(propName)){var error=propTypes[propName](props,propName,componentName);error instanceof Error&&warning(!1,error.message)}}function createRoute(element,parentRoute,namedRoutes){var type=element.type,props=element.props,componentName=type&&type.displayName||"UnknownComponent";invariant(-1!==CONFIG_ELEMENT_TYPES.indexOf(type),'Unrecognized route configuration element "<%s>"',componentName),type.propTypes&&checkPropTypes(componentName,type.propTypes,props);var route={name:props.name};type===Redirect.type?(route.handler=createRedirectHandler(props.to,props.params,props.query),props.path=props.path||props.from):route.handler=props.handler;var parentPath=parentRoute&&parentRoute.path||"/";if((props.path||props.name)&&type!==DefaultRoute.type&&type!==NotFoundRoute.type){var path=props.path||props.name;Path.isAbsolute(path)||(path=Path.join(parentPath,path)),route.path=Path.normalize(path)}else route.path=parentPath,type===NotFoundRoute.type&&(route.path+="*");return route.paramNames=Path.extractParamNames(route.path),parentRoute&&Array.isArray(parentRoute.paramNames)&&parentRoute.paramNames.forEach(function(paramName){invariant(-1!==route.paramNames.indexOf(paramName),'The nested route path "%s" is missing the "%s" parameter of its parent path "%s"',route.path,paramName,parentRoute.path)}),props.name&&(invariant(null==namedRoutes[props.name],'You cannot use the name "%s" for more than one route',props.name),namedRoutes[props.name]=route),type===NotFoundRoute.type?(invariant(parentRoute,"<NotFoundRoute> must have a parent <Route>"),invariant(null==parentRoute.notFoundRoute,"You may not have more than one <NotFoundRoute> per <Route>"),parentRoute.notFoundRoute=route,null):type===DefaultRoute.type?(invariant(parentRoute,"<DefaultRoute> must have a parent <Route>"),invariant(null==parentRoute.defaultRoute,"You may not have more than one <DefaultRoute> per <Route>"),parentRoute.defaultRoute=route,null):(route.childRoutes=createRoutesFromChildren(props.children,route,namedRoutes),route)}function createRoutesFromChildren(children,parentRoute,namedRoutes){var routes=[];return React.Children.forEach(children,function(child){(child=createRoute(child,parentRoute,namedRoutes))&&routes.push(child)}),routes}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),invariant=_dereq_("react/lib/invariant"),DefaultRoute=_dereq_("../components/DefaultRoute"),NotFoundRoute=_dereq_("../components/NotFoundRoute"),Redirect=_dereq_("../components/Redirect"),Route=_dereq_("../components/Route"),Path=_dereq_("./Path"),CONFIG_ELEMENT_TYPES=[DefaultRoute.type,NotFoundRoute.type,Redirect.type,Route.type];module.exports=createRoutesFromChildren},{"../components/DefaultRoute":3,"../components/NotFoundRoute":5,"../components/Redirect":6,"../components/Route":7,"./Path":19,"react/lib/invariant":39,"react/lib/warning":40}],26:[function(_dereq_,module){function getWindowScrollPosition(){return invariant(canUseDOM,"Cannot get current scroll position without a DOM"),{x:window.scrollX,y:window.scrollY}}var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM;module.exports=getWindowScrollPosition},{"react/lib/ExecutionEnvironment":35,"react/lib/invariant":39}],27:[function(_dereq_,module){function reversedArray(array){return array.slice(0).reverse()}module.exports=reversedArray},{}],28:[function(_dereq_,module){function runRouter(routes,location,callback){"function"==typeof location&&(callback=location,location=null);var router=createRouter({routes:routes,location:location});return router.run(callback),router}var createRouter=_dereq_("./createRouter");module.exports=runRouter},{"./createRouter":24}],29:[function(_dereq_,module){function supportsHistory(){var ua=navigator.userAgent;return-1===ua.indexOf("Android 2.")&&-1===ua.indexOf("Android 4.0")||-1===ua.indexOf("Mobile Safari")||-1!==ua.indexOf("Chrome")?window.history&&"pushState"in window.history:!1}module.exports=supportsHistory},{}],30:[function(_dereq_,module){module.exports=_dereq_("./lib")},{"./lib":31}],31:[function(_dereq_,module){var Stringify=_dereq_("./stringify"),Parse=_dereq_("./parse"); module.exports={stringify:Stringify,parse:Parse}},{"./parse":32,"./stringify":33}],32:[function(_dereq_,module){var Utils=_dereq_("./utils"),internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};internals.parseValues=function(str,options){for(var obj={},parts=str.split(options.delimiter,1/0===options.parameterLimit?void 0:options.parameterLimit),i=0,il=parts.length;il>i;++i){var part=parts[i],pos=-1===part.indexOf("]=")?part.indexOf("="):part.indexOf("]=")+1;if(-1===pos)obj[Utils.decode(part)]="";else{var key=Utils.decode(part.slice(0,pos)),val=Utils.decode(part.slice(pos+1));obj[key]=obj[key]?[].concat(obj[key]).concat(val):val}}return obj},internals.parseObject=function(chain,val,options){if(!chain.length)return val;var root=chain.shift(),obj={};if("[]"===root)obj=[],obj=obj.concat(internals.parseObject(chain,val,options));else{var cleanRoot="["===root[0]&&"]"===root[root.length-1]?root.slice(1,root.length-1):root,index=parseInt(cleanRoot,10);!isNaN(index)&&root!==cleanRoot&&index<=options.arrayLimit?(obj=[],obj[index]=internals.parseObject(chain,val,options)):obj[cleanRoot]=internals.parseObject(chain,val,options)}return obj},internals.parseKeys=function(key,val,options){if(key){var parent=/^([^\[\]]*)/,child=/(\[[^\[\]]*\])/g,segment=parent.exec(key);if(!Object.prototype.hasOwnProperty(segment[1])){var keys=[];segment[1]&&keys.push(segment[1]);for(var i=0;null!==(segment=child.exec(key))&&i<options.depth;)++i,Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))||keys.push(segment[1]);return segment&&keys.push("["+key.slice(segment.index)+"]"),internals.parseObject(keys,val,options)}}},module.exports=function(str,options){if(""===str||null===str||"undefined"==typeof str)return{};options=options||{},options.delimiter="string"==typeof options.delimiter||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter,options.depth="number"==typeof options.depth?options.depth:internals.depth,options.arrayLimit="number"==typeof options.arrayLimit?options.arrayLimit:internals.arrayLimit,options.parameterLimit="number"==typeof options.parameterLimit?options.parameterLimit:internals.parameterLimit;for(var tempObj="string"==typeof str?internals.parseValues(str,options):str,obj={},keys=Object.keys(tempObj),i=0,il=keys.length;il>i;++i){var key=keys[i],newObj=internals.parseKeys(key,tempObj[key],options);obj=Utils.merge(obj,newObj)}return Utils.compact(obj)}},{"./utils":34}],33:[function(_dereq_,module){var Utils=_dereq_("./utils"),internals={delimiter:"&"};internals.stringify=function(obj,prefix){if(Utils.isBuffer(obj)?obj=obj.toString():obj instanceof Date?obj=obj.toISOString():null===obj&&(obj=""),"string"==typeof obj||"number"==typeof obj||"boolean"==typeof obj)return[encodeURIComponent(prefix)+"="+encodeURIComponent(obj)];var values=[];for(var key in obj)obj.hasOwnProperty(key)&&(values=values.concat(internals.stringify(obj[key],prefix+"["+key+"]")));return values},module.exports=function(obj,options){options=options||{};var delimiter="undefined"==typeof options.delimiter?internals.delimiter:options.delimiter,keys=[];for(var key in obj)obj.hasOwnProperty(key)&&(keys=keys.concat(internals.stringify(obj[key],key)));return keys.join(delimiter)}},{"./utils":34}],34:[function(_dereq_,module,exports){exports.arrayToObject=function(source){for(var obj={},i=0,il=source.length;il>i;++i)"undefined"!=typeof source[i]&&(obj[i]=source[i]);return obj},exports.merge=function(target,source){if(!source)return target;if(Array.isArray(source)){for(var i=0,il=source.length;il>i;++i)"undefined"!=typeof source[i]&&(target[i]="object"==typeof target[i]?exports.merge(target[i],source[i]):source[i]);return target}if(Array.isArray(target)){if("object"!=typeof source)return target.push(source),target;target=exports.arrayToObject(target)}for(var keys=Object.keys(source),k=0,kl=keys.length;kl>k;++k){var key=keys[k],value=source[key];target[key]=value&&"object"==typeof value&&target[key]?exports.merge(target[key],value):value}return target},exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}},exports.compact=function(obj,refs){if("object"!=typeof obj||null===obj)return obj;refs=refs||[];var lookup=refs.indexOf(obj);if(-1!==lookup)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0,l=obj.length;l>i;++i)"undefined"!=typeof obj[i]&&compacted.push(obj[i]);return compacted}for(var keys=Object.keys(obj),i=0,il=keys.length;il>i;++i){var key=keys[i];obj[key]=exports.compact(obj[key],refs)}return obj},exports.isRegExp=function(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},exports.isBuffer=function(obj){return"undefined"!=typeof Buffer?Buffer.isBuffer(obj):!1}},{}],35:[function(_dereq_,module){"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment},{}],36:[function(_dereq_,module){function assign(target){if(null==target)throw new TypeError("Object.assign target cannot be null or undefined");for(var to=Object(target),hasOwnProperty=Object.prototype.hasOwnProperty,nextIndex=1;nextIndex<arguments.length;nextIndex++){var nextSource=arguments[nextIndex];if(null!=nextSource){var from=Object(nextSource);for(var key in from)hasOwnProperty.call(from,key)&&(to[key]=from[key])}}return to}module.exports=assign},{}],37:[function(_dereq_,module){function cx(classNames){return"object"==typeof classNames?Object.keys(classNames).filter(function(className){return classNames[className]}).join(" "):Array.prototype.join.call(arguments," ")}module.exports=cx},{}],38:[function(_dereq_,module){function makeEmptyFunction(arg){return function(){return arg}}function emptyFunction(){}emptyFunction.thatReturns=makeEmptyFunction,emptyFunction.thatReturnsFalse=makeEmptyFunction(!1),emptyFunction.thatReturnsTrue=makeEmptyFunction(!0),emptyFunction.thatReturnsNull=makeEmptyFunction(null),emptyFunction.thatReturnsThis=function(){return this},emptyFunction.thatReturnsArgument=function(arg){return arg},module.exports=emptyFunction},{}],39:[function(_dereq_,module){"use strict";var invariant=function(condition,format,a,b,c,d,e,f){if(!condition){var error;if(void 0===format)error=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var args=[a,b,c,d,e,f],argIndex=0;error=new Error("Invariant Violation: "+format.replace(/%s/g,function(){return args[argIndex++]}))}throw error.framesToPop=1,error}};module.exports=invariant},{}],40:[function(_dereq_,module){"use strict";var emptyFunction=_dereq_("./emptyFunction"),warning=emptyFunction;module.exports=warning},{"./emptyFunction":38}],41:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){var makePromise=_dereq_("./makePromise"),Scheduler=_dereq_("./Scheduler"),async=_dereq_("./async");return makePromise({scheduler:new Scheduler(async)})})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{"./Scheduler":43,"./async":44,"./makePromise":45}],42:[function(_dereq_,module){!function(define){"use strict";define(function(){function Queue(capacityPow2){this.head=this.tail=this.length=0,this.buffer=new Array(1<<capacityPow2)}return Queue.prototype.push=function(x){return this.length===this.buffer.length&&this._ensureCapacity(2*this.length),this.buffer[this.tail]=x,this.tail=this.tail+1&this.buffer.length-1,++this.length,this.length},Queue.prototype.shift=function(){var x=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head=this.head+1&this.buffer.length-1,--this.length,x},Queue.prototype._ensureCapacity=function(capacity){var len,head=this.head,buffer=this.buffer,newBuffer=new Array(capacity),i=0;if(0===head)for(len=this.length;len>i;++i)newBuffer[i]=buffer[i];else{for(capacity=buffer.length,len=this.tail;capacity>head;++i,++head)newBuffer[i]=buffer[head];for(head=0;len>head;++i,++head)newBuffer[i]=buffer[head]}this.buffer=newBuffer,this.head=0,this.tail=this.length},Queue})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory()})},{}],43:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){function Scheduler(async){this._async=async,this._queue=new Queue(15),this._afterQueue=new Queue(5),this._running=!1;var self=this;this.drain=function(){self._drain()}}function runQueue(queue){for(;queue.length>0;)queue.shift().run()}var Queue=_dereq_("./Queue");return Scheduler.prototype.enqueue=function(task){this._add(this._queue,task)},Scheduler.prototype.afterQueue=function(task){this._add(this._afterQueue,task)},Scheduler.prototype._drain=function(){runQueue(this._queue),this._running=!1,runQueue(this._afterQueue)},Scheduler.prototype._add=function(queue,task){queue.push(task),this._running||(this._running=!0,this._async(this.drain))},Scheduler})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{"./Queue":42}],44:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){var nextTick,MutationObs;return nextTick="undefined"!=typeof process&&null!==process&&"function"==typeof process.nextTick?function(f){process.nextTick(f)}:(MutationObs="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)?function(document,MutationObserver){function run(){var f=scheduled;scheduled=void 0,f()}var scheduled,el=document.createElement("div"),o=new MutationObserver(run);return o.observe(el,{attributes:!0}),function(f){scheduled=f,el.setAttribute("class","x")}}(document,MutationObs):function(cjsRequire){var vertx;try{vertx=cjsRequire("vertx")}catch(ignore){}if(vertx){if("function"==typeof vertx.runOnLoop)return vertx.runOnLoop;if("function"==typeof vertx.runOnContext)return vertx.runOnContext}var capturedSetTimeout=setTimeout;return function(t){capturedSetTimeout(t,0)}}(_dereq_)})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{}],45:[function(_dereq_,module){!function(define){"use strict";define(function(){return function(environment){function Promise(resolver,handler){this._handler=resolver===Handler?handler:init(resolver)}function init(resolver){function promiseResolve(x){handler.resolve(x)}function promiseReject(reason){handler.reject(reason)}function promiseNotify(x){handler.notify(x)}var handler=new Pending;try{resolver(promiseResolve,promiseReject,promiseNotify)}catch(e){promiseReject(e)}return handler}function resolve(x){return isPromise(x)?x:new Promise(Handler,new Async(getHandler(x)))}function reject(x){return new Promise(Handler,new Async(new Rejected(x)))}function never(){return foreverPendingPromise}function defer(){return new Promise(Handler,new Pending)}function all(promises){function settleAt(i,x,resolver){this[i]=x,0===--pending&&resolver.become(new Fulfilled(this))}var i,h,x,s,resolver=new Pending,pending=promises.length>>>0,results=new Array(pending);for(i=0;i<promises.length;++i)if(x=promises[i],void 0!==x||i in promises)if(maybeThenable(x))if(h=getHandlerMaybeThenable(x),s=h.state(),0===s)h.fold(settleAt,i,results,resolver);else{if(!(s>0)){unreportRemaining(promises,i+1,h),resolver.become(h);break}results[i]=h.value,--pending}else results[i]=x,--pending;else--pending;return 0===pending&&resolver.become(new Fulfilled(results)),new Promise(Handler,resolver)}function unreportRemaining(promises,start,rejectedHandler){var i,h,x;for(i=start;i<promises.length;++i)x=promises[i],maybeThenable(x)&&(h=getHandlerMaybeThenable(x),h!==rejectedHandler&&h.visit(h,void 0,h._unreport))}function race(promises){if(Object(promises)===promises&&0===promises.length)return never();var i,x,h=new Pending;for(i=0;i<promises.length;++i)x=promises[i],void 0!==x&&i in promises&&getHandler(x).visit(h,h.resolve,h.reject);return new Promise(Handler,h)}function getHandler(x){return isPromise(x)?x._handler.join():maybeThenable(x)?getHandlerUntrusted(x):new Fulfilled(x)}function getHandlerMaybeThenable(x){return isPromise(x)?x._handler.join():getHandlerUntrusted(x)}function getHandlerUntrusted(x){try{var untrustedThen=x.then;return"function"==typeof untrustedThen?new Thenable(untrustedThen,x):new Fulfilled(x)}catch(e){return new Rejected(e)}}function Handler(){}function FailIfRejected(){}function Pending(receiver,inheritedContext){Promise.createContext(this,inheritedContext),this.consumers=void 0,this.receiver=receiver,this.handler=void 0,this.resolved=!1}function Async(handler){this.handler=handler}function Thenable(then,thenable){Pending.call(this),tasks.enqueue(new AssimilateTask(then,thenable,this))}function Fulfilled(x){Promise.createContext(this),this.value=x}function Rejected(x){Promise.createContext(this),this.id=++errorId,this.value=x,this.handled=!1,this.reported=!1,this._report()}function ReportTask(rejection,context){this.rejection=rejection,this.context=context}function UnreportTask(rejection){this.rejection=rejection}function cycle(){return new Rejected(new TypeError("Promise cycle"))}function ContinuationTask(continuation,handler){this.continuation=continuation,this.handler=handler}function ProgressTask(value,handler){this.handler=handler,this.value=value}function AssimilateTask(then,thenable,resolver){this._then=then,this.thenable=thenable,this.resolver=resolver}function tryAssimilate(then,thenable,resolve,reject,notify){try{then.call(thenable,resolve,reject,notify)}catch(e){reject(e)}}function isPromise(x){return x instanceof Promise}function maybeThenable(x){return("object"==typeof x||"function"==typeof x)&&null!==x}function runContinuation1(f,h,receiver,next){return"function"!=typeof f?next.become(h):(Promise.enterContext(h),tryCatchReject(f,h.value,receiver,next),void Promise.exitContext())}function runContinuation3(f,x,h,receiver,next){return"function"!=typeof f?next.become(h):(Promise.enterContext(h),tryCatchReject3(f,x,h.value,receiver,next),void Promise.exitContext())}function runNotify(f,x,h,receiver,next){return"function"!=typeof f?next.notify(x):(Promise.enterContext(h),tryCatchReturn(f,x,receiver,next),void Promise.exitContext())}function tryCatchReject(f,x,thisArg,next){try{next.become(getHandler(f.call(thisArg,x)))}catch(e){next.become(new Rejected(e))}}function tryCatchReject3(f,x,y,thisArg,next){try{f.call(thisArg,x,y,next)}catch(e){next.become(new Rejected(e))}}function tryCatchReturn(f,x,thisArg,next){try{next.notify(f.call(thisArg,x))}catch(e){next.notify(e)}}function inherit(Parent,Child){Child.prototype=objectCreate(Parent.prototype),Child.prototype.constructor=Child}function noop(){}var tasks=environment.scheduler,objectCreate=Object.create||function(proto){function Child(){}return Child.prototype=proto,new Child};Promise.resolve=resolve,Promise.reject=reject,Promise.never=never,Promise._defer=defer,Promise._handler=getHandler,Promise.prototype.then=function(onFulfilled,onRejected){var parent=this._handler,state=parent.join().state();if("function"!=typeof onFulfilled&&state>0||"function"!=typeof onRejected&&0>state)return new this.constructor(Handler,parent);var p=this._beget(),child=p._handler;return parent.chain(child,parent.receiver,onFulfilled,onRejected,arguments.length>2?arguments[2]:void 0),p},Promise.prototype["catch"]=function(onRejected){return this.then(void 0,onRejected)},Promise.prototype._beget=function(){var parent=this._handler,child=new Pending(parent.receiver,parent.join().context);return new this.constructor(Handler,child)},Promise.all=all,Promise.race=race,Handler.prototype.when=Handler.prototype.become=Handler.prototype.notify=Handler.prototype.fail=Handler.prototype._unreport=Handler.prototype._report=noop,Handler.prototype._state=0,Handler.prototype.state=function(){return this._state},Handler.prototype.join=function(){for(var h=this;void 0!==h.handler;)h=h.handler;return h},Handler.prototype.chain=function(to,receiver,fulfilled,rejected,progress){this.when({resolver:to,receiver:receiver,fulfilled:fulfilled,rejected:rejected,progress:progress})},Handler.prototype.visit=function(receiver,fulfilled,rejected,progress){this.chain(failIfRejected,receiver,fulfilled,rejected,progress)},Handler.prototype.fold=function(f,z,c,to){this.visit(to,function(x){f.call(c,z,x,this)},to.reject,to.notify)},inherit(Handler,FailIfRejected),FailIfRejected.prototype.become=function(h){h.fail()};var failIfRejected=new FailIfRejected;inherit(Handler,Pending),Pending.prototype._state=0,Pending.prototype.resolve=function(x){this.become(getHandler(x))},Pending.prototype.reject=function(x){this.resolved||this.become(new Rejected(x))},Pending.prototype.join=function(){if(!this.resolved)return this;for(var h=this;void 0!==h.handler;)if(h=h.handler,h===this)return this.handler=cycle();return h},Pending.prototype.run=function(){var q=this.consumers,handler=this.join();this.consumers=void 0;for(var i=0;i<q.length;++i)handler.when(q[i])},Pending.prototype.become=function(handler){this.resolved||(this.resolved=!0,this.handler=handler,void 0!==this.consumers&&tasks.enqueue(this),void 0!==this.context&&handler._report(this.context))},Pending.prototype.when=function(continuation){this.resolved?tasks.enqueue(new ContinuationTask(continuation,this.handler)):void 0===this.consumers?this.consumers=[continuation]:this.consumers.push(continuation)},Pending.prototype.notify=function(x){this.resolved||tasks.enqueue(new ProgressTask(x,this))},Pending.prototype.fail=function(context){var c="undefined"==typeof context?this.context:context;this.resolved&&this.handler.join().fail(c)},Pending.prototype._report=function(context){this.resolved&&this.handler.join()._report(context)},Pending.prototype._unreport=function(){this.resolved&&this.handler.join()._unreport()},inherit(Handler,Async),Async.prototype.when=function(continuation){tasks.enqueue(new ContinuationTask(continuation,this))},Async.prototype._report=function(context){this.join()._report(context)},Async.prototype._unreport=function(){this.join()._unreport()},inherit(Pending,Thenable),inherit(Handler,Fulfilled),Fulfilled.prototype._state=1,Fulfilled.prototype.fold=function(f,z,c,to){runContinuation3(f,z,this,c,to)},Fulfilled.prototype.when=function(cont){runContinuation1(cont.fulfilled,this,cont.receiver,cont.resolver)};var errorId=0;inherit(Handler,Rejected),Rejected.prototype._state=-1,Rejected.prototype.fold=function(f,z,c,to){to.become(this)},Rejected.prototype.when=function(cont){"function"==typeof cont.rejected&&this._unreport(),runContinuation1(cont.rejected,this,cont.receiver,cont.resolver)},Rejected.prototype._report=function(context){tasks.afterQueue(new ReportTask(this,context))},Rejected.prototype._unreport=function(){this.handled=!0,tasks.afterQueue(new UnreportTask(this))},Rejected.prototype.fail=function(context){Promise.onFatalRejection(this,void 0===context?this.context:context)},ReportTask.prototype.run=function(){this.rejection.handled||(this.rejection.reported=!0,Promise.onPotentiallyUnhandledRejection(this.rejection,this.context))},UnreportTask.prototype.run=function(){this.rejection.reported&&Promise.onPotentiallyUnhandledRejectionHandled(this.rejection)},Promise.createContext=Promise.enterContext=Promise.exitContext=Promise.onPotentiallyUnhandledRejection=Promise.onPotentiallyUnhandledRejectionHandled=Promise.onFatalRejection=noop;var foreverPendingHandler=new Handler,foreverPendingPromise=new Promise(Handler,foreverPendingHandler);return ContinuationTask.prototype.run=function(){this.handler.join().when(this.continuation)},ProgressTask.prototype.run=function(){var q=this.handler.consumers;if(void 0!==q)for(var c,i=0;i<q.length;++i)c=q[i],runNotify(c.progress,this.value,this.handler,c.receiver,c.resolver)},AssimilateTask.prototype.run=function(){function _resolve(x){h.resolve(x)}function _reject(x){h.reject(x)}function _notify(x){h.notify(x)}var h=this.resolver;tryAssimilate(this._then,this.thenable,_resolve,_reject,_notify)},Promise}})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory()})},{}]},{},[9])(9)});
playground/server.js
benox3/react-pic
import React from 'react'; import express from 'express'; import ReactDOMServer from 'react-dom/server'; import Playground from './Playground'; const app = express(); const port = 8000; app.get('/', (req, resp) => { const html = ReactDOMServer.renderToString( React.createElement(Playground), ); resp.send(html); }); app.listen(port, () => { console.log(`http://localhost:${port}`); // eslint-disable-line no-console });
analysis/rogueoutlaw/src/modules/core/Energy.js
yajinni/WoWAnalyzer
import React from 'react'; import Analyzer from 'parser/core/Analyzer'; import SPELLS from 'common/SPELLS'; import { SpellLink } from 'interface'; import resourceSuggest from 'parser/shared/modules/resources/resourcetracker/ResourceSuggest'; import { EnergyTracker } from '@wowanalyzer/rogue'; class Energy extends Analyzer { static dependencies = { energyTracker: EnergyTracker, }; suggestions(when) { resourceSuggest(when, this.energyTracker, { spell: SPELLS.COMBAT_POTENCY, minor: 0.05, avg: 0.1, major: 0.15, extraSuggestion: <>Try to keep energy below max to avoid waisting <SpellLink id={SPELLS.COMBAT_POTENCY.id} /> procs.</>, }); if (this.selectedCombatant.hasTalent(SPELLS.BLADE_RUSH_TALENT.id)) { resourceSuggest(when, this.energyTracker, { spell: SPELLS.BLADE_RUSH_TALENT_BUFF, minor: 0.05, avg: 0.1, major: 0.15, extraSuggestion: <>Try to keep energy below max to avoid waisting <SpellLink id={SPELLS.BLADE_RUSH_TALENT.id} /> gains.</>, }); } } } export default Energy;
src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js
tako-black/react-1
/** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ChangeEventPlugin */ 'use strict'; var EventConstants = require('EventConstants'); var EventPluginHub = require('EventPluginHub'); var EventPropagators = require('EventPropagators'); var ExecutionEnvironment = require('ExecutionEnvironment'); var ReactUpdates = require('ReactUpdates'); var SyntheticEvent = require('SyntheticEvent'); var isEventSupported = require('isEventSupported'); var isTextInputElement = require('isTextInputElement'); var keyOf = require('keyOf'); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { change: { phasedRegistrationNames: { bubbled: keyOf({onChange: null}), captured: keyOf({onChangeCapture: null}), }, dependencies: [ topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange, ], }, }; /** * For IE shims */ var activeElement = null; var activeElementID = null; var activeElementValue = null; var activeElementValueProp = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); return ( nodeName === 'select' || (nodeName === 'input' && elem.type === 'file') ); } var doesChangeEventBubble = false; if (ExecutionEnvironment.canUseDOM) { // See `handleChange` comment below doesChangeEventBubble = isEventSupported('change') && ( !('documentMode' in document) || document.documentMode > 8 ); } function manualDispatchChangeEvent(nativeEvent) { var event = SyntheticEvent.getPooled( eventTypes.change, activeElementID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); // If change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through ReactBrowserEventEmitter. Since it // doesn't, we manually listen for the events and so we have to enqueue and // process the abstract event manually. // // Batching is necessary here in order to ensure that all event handlers run // before the next rerender (including event handlers attached to ancestor // elements instead of directly on the input). Without this, controlled // components don't work properly in conjunction with event bubbling because // the component is rerendered and the value reverted before all the event // handlers can run. See https://github.com/facebook/react/issues/708. ReactUpdates.batchedUpdates(runEventInBatch, event); } function runEventInBatch(event) { EventPluginHub.enqueueEvents(event); EventPluginHub.processEventQueue(); } function startWatchingForChangeEventIE8(target, targetID) { activeElement = target; activeElementID = targetID; activeElement.attachEvent('onchange', manualDispatchChangeEvent); } function stopWatchingForChangeEventIE8() { if (!activeElement) { return; } activeElement.detachEvent('onchange', manualDispatchChangeEvent); activeElement = null; activeElementID = null; } function getTargetIDForChangeEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topChange) { return topLevelTargetID; } } function handleEventsForChangeEventIE8( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForChangeEventIE8(); startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForChangeEventIE8(); } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (ExecutionEnvironment.canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events isInputEventSupported = isEventSupported('input') && ( !('documentMode' in document) || document.documentMode > 9 ); } /** * (For old IE.) Replacement getter/setter for the `value` property that gets * set on the active element. */ var newValueProp = { get: function() { return activeElementValueProp.get.call(this); }, set: function(val) { // Cast to a string so we can do equality checks. activeElementValue = '' + val; activeElementValueProp.set.call(this, val); }, }; /** * (For old IE.) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetID) { activeElement = target; activeElementID = targetID; activeElementValue = target.value; activeElementValueProp = Object.getOwnPropertyDescriptor( target.constructor.prototype, 'value' ); Object.defineProperty(activeElement, 'value', newValueProp); activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** * (For old IE.) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } // delete restores the original property definition delete activeElement.value; activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementID = null; activeElementValue = null; activeElementValueProp = null; } /** * (For old IE.) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } var value = nativeEvent.srcElement.value; if (value === activeElementValue) { return; } activeElementValue = value; manualDispatchChangeEvent(nativeEvent); } /** * If a `change` event should be fired, returns the target's ID. */ function getTargetIDForInputEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topInput) { // In modern browsers (i.e., not IE8 or IE9), the input event is exactly // what we want so fall through here and trigger an abstract event return topLevelTargetID; } } // For IE8 and IE9. function handleEventsForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // In IE8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyName // equal to 'value' // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetIDForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. if (activeElement && activeElement.value !== activeElementValue) { activeElementValue = activeElement.value; return activeElementID; } } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. return ( (elem.nodeName && elem.nodeName.toLowerCase() === 'input') && (elem.type === 'checkbox' || elem.type === 'radio') ); } function getTargetIDForClickEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topClick) { return topLevelTargetID; } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - select */ var ChangeEventPlugin = { eventTypes: eventTypes, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var getTargetIDFunc, handleEventFunc; if (shouldUseChangeEvent(topLevelTarget)) { if (doesChangeEventBubble) { getTargetIDFunc = getTargetIDForChangeEvent; } else { handleEventFunc = handleEventsForChangeEventIE8; } } else if (isTextInputElement(topLevelTarget)) { if (isInputEventSupported) { getTargetIDFunc = getTargetIDForInputEvent; } else { getTargetIDFunc = getTargetIDForInputEventIE; handleEventFunc = handleEventsForInputEventIE; } } else if (shouldUseClickEvent(topLevelTarget)) { getTargetIDFunc = getTargetIDForClickEvent; } if (getTargetIDFunc) { var targetID = getTargetIDFunc( topLevelType, topLevelTarget, topLevelTargetID ); if (targetID) { var event = SyntheticEvent.getPooled( eventTypes.change, targetID, nativeEvent ); event.type = 'change'; EventPropagators.accumulateTwoPhaseDispatches(event); return event; } } if (handleEventFunc) { handleEventFunc( topLevelType, topLevelTarget, topLevelTargetID ); } }, }; module.exports = ChangeEventPlugin;
src/docs/components/carousel/CarouselDoc.js
karatechops/grommet-docs
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import Carousel from 'grommet/components/Carousel'; import Image from 'grommet/components/Image'; import Box from 'grommet/components/Box'; import Button from 'grommet/components/Button'; import DocsArticle from '../../../components/DocsArticle'; Carousel.displayName = 'Carousel'; Box.displayName = 'Box'; export default class TileDoc extends Component { render () { return ( <DocsArticle title='Carousel' action={ <Button primary={true} path={`/docs/carousel/examples`} label='Examples' /> }> <section> <p>Image carousel.</p> <Box size='medium'> <Carousel> <Image src='/img/carousel-1.png' /> <Image src='/img/carousel-2.png' /> </Carousel> </Box> </section> <section> <h2>Properties</h2> <dl> <dt><code>autoplay true|false</code></dt> <dd>Whether the carousel should play automatically or not. Defaults to <code>true</code>.</dd> <dt><code>autoplaySpeed {'{number}'}</code></dt> <dd>How long the carousel should stay on each slide, in milliseconds. Defaults to <code>5000</code> (5 seconds).</dd> <dt><code>infinite true|false</code></dt> <dd>Whether the carousel should scroll back to the first slide when you get to the end, or stop at the last slide. Defaults to <code>true</code>.</dd> <dt><code>persistentNav true|false</code></dt> <dd>Whether the navigational elements should always be shown, or only show when the user mouses over the carousel. Defaults to <code>true</code>.</dd> </dl> </section> </DocsArticle> ); } };
examples/universal/webpack.config.js
javascriptjedi/redux-select
var path = require('path') var webpack = require('webpack') module.exports = { devtool: 'inline-source-map', entry: [ 'webpack-hot-middleware/client', './client/index.js' ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/static/' }, plugins: [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin() ], module: { loaders: [ { test: /\.js$/, loader: 'babel', exclude: /node_modules/, include: __dirname, query: { presets: [ 'react-hmre' ] } } ] } }
draft-js-emoji-plugin/src/constants/defaultEmojiGroups.js
koaninc/draft-js-plugins
import React from 'react'; import FaSmileO from 'react-icons/lib/fa/smile-o'; import FaPaw from 'react-icons/lib/fa/paw'; import FaCutlery from 'react-icons/lib/fa/cutlery'; import FaFutbolO from 'react-icons/lib/fa/futbol-o'; import FaPlane from 'react-icons/lib/fa/plane'; import FaBell from 'react-icons/lib/fa/bell'; import FaHeart from 'react-icons/lib/fa/heart'; import FaFlag from 'react-icons/lib/fa/flag'; const defaultEmojiGroups = [{ title: 'People', icon: ( <FaSmileO style={{ verticalAlign: '' }} /> ), categories: ['people'], }, { title: 'Nature', icon: ( <FaPaw style={{ verticalAlign: '' }} /> ), categories: ['nature'], }, { title: 'Food & Drink', icon: ( <FaCutlery style={{ verticalAlign: '' }} /> ), categories: ['food'], }, { title: 'Activity', icon: ( <FaFutbolO style={{ verticalAlign: '' }} /> ), categories: ['activity'], }, { title: 'Travel & Places', icon: ( <FaPlane style={{ verticalAlign: '' }} /> ), categories: ['travel'], }, { title: 'Objects', icon: ( <FaBell style={{ verticalAlign: '' }} /> ), categories: ['objects'], }, { title: 'Symbols', icon: ( <FaHeart style={{ verticalAlign: '' }} /> ), categories: ['symbols'], }, { title: 'Flags', icon: ( <FaFlag style={{ verticalAlign: '' }} /> ), categories: ['flags'], }]; export default defaultEmojiGroups;
src/index.js
zscaiosi/front-petdevice
import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter, Route } from 'react-router-dom'; import Base from './Base'; import {createStore, applyMiddleware} from 'redux'; import wholeState from './reducers/index'; import {Provider} from 'react-redux'; import thunkMiddleware from 'redux-thunk'; import { composeWithDevTools } from 'redux-devtools-extension'; import { loadState, saveState } from './localStorage'; import './style/bootstrap.css'; import './style/font-awesome/css/font-awesome.min.css'; import './style/index.css'; const persistingState = loadState(); const store = createStore(wholeState, persistingState, composeWithDevTools( applyMiddleware(thunkMiddleware) ) ); store.subscribe( () => { //console.log("getState", store.getState()); saveState(store.getState()); }); ReactDOM.render( <Provider store={store}> <BrowserRouter> <div className="container-fluid"> <Route path="/" component={Base} /> </div> </BrowserRouter> </Provider>, document.getElementById('root') );
src/Parser/Druid/Restoration/Modules/Talents/SpringBlossoms.js
enragednuke/WoWAnalyzer
import React from 'react'; import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox'; import { formatPercentage } from 'common/format'; import SpellIcon from 'common/SpellIcon'; import SpellLink from 'common/SpellLink'; import SPELLS from 'common/SPELLS'; import Analyzer from 'Parser/Core/Analyzer'; import Combatants from 'Parser/Core/Modules/Combatants'; import Mastery from '../Core/Mastery'; class SpringBlossoms extends Analyzer { static dependencies = { combatants: Combatants, mastery: Mastery, }; on_initialized() { const hasSpringBlossoms = this.combatants.selected.hasTalent(SPELLS.SPRING_BLOSSOMS_TALENT.id); this.active = hasSpringBlossoms; } get directPercent() { return this.owner.getPercentageOfTotalHealingDone(this.mastery.getDirectHealing(SPELLS.SPRING_BLOSSOMS.id)); } get masteryPercent() { return this.owner.getPercentageOfTotalHealingDone(this.mastery.getMasteryHealing(SPELLS.SPRING_BLOSSOMS.id)); } get totalPercent() { return this.directPercent + this.masteryPercent; } get suggestionThresholds() { return { actual: this.totalPercent, isLessThan: { minor: 0.07, average: 0.05, major: 0.03, }, style: 'percentage', }; } statistic() { return ( <StatisticBox icon={<SpellIcon id={SPELLS.SPRING_BLOSSOMS.id} />} value={`${formatPercentage(this.totalPercent)} %`} label="Spring Blossoms Healing" tooltip={`This is the sum of the direct healing from Spring Blossoms and the healing enabled by Spring Blossom's extra mastery stack. <ul> <li>Direct: <b>${formatPercentage(this.directPercent)}%</b></li> <li>Mastery: <b>${formatPercentage(this.masteryPercent)}%</b></li> </ul>`} /> ); } statisticOrder = STATISTIC_ORDER.OPTIONAL(); suggestions(when) { when(this.suggestionThresholds) .addSuggestion((suggest, actual, recommended) => { return suggest(<span>Your healing from <SpellLink id={SPELLS.SPRING_BLOSSOMS.id} /> could be improved. Either your efflorescence uptime could be improved or the encounter doesn't fit this talent very well.</span>) .icon(SPELLS.SPRING_BLOSSOMS.icon) .actual(`${formatPercentage(this.totalPercent)}% healing`) .recommended(`>${Math.round(formatPercentage(recommended))}% is recommended`); }); } } export default SpringBlossoms;
src/parser/monk/windwalker/modules/spells/TouchOfDeath.js
fyruna/WoWAnalyzer
import React from 'react'; import SPELLS from 'common/SPELLS'; import Analyzer from 'parser/core/Analyzer'; import Enemies from 'parser/shared/modules/Enemies'; import StatTracker from 'parser/shared/modules/StatTracker'; import SpellIcon from 'common/SpellIcon'; import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox'; import AbilityTracker from 'parser/shared/modules/AbilityTracker'; const TOUCH_OF_DEATH_HP_SCALING = 0.35; const GALE_BURST_VALUE = 0.1; class TouchOfDeath extends Analyzer { static dependencies = { enemies: Enemies, statTracker: StatTracker, abilityTracker: AbilityTracker, }; expectedBaseDamage = 0; expectedGaleBurst = 0; totalGaleBurst = 0; highestGaleBurst = 0; // Vulnerability amplifiers are target specific damage taken increases like seen on Kin'garoth adds. highestVulnerabilityAmplifier = 0; totalVulnerabilityAmplifier = 0; on_byPlayer_cast(event) { const spellId = event.ability.guid; if (SPELLS.TOUCH_OF_DEATH.id !== spellId) { return; } this.expectedGaleBurst = 0; const masteryPercentage = this.statTracker.currentMasteryPercentage; const versatilityPercentage = this.statTracker.currentVersatilityPercentage; this.expectedBaseDamage = (event.maxHitPoints * TOUCH_OF_DEATH_HP_SCALING) * (1 + masteryPercentage) * (1 + versatilityPercentage); } on_byPlayer_damage(event) { const spellId = event.ability.guid; const enemy = this.enemies.getEntity(event); // Gale Burst does not count damage from clones, but rather takes increased damage from the player while Storm, Earth, and Fire is active const sefMultiplier = this.selectedCombatant.hasBuff(SPELLS.STORM_EARTH_AND_FIRE_CAST.id) ? 3 * GALE_BURST_VALUE : GALE_BURST_VALUE; if (!enemy) { return; } if (enemy.hasBuff(SPELLS.TOUCH_OF_DEATH.id) && SPELLS.TOUCH_OF_DEATH_DAMAGE.id !== spellId) { this.expectedGaleBurst += (event.amount + (event.absorbed || 0)) * sefMultiplier; } if (SPELLS.TOUCH_OF_DEATH_DAMAGE.id !== spellId) { return; } const expectedTotalDamage = this.expectedGaleBurst + this.expectedBaseDamage; const vulnerabilityAmplifier = ((event.amount / expectedTotalDamage) - 1); if (vulnerabilityAmplifier > this.highestVulnerabilityAmplifier) { this.highestVulnerabilityAmplifier = vulnerabilityAmplifier; } const actualGaleBurst = this.expectedGaleBurst * (1 + vulnerabilityAmplifier); if (actualGaleBurst > this.highestGaleBurst) { this.highestGaleBurst = actualGaleBurst; } this.totalVulnerabilityAmplifier += vulnerabilityAmplifier; this.totalGaleBurst += actualGaleBurst; } statistic() { const averageVulnerabilityAmplifier = this.totalVulnerabilityAmplifier / this.abilityTracker.getAbility(SPELLS.TOUCH_OF_DEATH.id).casts; const averageGaleBurst = this.totalGaleBurst / this.abilityTracker.getAbility(SPELLS.TOUCH_OF_DEATH.id).casts; return ( <StatisticBox position={STATISTIC_ORDER.CORE(8)} icon={<SpellIcon id={SPELLS.TOUCH_OF_DEATH.id} />} value={(averageGaleBurst).toFixed(2)} label="Average Gale Burst" tooltip={( <> Damage done with Touch of Death is affected by % damage taken buffs on its target. This causes damage done by other abilities during the Gale burst window to benefit twice from those debuffs, due to the increase to their own hits as well as the Gale Burst component of Touch of Death . <br /> <br /> Your average modifier on Touch of Death was ~{(averageVulnerabilityAmplifier * 100).toFixed()}% and your highest was ~{(this.highestVulnerabilityAmplifier * 100).toFixed()}%. Your highest Gale Burst was {this.highestGaleBurst.toFixed()} </> )} /> ); } } export default TouchOfDeath;
Libraries/Renderer/src/renderers/native/ReactNativeTagHandles.js
htc2u/react-native
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactNativeTagHandles * @flow */ 'use strict'; var invariant = require('fbjs/lib/invariant'); /** * Keeps track of allocating and associating native "tags" which are numeric, * unique view IDs. All the native tags are negative numbers, to avoid * collisions, but in the JS we keep track of them as positive integers to store * them effectively in Arrays. So we must refer to them as "inverses" of the * native tags (that are * normally negative). * * It *must* be the case that every `rootNodeID` always maps to the exact same * `tag` forever. The easiest way to accomplish this is to never delete * anything from this table. * Why: Because `dangerouslyReplaceNodeWithMarkupByID` relies on being able to * unmount a component with a `rootNodeID`, then mount a new one in its place, */ var INITIAL_TAG_COUNT = 1; var ReactNativeTagHandles = { tagsStartAt: INITIAL_TAG_COUNT, tagCount: INITIAL_TAG_COUNT, allocateTag: function(): number { // Skip over root IDs as those are reserved for native while (this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)) { ReactNativeTagHandles.tagCount++; } var tag = ReactNativeTagHandles.tagCount; ReactNativeTagHandles.tagCount++; return tag; }, assertRootTag: function(tag: number): void { invariant( this.reactTagIsNativeTopRootID(tag), 'Expect a native root tag, instead got %s', tag ); }, reactTagIsNativeTopRootID: function(reactTag: number): boolean { // We reserve all tags that are 1 mod 10 for native root views return reactTag % 10 === 1; }, }; module.exports = ReactNativeTagHandles;
src/components/common/svg-icons/file/cloud-queue.js
abzfarah/Pearson.NAPLAN.GnomeH
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let FileCloudQueue = (props) => ( <SvgIcon {...props}> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h.71C7.37 7.69 9.48 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3s-1.34 3-3 3z"/> </SvgIcon> ); FileCloudQueue = pure(FileCloudQueue); FileCloudQueue.displayName = 'FileCloudQueue'; FileCloudQueue.muiName = 'SvgIcon'; export default FileCloudQueue;
examples/huge-apps/routes/Course/routes/Announcements/routes/Announcement/components/Announcement.js
yongxu/react-router
import React from 'react'; class Announcement extends React.Component { render () { var { courseId, announcementId } = this.props.params; var { title, body } = COURSES[courseId].announcements[announcementId]; return ( <div> <h4>{title}</h4> <p>{body}</p> </div> ); } } export default Announcement;
ajax/libs/remoteStorage/0.12.0/remotestorage.js
iamJoeTaylor/cdnjs
/** remotestorage.js 0.12.0, http://remotestorage.io, MIT-licensed **/ /** FILE: lib/bluebird.js **/ /** * bluebird build version 2.3.4 * Features enabled: core, nodeify * Features disabled: race, call_get, generators, map, promisify, props, reduce, settle, some, progress, cancel, using, filter, any, each, timers */ /** * @preserve Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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(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.Promise=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<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 schedule = _dereq_("./schedule.js"); var Queue = _dereq_("./queue.js"); var errorObj = _dereq_("./util.js").errorObj; var tryCatch1 = _dereq_("./util.js").tryCatch1; var _process = typeof process !== "undefined" ? process : void 0; function Async() { this._isTickUsed = false; this._schedule = schedule; this._length = 0; this._lateBuffer = new Queue(16); this._functionBuffer = new Queue(65536); var self = this; this.consumeFunctionBuffer = function Async$consumeFunctionBuffer() { self._consumeFunctionBuffer(); }; } Async.prototype.haveItemsQueued = function Async$haveItemsQueued() { return this._length > 0; }; Async.prototype.invokeLater = function Async$invokeLater(fn, receiver, arg) { if (_process !== void 0 && _process.domain != null && !fn.domain) { fn = _process.domain.bind(fn); } this._lateBuffer.push(fn, receiver, arg); this._queueTick(); }; Async.prototype.invoke = function Async$invoke(fn, receiver, arg) { if (_process !== void 0 && _process.domain != null && !fn.domain) { fn = _process.domain.bind(fn); } var functionBuffer = this._functionBuffer; functionBuffer.push(fn, receiver, arg); this._length = functionBuffer.length(); this._queueTick(); }; Async.prototype._consumeFunctionBuffer = function Async$_consumeFunctionBuffer() { var functionBuffer = this._functionBuffer; while (functionBuffer.length() > 0) { var fn = functionBuffer.shift(); var receiver = functionBuffer.shift(); var arg = functionBuffer.shift(); fn.call(receiver, arg); } this._reset(); this._consumeLateBuffer(); }; Async.prototype._consumeLateBuffer = function Async$_consumeLateBuffer() { var buffer = this._lateBuffer; while(buffer.length() > 0) { var fn = buffer.shift(); var receiver = buffer.shift(); var arg = buffer.shift(); var res = tryCatch1(fn, receiver, arg); if (res === errorObj) { this._queueTick(); if (fn.domain != null) { fn.domain.emit("error", res.e); } else { throw res.e; } } } }; Async.prototype._queueTick = function Async$_queue() { if (!this._isTickUsed) { this._schedule(this.consumeFunctionBuffer); this._isTickUsed = true; } }; Async.prototype._reset = function Async$_reset() { this._isTickUsed = false; this._length = 0; }; module.exports = new Async(); },{"./queue.js":15,"./schedule.js":16,"./util.js":19}],2:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 Promise = _dereq_("./promise.js")(); module.exports = Promise; },{"./promise.js":12}],3:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function() { var inherits = _dereq_("./util.js").inherits; var defineProperty = _dereq_("./es5.js").defineProperty; var rignore = new RegExp( "\\b(?:[a-zA-Z0-9.]+\\$_\\w+|" + "tryCatch(?:1|2|3|4|Apply)|new \\w*PromiseArray|" + "\\w*PromiseArray\\.\\w*PromiseArray|" + "setTimeout|CatchFilter\\$_\\w+|makeNodePromisified|processImmediate|" + "process._tickCallback|nextTick|Async\\$\\w+)\\b" ); var rtraceline = null; var formatStack = null; function formatNonError(obj) { var str; if (typeof obj === "function") { str = "[function " + (obj.name || "anonymous") + "]"; } else { str = obj.toString(); var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; if (ruselessToString.test(str)) { try { var newStr = JSON.stringify(obj); str = newStr; } catch(e) { } } if (str.length === 0) { str = "(empty array)"; } } return ("(<" + snip(str) + ">, no stack trace)"); } function snip(str) { var maxChars = 41; if (str.length < maxChars) { return str; } return str.substr(0, maxChars - 3) + "..."; } function CapturedTrace(ignoreUntil, isTopLevel) { this.captureStackTrace(CapturedTrace, isTopLevel); } inherits(CapturedTrace, Error); CapturedTrace.prototype.captureStackTrace = function CapturedTrace$captureStackTrace(ignoreUntil, isTopLevel) { captureStackTrace(this, ignoreUntil, isTopLevel); }; CapturedTrace.possiblyUnhandledRejection = function CapturedTrace$PossiblyUnhandledRejection(reason) { if (typeof console === "object") { var message; if (typeof reason === "object" || typeof reason === "function") { var stack = reason.stack; message = "Possibly unhandled " + formatStack(stack, reason); } else { message = "Possibly unhandled " + String(reason); } if (typeof console.error === "function" || typeof console.error === "object") { console.error(message); } else if (typeof console.log === "function" || typeof console.log === "object") { console.log(message); } } }; CapturedTrace.combine = function CapturedTrace$Combine(current, prev) { var curLast = current.length - 1; for (var i = prev.length - 1; i >= 0; --i) { var line = prev[i]; if (current[curLast] === line) { current.pop(); curLast--; } else { break; } } current.push("From previous event:"); var lines = current.concat(prev); var ret = []; for (var i = 0, len = lines.length; i < len; ++i) { if (((rignore.test(lines[i]) && rtraceline.test(lines[i])) || (i > 0 && !rtraceline.test(lines[i])) && lines[i] !== "From previous event:") ) { continue; } ret.push(lines[i]); } return ret; }; CapturedTrace.protectErrorMessageNewlines = function(stack) { for (var i = 0; i < stack.length; ++i) { if (rtraceline.test(stack[i])) { break; } } if (i <= 1) return; var errorMessageLines = []; for (var j = 0; j < i; ++j) { errorMessageLines.push(stack.shift()); } stack.unshift(errorMessageLines.join("\u0002\u0000\u0001")); }; CapturedTrace.isSupported = function CapturedTrace$IsSupported() { return typeof captureStackTrace === "function"; }; var captureStackTrace = (function stackDetection() { if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") { rtraceline = /^\s*at\s*/; formatStack = function(stack, error) { if (typeof stack === "string") return stack; if (error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; var captureStackTrace = Error.captureStackTrace; return function CapturedTrace$_captureStackTrace( receiver, ignoreUntil) { captureStackTrace(receiver, ignoreUntil); }; } var err = new Error(); if (typeof err.stack === "string" && typeof "".startsWith === "function" && (err.stack.startsWith("stackDetection@")) && stackDetection.name === "stackDetection") { defineProperty(Error, "stackTraceLimit", { writable: true, enumerable: false, configurable: false, value: 25 }); rtraceline = /@/; var rline = /[@\n]/; formatStack = function(stack, error) { if (typeof stack === "string") { return (error.name + ". " + error.message + "\n" + stack); } if (error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; return function captureStackTrace(o) { var stack = new Error().stack; var split = stack.split(rline); var len = split.length; var ret = ""; for (var i = 0; i < len; i += 2) { ret += split[i]; ret += "@"; ret += split[i + 1]; ret += "\n"; } o.stack = ret; }; } else { formatStack = function(stack, error) { if (typeof stack === "string") return stack; if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; return null; } })(); return CapturedTrace; }; },{"./es5.js":8,"./util.js":19}],4:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(NEXT_FILTER) { var util = _dereq_("./util.js"); var errors = _dereq_("./errors.js"); var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; var keys = _dereq_("./es5.js").keys; var TypeError = errors.TypeError; function CatchFilter(instances, callback, promise) { this._instances = instances; this._callback = callback; this._promise = promise; } function CatchFilter$_safePredicate(predicate, e) { var safeObject = {}; var retfilter = tryCatch1(predicate, safeObject, e); if (retfilter === errorObj) return retfilter; var safeKeys = keys(safeObject); if (safeKeys.length) { errorObj.e = new TypeError( "Catch filter must inherit from Error " + "or be a simple predicate function"); return errorObj; } return retfilter; } CatchFilter.prototype.doFilter = function CatchFilter$_doFilter(e) { var cb = this._callback; var promise = this._promise; var boundTo = promise._boundTo; for (var i = 0, len = this._instances.length; i < len; ++i) { var item = this._instances[i]; var itemIsErrorType = item === Error || (item != null && item.prototype instanceof Error); if (itemIsErrorType && e instanceof item) { var ret = tryCatch1(cb, boundTo, e); if (ret === errorObj) { NEXT_FILTER.e = ret.e; return NEXT_FILTER; } return ret; } else if (typeof item === "function" && !itemIsErrorType) { var shouldHandle = CatchFilter$_safePredicate(item, e); if (shouldHandle === errorObj) { var trace = errors.canAttach(errorObj.e) ? errorObj.e : new Error(errorObj.e + ""); this._promise._attachExtraTrace(trace); e = errorObj.e; break; } else if (shouldHandle) { var ret = tryCatch1(cb, boundTo, e); if (ret === errorObj) { NEXT_FILTER.e = ret.e; return NEXT_FILTER; } return ret; } } } NEXT_FILTER.e = e; return NEXT_FILTER; }; return CatchFilter; }; },{"./errors.js":6,"./es5.js":8,"./util.js":19}],5:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 util = _dereq_("./util.js"); var isPrimitive = util.isPrimitive; var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver; module.exports = function(Promise) { var returner = function Promise$_returner() { return this; }; var thrower = function Promise$_thrower() { throw this; }; var wrapper = function Promise$_wrapper(value, action) { if (action === 1) { return function Promise$_thrower() { throw value; }; } else if (action === 2) { return function Promise$_returner() { return value; }; } }; Promise.prototype["return"] = Promise.prototype.thenReturn = function Promise$thenReturn(value) { if (wrapsPrimitiveReceiver && isPrimitive(value)) { return this._then( wrapper(value, 2), void 0, void 0, void 0, void 0 ); } return this._then(returner, void 0, void 0, value, void 0); }; Promise.prototype["throw"] = Promise.prototype.thenThrow = function Promise$thenThrow(reason) { if (wrapsPrimitiveReceiver && isPrimitive(reason)) { return this._then( wrapper(reason, 1), void 0, void 0, void 0, void 0 ); } return this._then(thrower, void 0, void 0, reason, void 0); }; }; },{"./util.js":19}],6:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 Objectfreeze = _dereq_("./es5.js").freeze; var util = _dereq_("./util.js"); var inherits = util.inherits; var notEnumerableProp = util.notEnumerableProp; function markAsOriginatingFromRejection(e) { try { notEnumerableProp(e, "isOperational", true); } catch(ignore) {} } function originatesFromRejection(e) { if (e == null) return false; return ((e instanceof OperationalError) || e["isOperational"] === true); } function isError(obj) { return obj instanceof Error; } function canAttach(obj) { return isError(obj); } function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); this.message = typeof message === "string" ? message : defaultMessage; this.name = nameProperty; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits(SubError, Error); return SubError; } var _TypeError, _RangeError; var CancellationError = subError("CancellationError", "cancellation error"); var TimeoutError = subError("TimeoutError", "timeout error"); var AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError; _RangeError = RangeError; } catch(e) { _TypeError = subError("TypeError", "type error"); _RangeError = subError("RangeError", "range error"); } var methods = ("join pop push shift unshift slice filter forEach some " + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); for (var i = 0; i < methods.length; ++i) { if (typeof Array.prototype[methods[i]] === "function") { AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; } } AggregateError.prototype.length = 0; AggregateError.prototype["isOperational"] = true; var level = 0; AggregateError.prototype.toString = function() { var indent = Array(level * 4 + 1).join(" "); var ret = "\n" + indent + "AggregateError of:" + "\n"; level++; indent = Array(level * 4 + 1).join(" "); for (var i = 0; i < this.length; ++i) { var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; var lines = str.split("\n"); for (var j = 0; j < lines.length; ++j) { lines[j] = indent + lines[j]; } str = lines.join("\n"); ret += str + "\n"; } level--; return ret; }; function OperationalError(message) { this.name = "OperationalError"; this.message = message; this.cause = message; this["isOperational"] = true; if (message instanceof Error) { this.message = message.message; this.stack = message.stack; } else if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits(OperationalError, Error); var key = "__BluebirdErrorTypes__"; var errorTypes = Error[key]; if (!errorTypes) { errorTypes = Objectfreeze({ CancellationError: CancellationError, TimeoutError: TimeoutError, OperationalError: OperationalError, RejectionError: OperationalError, AggregateError: AggregateError }); notEnumerableProp(Error, key, errorTypes); } module.exports = { Error: Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, originatesFromRejection: originatesFromRejection, markAsOriginatingFromRejection: markAsOriginatingFromRejection, canAttach: canAttach }; },{"./es5.js":8,"./util.js":19}],7:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise) { var TypeError = _dereq_('./errors.js').TypeError; function apiRejection(msg) { var error = new TypeError(msg); var ret = Promise.rejected(error); var parent = ret._peekContext(); if (parent != null) { parent._attachExtraTrace(error); } return ret; } return apiRejection; }; },{"./errors.js":6}],8:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 isES5 = (function(){ "use strict"; return this === void 0; })(); if (isES5) { module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, keys: Object.keys, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5 }; } else { var has = {}.hasOwnProperty; var str = {}.toString; var proto = {}.constructor.prototype; var ObjectKeys = function ObjectKeys(o) { var ret = []; for (var key in o) { if (has.call(o, key)) { ret.push(key); } } return ret; } var ObjectDefineProperty = function ObjectDefineProperty(o, key, desc) { o[key] = desc.value; return o; } var ObjectFreeze = function ObjectFreeze(obj) { return obj; } var ObjectGetPrototypeOf = function ObjectGetPrototypeOf(obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } } var ArrayIsArray = function ArrayIsArray(obj) { try { return str.call(obj) === "[object Array]"; } catch(e) { return false; } } module.exports = { isArray: ArrayIsArray, keys: ObjectKeys, defineProperty: ObjectDefineProperty, freeze: ObjectFreeze, getPrototypeOf: ObjectGetPrototypeOf, isES5: isES5 }; } },{}],9:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise, NEXT_FILTER, cast) { var util = _dereq_("./util.js"); var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver; var isPrimitive = util.isPrimitive; var thrower = util.thrower; function returnThis() { return this; } function throwThis() { throw this; } function return$(r) { return function Promise$_returner() { return r; }; } function throw$(r) { return function Promise$_thrower() { throw r; }; } function promisedFinally(ret, reasonOrValue, isFulfilled) { var then; if (wrapsPrimitiveReceiver && isPrimitive(reasonOrValue)) { then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); } else { then = isFulfilled ? returnThis : throwThis; } return ret._then(then, thrower, void 0, reasonOrValue, void 0); } function finallyHandler(reasonOrValue) { var promise = this.promise; var handler = this.handler; var ret = promise._isBound() ? handler.call(promise._boundTo) : handler(); if (ret !== void 0) { var maybePromise = cast(ret, void 0); if (maybePromise instanceof Promise) { return promisedFinally(maybePromise, reasonOrValue, promise.isFulfilled()); } } if (promise.isRejected()) { NEXT_FILTER.e = reasonOrValue; return NEXT_FILTER; } else { return reasonOrValue; } } function tapHandler(value) { var promise = this.promise; var handler = this.handler; var ret = promise._isBound() ? handler.call(promise._boundTo, value) : handler(value); if (ret !== void 0) { var maybePromise = cast(ret, void 0); if (maybePromise instanceof Promise) { return promisedFinally(maybePromise, value, true); } } return value; } Promise.prototype._passThroughHandler = function Promise$_passThroughHandler(handler, isFinally) { if (typeof handler !== "function") return this.then(); var promiseAndHandler = { promise: this, handler: handler }; return this._then( isFinally ? finallyHandler : tapHandler, isFinally ? finallyHandler : void 0, void 0, promiseAndHandler, void 0); }; Promise.prototype.lastly = Promise.prototype["finally"] = function Promise$finally(handler) { return this._passThroughHandler(handler, true); }; Promise.prototype.tap = function Promise$tap(handler) { return this._passThroughHandler(handler, false); }; }; },{"./util.js":19}],10:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise, PromiseArray, cast, INTERNAL) { var util = _dereq_("./util.js"); var canEvaluate = util.canEvaluate; var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; if (canEvaluate) { var thenCallback = function(i) { return new Function("value", "holder", " \n\ 'use strict'; \n\ holder.pIndex = value; \n\ holder.checkFulfillment(this); \n\ ".replace(/Index/g, i)); }; var caller = function(count) { var values = []; for (var i = 1; i <= count; ++i) values.push("holder.p" + i); return new Function("holder", " \n\ 'use strict'; \n\ var callback = holder.fn; \n\ return callback(values); \n\ ".replace(/values/g, values.join(", "))); }; var thenCallbacks = []; var callers = [void 0]; for (var i = 1; i <= 5; ++i) { thenCallbacks.push(thenCallback(i)); callers.push(caller(i)); } var Holder = function(total, fn) { this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; this.fn = fn; this.total = total; this.now = 0; }; Holder.prototype.callers = callers; Holder.prototype.checkFulfillment = function(promise) { var now = this.now; now++; var total = this.total; if (now >= total) { var handler = this.callers[total]; var ret = tryCatch1(handler, void 0, this); if (ret === errorObj) { promise._rejectUnchecked(ret.e); } else if (!promise._tryFollow(ret)) { promise._fulfillUnchecked(ret); } } else { this.now = now; } }; } Promise.join = function Promise$Join() { var last = arguments.length - 1; var fn; if (last > 0 && typeof arguments[last] === "function") { fn = arguments[last]; if (last < 6 && canEvaluate) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); var holder = new Holder(last, fn); var reject = ret._reject; var callbacks = thenCallbacks; for (var i = 0; i < last; ++i) { var maybePromise = cast(arguments[i], void 0); if (maybePromise instanceof Promise) { if (maybePromise.isPending()) { maybePromise._then(callbacks[i], reject, void 0, ret, holder); } else if (maybePromise.isFulfilled()) { callbacks[i].call(ret, maybePromise._settledValue, holder); } else { ret._reject(maybePromise._settledValue); maybePromise._unsetRejectionIsUnhandled(); } } else { callbacks[i].call(ret, maybePromise, holder); } } return ret; } } var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} var ret = new PromiseArray(args).promise(); return fn !== void 0 ? ret.spread(fn) : ret; }; }; },{"./util.js":19}],11:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise) { var util = _dereq_("./util.js"); var async = _dereq_("./async.js"); var tryCatch2 = util.tryCatch2; var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; function thrower(r) { throw r; } function Promise$_spreadAdapter(val, receiver) { if (!util.isArray(val)) return Promise$_successAdapter(val, receiver); var ret = util.tryCatchApply(this, [null].concat(val), receiver); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } function Promise$_successAdapter(val, receiver) { var nodeback = this; var ret = val === void 0 ? tryCatch1(nodeback, receiver, null) : tryCatch2(nodeback, receiver, null, val); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } function Promise$_errorAdapter(reason, receiver) { var nodeback = this; var ret = tryCatch1(nodeback, receiver, reason); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } Promise.prototype.nodeify = function Promise$nodeify(nodeback, options) { if (typeof nodeback == "function") { var adapter = Promise$_successAdapter; if (options !== void 0 && Object(options).spread) { adapter = Promise$_spreadAdapter; } this._then( adapter, Promise$_errorAdapter, void 0, nodeback, this._boundTo ); } return this; }; }; },{"./async.js":1,"./util.js":19}],12:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 old; if (typeof Promise !== "undefined") old = Promise; function noConflict(bluebird) { try { if (Promise === bluebird) Promise = old; } catch (e) {} return bluebird; } module.exports = function() { var util = _dereq_("./util.js"); var async = _dereq_("./async.js"); var errors = _dereq_("./errors.js"); var INTERNAL = function(){}; var APPLY = {}; var NEXT_FILTER = {e: null}; var cast = _dereq_("./thenables.js")(Promise, INTERNAL); var PromiseArray = _dereq_("./promise_array.js")(Promise, INTERNAL, cast); var CapturedTrace = _dereq_("./captured_trace.js")(); var CatchFilter = _dereq_("./catch_filter.js")(NEXT_FILTER); var PromiseResolver = _dereq_("./promise_resolver.js"); var isArray = util.isArray; var errorObj = util.errorObj; var tryCatch1 = util.tryCatch1; var tryCatch2 = util.tryCatch2; var tryCatchApply = util.tryCatchApply; var RangeError = errors.RangeError; var TypeError = errors.TypeError; var CancellationError = errors.CancellationError; var TimeoutError = errors.TimeoutError; var OperationalError = errors.OperationalError; var originatesFromRejection = errors.originatesFromRejection; var markAsOriginatingFromRejection = errors.markAsOriginatingFromRejection; var canAttach = errors.canAttach; var thrower = util.thrower; var apiRejection = _dereq_("./errors_api_rejection")(Promise); var makeSelfResolutionError = function Promise$_makeSelfResolutionError() { return new TypeError("circular promise resolution chain"); }; function Promise(resolver) { if (typeof resolver !== "function") { throw new TypeError("the promise constructor requires a resolver function"); } if (this.constructor !== Promise) { throw new TypeError("the promise constructor cannot be invoked directly"); } this._bitField = 0; this._fulfillmentHandler0 = void 0; this._rejectionHandler0 = void 0; this._promise0 = void 0; this._receiver0 = void 0; this._settledValue = void 0; this._boundTo = void 0; if (resolver !== INTERNAL) this._resolveFromResolver(resolver); } function returnFirstElement(elements) { return elements[0]; } Promise.prototype.bind = function Promise$bind(thisArg) { var maybePromise = cast(thisArg, void 0); var ret = new Promise(INTERNAL); if (maybePromise instanceof Promise) { var binder = maybePromise.then(function(thisArg) { ret._setBoundTo(thisArg); }); var p = Promise.all([this, binder]).then(returnFirstElement); ret._follow(p); } else { ret._follow(this); ret._setBoundTo(thisArg); } ret._propagateFrom(this, 2 | 1); return ret; }; Promise.prototype.toString = function Promise$toString() { return "[object Promise]"; }; Promise.prototype.caught = Promise.prototype["catch"] = function Promise$catch(fn) { var len = arguments.length; if (len > 1) { var catchInstances = new Array(len - 1), j = 0, i; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (typeof item === "function") { catchInstances[j++] = item; } else { var catchFilterTypeError = new TypeError( "A catch filter must be an error constructor " + "or a filter function"); this._attachExtraTrace(catchFilterTypeError); return Promise.reject(catchFilterTypeError); } } catchInstances.length = j; fn = arguments[i]; this._resetTrace(); var catchFilter = new CatchFilter(catchInstances, fn, this); return this._then(void 0, catchFilter.doFilter, void 0, catchFilter, void 0); } return this._then(void 0, fn, void 0, void 0, void 0); }; Promise.prototype.then = function Promise$then(didFulfill, didReject, didProgress) { return this._then(didFulfill, didReject, didProgress, void 0, void 0); }; Promise.prototype.done = function Promise$done(didFulfill, didReject, didProgress) { var promise = this._then(didFulfill, didReject, didProgress, void 0, void 0); promise._setIsFinal(); }; Promise.prototype.spread = function Promise$spread(didFulfill, didReject) { return this._then(didFulfill, didReject, void 0, APPLY, void 0); }; Promise.prototype.isCancellable = function Promise$isCancellable() { return !this.isResolved() && this._cancellable(); }; Promise.prototype.toJSON = function Promise$toJSON() { var ret = { isFulfilled: false, isRejected: false, fulfillmentValue: void 0, rejectionReason: void 0 }; if (this.isFulfilled()) { ret.fulfillmentValue = this._settledValue; ret.isFulfilled = true; } else if (this.isRejected()) { ret.rejectionReason = this._settledValue; ret.isRejected = true; } return ret; }; Promise.prototype.all = function Promise$all() { return new PromiseArray(this).promise(); }; Promise.is = function Promise$Is(val) { return val instanceof Promise; }; Promise.all = function Promise$All(promises) { return new PromiseArray(promises).promise(); }; Promise.prototype.error = function Promise$_error(fn) { return this.caught(originatesFromRejection, fn); }; Promise.prototype._resolveFromSyncValue = function Promise$_resolveFromSyncValue(value) { if (value === errorObj) { this._cleanValues(); this._setRejected(); this._settledValue = value.e; this._ensurePossibleRejectionHandled(); } else { var maybePromise = cast(value, void 0); if (maybePromise instanceof Promise) { this._follow(maybePromise); } else { this._cleanValues(); this._setFulfilled(); this._settledValue = value; } } }; Promise.method = function Promise$_Method(fn) { if (typeof fn !== "function") { throw new TypeError("fn must be a function"); } return function Promise$_method() { var value; switch(arguments.length) { case 0: value = tryCatch1(fn, this, void 0); break; case 1: value = tryCatch1(fn, this, arguments[0]); break; case 2: value = tryCatch2(fn, this, arguments[0], arguments[1]); break; default: var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} value = tryCatchApply(fn, args, this); break; } var ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._resolveFromSyncValue(value); return ret; }; }; Promise.attempt = Promise["try"] = function Promise$_Try(fn, args, ctx) { if (typeof fn !== "function") { return apiRejection("fn must be a function"); } var value = isArray(args) ? tryCatchApply(fn, args, ctx) : tryCatch1(fn, ctx, args); var ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._resolveFromSyncValue(value); return ret; }; Promise.defer = Promise.pending = function Promise$Defer() { var promise = new Promise(INTERNAL); promise._setTrace(void 0); return new PromiseResolver(promise); }; Promise.bind = function Promise$Bind(thisArg) { var maybePromise = cast(thisArg, void 0); var ret = new Promise(INTERNAL); ret._setTrace(void 0); if (maybePromise instanceof Promise) { var p = maybePromise.then(function(thisArg) { ret._setBoundTo(thisArg); }); ret._follow(p); } else { ret._setBoundTo(thisArg); ret._setFulfilled(); } return ret; }; Promise.cast = function Promise$_Cast(obj) { var ret = cast(obj, void 0); if (!(ret instanceof Promise)) { var val = ret; ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._setFulfilled(); ret._cleanValues(); ret._settledValue = val; } return ret; }; Promise.resolve = Promise.fulfilled = Promise.cast; Promise.reject = Promise.rejected = function Promise$Reject(reason) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); markAsOriginatingFromRejection(reason); ret._cleanValues(); ret._setRejected(); ret._settledValue = reason; if (!canAttach(reason)) { var trace = new Error(reason + ""); ret._setCarriedStackTrace(trace); } ret._ensurePossibleRejectionHandled(); return ret; }; Promise.onPossiblyUnhandledRejection = function Promise$OnPossiblyUnhandledRejection(fn) { CapturedTrace.possiblyUnhandledRejection = typeof fn === "function" ? fn : void 0; }; var unhandledRejectionHandled; Promise.onUnhandledRejectionHandled = function Promise$onUnhandledRejectionHandled(fn) { unhandledRejectionHandled = typeof fn === "function" ? fn : void 0; }; var debugging = false || !!( typeof process !== "undefined" && typeof process.execPath === "string" && typeof process.env === "object" && (process.env["BLUEBIRD_DEBUG"] || process.env["NODE_ENV"] === "development") ); Promise.longStackTraces = function Promise$LongStackTraces() { if (async.haveItemsQueued() && debugging === false ) { throw new Error("cannot enable long stack traces after promises have been created"); } debugging = CapturedTrace.isSupported(); }; Promise.hasLongStackTraces = function Promise$HasLongStackTraces() { return debugging && CapturedTrace.isSupported(); }; Promise.prototype._then = function Promise$_then( didFulfill, didReject, didProgress, receiver, internalData ) { var haveInternalData = internalData !== void 0; var ret = haveInternalData ? internalData : new Promise(INTERNAL); if (!haveInternalData) { if (debugging) { var haveSameContext = this._peekContext() === this._traceParent; ret._traceParent = haveSameContext ? this._traceParent : this; } ret._propagateFrom(this, 7); } var callbackIndex = this._addCallbacks(didFulfill, didReject, didProgress, ret, receiver); if (this.isResolved()) { async.invoke(this._queueSettleAt, this, callbackIndex); } return ret; }; Promise.prototype._length = function Promise$_length() { return this._bitField & 262143; }; Promise.prototype._isFollowingOrFulfilledOrRejected = function Promise$_isFollowingOrFulfilledOrRejected() { return (this._bitField & 939524096) > 0; }; Promise.prototype._isFollowing = function Promise$_isFollowing() { return (this._bitField & 536870912) === 536870912; }; Promise.prototype._setLength = function Promise$_setLength(len) { this._bitField = (this._bitField & -262144) | (len & 262143); }; Promise.prototype._setFulfilled = function Promise$_setFulfilled() { this._bitField = this._bitField | 268435456; }; Promise.prototype._setRejected = function Promise$_setRejected() { this._bitField = this._bitField | 134217728; }; Promise.prototype._setFollowing = function Promise$_setFollowing() { this._bitField = this._bitField | 536870912; }; Promise.prototype._setIsFinal = function Promise$_setIsFinal() { this._bitField = this._bitField | 33554432; }; Promise.prototype._isFinal = function Promise$_isFinal() { return (this._bitField & 33554432) > 0; }; Promise.prototype._cancellable = function Promise$_cancellable() { return (this._bitField & 67108864) > 0; }; Promise.prototype._setCancellable = function Promise$_setCancellable() { this._bitField = this._bitField | 67108864; }; Promise.prototype._unsetCancellable = function Promise$_unsetCancellable() { this._bitField = this._bitField & (~67108864); }; Promise.prototype._setRejectionIsUnhandled = function Promise$_setRejectionIsUnhandled() { this._bitField = this._bitField | 2097152; }; Promise.prototype._unsetRejectionIsUnhandled = function Promise$_unsetRejectionIsUnhandled() { this._bitField = this._bitField & (~2097152); if (this._isUnhandledRejectionNotified()) { this._unsetUnhandledRejectionIsNotified(); this._notifyUnhandledRejectionIsHandled(); } }; Promise.prototype._isRejectionUnhandled = function Promise$_isRejectionUnhandled() { return (this._bitField & 2097152) > 0; }; Promise.prototype._setUnhandledRejectionIsNotified = function Promise$_setUnhandledRejectionIsNotified() { this._bitField = this._bitField | 524288; }; Promise.prototype._unsetUnhandledRejectionIsNotified = function Promise$_unsetUnhandledRejectionIsNotified() { this._bitField = this._bitField & (~524288); }; Promise.prototype._isUnhandledRejectionNotified = function Promise$_isUnhandledRejectionNotified() { return (this._bitField & 524288) > 0; }; Promise.prototype._setCarriedStackTrace = function Promise$_setCarriedStackTrace(capturedTrace) { this._bitField = this._bitField | 1048576; this._fulfillmentHandler0 = capturedTrace; }; Promise.prototype._unsetCarriedStackTrace = function Promise$_unsetCarriedStackTrace() { this._bitField = this._bitField & (~1048576); this._fulfillmentHandler0 = void 0; }; Promise.prototype._isCarryingStackTrace = function Promise$_isCarryingStackTrace() { return (this._bitField & 1048576) > 0; }; Promise.prototype._getCarriedStackTrace = function Promise$_getCarriedStackTrace() { return this._isCarryingStackTrace() ? this._fulfillmentHandler0 : void 0; }; Promise.prototype._receiverAt = function Promise$_receiverAt(index) { var ret = index === 0 ? this._receiver0 : this[(index << 2) + index - 5 + 4]; if (this._isBound() && ret === void 0) { return this._boundTo; } return ret; }; Promise.prototype._promiseAt = function Promise$_promiseAt(index) { return index === 0 ? this._promise0 : this[(index << 2) + index - 5 + 3]; }; Promise.prototype._fulfillmentHandlerAt = function Promise$_fulfillmentHandlerAt(index) { return index === 0 ? this._fulfillmentHandler0 : this[(index << 2) + index - 5 + 0]; }; Promise.prototype._rejectionHandlerAt = function Promise$_rejectionHandlerAt(index) { return index === 0 ? this._rejectionHandler0 : this[(index << 2) + index - 5 + 1]; }; Promise.prototype._addCallbacks = function Promise$_addCallbacks( fulfill, reject, progress, promise, receiver ) { var index = this._length(); if (index >= 262143 - 5) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promise; if (receiver !== void 0) this._receiver0 = receiver; if (typeof fulfill === "function" && !this._isCarryingStackTrace()) this._fulfillmentHandler0 = fulfill; if (typeof reject === "function") this._rejectionHandler0 = reject; if (typeof progress === "function") this._progressHandler0 = progress; } else { var base = (index << 2) + index - 5; this[base + 3] = promise; this[base + 4] = receiver; this[base + 0] = typeof fulfill === "function" ? fulfill : void 0; this[base + 1] = typeof reject === "function" ? reject : void 0; this[base + 2] = typeof progress === "function" ? progress : void 0; } this._setLength(index + 1); return index; }; Promise.prototype._setProxyHandlers = function Promise$_setProxyHandlers(receiver, promiseSlotValue) { var index = this._length(); if (index >= 262143 - 5) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promiseSlotValue; this._receiver0 = receiver; } else { var base = (index << 2) + index - 5; this[base + 3] = promiseSlotValue; this[base + 4] = receiver; this[base + 0] = this[base + 1] = this[base + 2] = void 0; } this._setLength(index + 1); }; Promise.prototype._proxyPromiseArray = function Promise$_proxyPromiseArray(promiseArray, index) { this._setProxyHandlers(promiseArray, index); }; Promise.prototype._proxyPromise = function Promise$_proxyPromise(promise) { promise._setProxied(); this._setProxyHandlers(promise, -15); }; Promise.prototype._setBoundTo = function Promise$_setBoundTo(obj) { if (obj !== void 0) { this._bitField = this._bitField | 8388608; this._boundTo = obj; } else { this._bitField = this._bitField & (~8388608); } }; Promise.prototype._isBound = function Promise$_isBound() { return (this._bitField & 8388608) === 8388608; }; Promise.prototype._resolveFromResolver = function Promise$_resolveFromResolver(resolver) { var promise = this; this._setTrace(void 0); this._pushContext(); function Promise$_resolver(val) { if (promise._tryFollow(val)) { return; } promise._fulfill(val); } function Promise$_rejecter(val) { var trace = canAttach(val) ? val : new Error(val + ""); promise._attachExtraTrace(trace); markAsOriginatingFromRejection(val); promise._reject(val, trace === val ? void 0 : trace); } var r = tryCatch2(resolver, void 0, Promise$_resolver, Promise$_rejecter); this._popContext(); if (r !== void 0 && r === errorObj) { var e = r.e; var trace = canAttach(e) ? e : new Error(e + ""); promise._reject(e, trace); } }; Promise.prototype._spreadSlowCase = function Promise$_spreadSlowCase(targetFn, promise, values, boundTo) { var promiseForAll = new PromiseArray(values).promise(); var promise2 = promiseForAll._then(function() { return targetFn.apply(boundTo, arguments); }, void 0, void 0, APPLY, void 0); promise._follow(promise2); }; Promise.prototype._callSpread = function Promise$_callSpread(handler, promise, value) { var boundTo = this._boundTo; if (isArray(value)) { for (var i = 0, len = value.length; i < len; ++i) { if (cast(value[i], void 0) instanceof Promise) { this._spreadSlowCase(handler, promise, value, boundTo); return; } } } promise._pushContext(); return tryCatchApply(handler, value, boundTo); }; Promise.prototype._callHandler = function Promise$_callHandler( handler, receiver, promise, value) { var x; if (receiver === APPLY && !this.isRejected()) { x = this._callSpread(handler, promise, value); } else { promise._pushContext(); x = tryCatch1(handler, receiver, value); } promise._popContext(); return x; }; Promise.prototype._settlePromiseFromHandler = function Promise$_settlePromiseFromHandler( handler, receiver, value, promise ) { if (!(promise instanceof Promise)) { handler.call(receiver, value, promise); return; } var x = this._callHandler(handler, receiver, promise, value); if (promise._isFollowing()) return; if (x === errorObj || x === promise || x === NEXT_FILTER) { var err = x === promise ? makeSelfResolutionError() : x.e; var trace = canAttach(err) ? err : new Error(err + ""); if (x !== NEXT_FILTER) promise._attachExtraTrace(trace); promise._rejectUnchecked(err, trace); } else { var castValue = cast(x, promise); if (castValue instanceof Promise) { if (castValue.isRejected() && !castValue._isCarryingStackTrace() && !canAttach(castValue._settledValue)) { var trace = new Error(castValue._settledValue + ""); promise._attachExtraTrace(trace); castValue._setCarriedStackTrace(trace); } promise._follow(castValue); promise._propagateFrom(castValue, 1); } else { promise._fulfillUnchecked(x); } } }; Promise.prototype._follow = function Promise$_follow(promise) { this._setFollowing(); if (promise.isPending()) { this._propagateFrom(promise, 1); promise._proxyPromise(this); } else if (promise.isFulfilled()) { this._fulfillUnchecked(promise._settledValue); } else { this._rejectUnchecked(promise._settledValue, promise._getCarriedStackTrace()); } if (promise._isRejectionUnhandled()) promise._unsetRejectionIsUnhandled(); if (debugging && promise._traceParent == null) { promise._traceParent = this; } }; Promise.prototype._tryFollow = function Promise$_tryFollow(value) { if (this._isFollowingOrFulfilledOrRejected() || value === this) { return false; } var maybePromise = cast(value, void 0); if (!(maybePromise instanceof Promise)) { return false; } this._follow(maybePromise); return true; }; Promise.prototype._resetTrace = function Promise$_resetTrace() { if (debugging) { this._trace = new CapturedTrace(this._peekContext() === void 0); } }; Promise.prototype._setTrace = function Promise$_setTrace(parent) { if (debugging) { var context = this._peekContext(); this._traceParent = context; var isTopLevel = context === void 0; if (parent !== void 0 && parent._traceParent === context) { this._trace = parent._trace; } else { this._trace = new CapturedTrace(isTopLevel); } } return this; }; Promise.prototype._attachExtraTrace = function Promise$_attachExtraTrace(error) { if (debugging) { var promise = this; var stack = error.stack; stack = typeof stack === "string" ? stack.split("\n") : []; CapturedTrace.protectErrorMessageNewlines(stack); var headerLineCount = 1; var combinedTraces = 1; while(promise != null && promise._trace != null) { stack = CapturedTrace.combine( stack, promise._trace.stack.split("\n") ); promise = promise._traceParent; combinedTraces++; } var stackTraceLimit = Error.stackTraceLimit || 10; var max = (stackTraceLimit + headerLineCount) * combinedTraces; var len = stack.length; if (len > max) { stack.length = max; } if (len > 0) stack[0] = stack[0].split("\u0002\u0000\u0001").join("\n"); if (stack.length <= headerLineCount) { error.stack = "(No stack trace)"; } else { error.stack = stack.join("\n"); } } }; Promise.prototype._cleanValues = function Promise$_cleanValues() { if (this._cancellable()) { this._cancellationParent = void 0; } }; Promise.prototype._propagateFrom = function Promise$_propagateFrom(parent, flags) { if ((flags & 1) > 0 && parent._cancellable()) { this._setCancellable(); this._cancellationParent = parent; } if ((flags & 4) > 0) { this._setBoundTo(parent._boundTo); } if ((flags & 2) > 0) { this._setTrace(parent); } }; Promise.prototype._fulfill = function Promise$_fulfill(value) { if (this._isFollowingOrFulfilledOrRejected()) return; this._fulfillUnchecked(value); }; Promise.prototype._reject = function Promise$_reject(reason, carriedStackTrace) { if (this._isFollowingOrFulfilledOrRejected()) return; this._rejectUnchecked(reason, carriedStackTrace); }; Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) { var handler = this.isFulfilled() ? this._fulfillmentHandlerAt(index) : this._rejectionHandlerAt(index); var value = this._settledValue; var receiver = this._receiverAt(index); var promise = this._promiseAt(index); if (typeof handler === "function") { this._settlePromiseFromHandler(handler, receiver, value, promise); } else { var done = false; var isFulfilled = this.isFulfilled(); if (receiver !== void 0) { if (receiver instanceof Promise && receiver._isProxied()) { receiver._unsetProxied(); if (isFulfilled) receiver._fulfillUnchecked(value); else receiver._rejectUnchecked(value, this._getCarriedStackTrace()); done = true; } else if (receiver instanceof PromiseArray) { if (isFulfilled) receiver._promiseFulfilled(value, promise); else receiver._promiseRejected(value, promise); done = true; } } if (!done) { if (isFulfilled) promise._fulfill(value); else promise._reject(value, this._getCarriedStackTrace()); } } if (index >= 4) { this._queueGC(); } }; Promise.prototype._isProxied = function Promise$_isProxied() { return (this._bitField & 4194304) === 4194304; }; Promise.prototype._setProxied = function Promise$_setProxied() { this._bitField = this._bitField | 4194304; }; Promise.prototype._unsetProxied = function Promise$_unsetProxied() { this._bitField = this._bitField & (~4194304); }; Promise.prototype._isGcQueued = function Promise$_isGcQueued() { return (this._bitField & -1073741824) === -1073741824; }; Promise.prototype._setGcQueued = function Promise$_setGcQueued() { this._bitField = this._bitField | -1073741824; }; Promise.prototype._unsetGcQueued = function Promise$_unsetGcQueued() { this._bitField = this._bitField & (~-1073741824); }; Promise.prototype._queueGC = function Promise$_queueGC() { if (this._isGcQueued()) return; this._setGcQueued(); async.invokeLater(this._gc, this, void 0); }; Promise.prototype._gc = function Promise$gc() { var len = this._length() * 5 - 5; for (var i = 0; i < len; i++) { delete this[i]; } this._clearFirstHandlerData(); this._setLength(0); this._unsetGcQueued(); }; Promise.prototype._clearFirstHandlerData = function Promise$_clearFirstHandlerData() { this._fulfillmentHandler0 = void 0; this._rejectionHandler0 = void 0; this._promise0 = void 0; this._receiver0 = void 0; }; Promise.prototype._queueSettleAt = function Promise$_queueSettleAt(index) { if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); async.invoke(this._settlePromiseAt, this, index); }; Promise.prototype._fulfillUnchecked = function Promise$_fulfillUnchecked(value) { if (!this.isPending()) return; if (value === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._rejectUnchecked(err, void 0); } this._cleanValues(); this._setFulfilled(); this._settledValue = value; var len = this._length(); if (len > 0) { async.invoke(this._settlePromises, this, len); } }; Promise.prototype._rejectUncheckedCheckError = function Promise$_rejectUncheckedCheckError(reason) { var trace = canAttach(reason) ? reason : new Error(reason + ""); this._rejectUnchecked(reason, trace === reason ? void 0 : trace); }; Promise.prototype._rejectUnchecked = function Promise$_rejectUnchecked(reason, trace) { if (!this.isPending()) return; if (reason === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._rejectUnchecked(err); } this._cleanValues(); this._setRejected(); this._settledValue = reason; if (this._isFinal()) { async.invokeLater(thrower, void 0, trace === void 0 ? reason : trace); return; } var len = this._length(); if (trace !== void 0) this._setCarriedStackTrace(trace); if (len > 0) { async.invoke(this._rejectPromises, this, null); } else { this._ensurePossibleRejectionHandled(); } }; Promise.prototype._rejectPromises = function Promise$_rejectPromises() { this._settlePromises(); this._unsetCarriedStackTrace(); }; Promise.prototype._settlePromises = function Promise$_settlePromises() { var len = this._length(); for (var i = 0; i < len; i++) { this._settlePromiseAt(i); } }; Promise.prototype._ensurePossibleRejectionHandled = function Promise$_ensurePossibleRejectionHandled() { this._setRejectionIsUnhandled(); if (CapturedTrace.possiblyUnhandledRejection !== void 0) { async.invokeLater(this._notifyUnhandledRejection, this, void 0); } }; Promise.prototype._notifyUnhandledRejectionIsHandled = function Promise$_notifyUnhandledRejectionIsHandled() { if (typeof unhandledRejectionHandled === "function") { async.invokeLater(unhandledRejectionHandled, void 0, this); } }; Promise.prototype._notifyUnhandledRejection = function Promise$_notifyUnhandledRejection() { if (this._isRejectionUnhandled()) { var reason = this._settledValue; var trace = this._getCarriedStackTrace(); this._setUnhandledRejectionIsNotified(); if (trace !== void 0) { this._unsetCarriedStackTrace(); reason = trace; } if (typeof CapturedTrace.possiblyUnhandledRejection === "function") { CapturedTrace.possiblyUnhandledRejection(reason, this); } } }; var contextStack = []; Promise.prototype._peekContext = function Promise$_peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) { return contextStack[lastIndex]; } return void 0; }; Promise.prototype._pushContext = function Promise$_pushContext() { if (!debugging) return; contextStack.push(this); }; Promise.prototype._popContext = function Promise$_popContext() { if (!debugging) return; contextStack.pop(); }; Promise.noConflict = function Promise$NoConflict() { return noConflict(Promise); }; Promise.setScheduler = function(fn) { if (typeof fn !== "function") throw new TypeError("fn must be a function"); async._schedule = fn; }; if (!CapturedTrace.isSupported()) { Promise.longStackTraces = function(){}; debugging = false; } Promise._makeSelfResolutionError = makeSelfResolutionError; _dereq_("./finally.js")(Promise, NEXT_FILTER, cast); _dereq_("./direct_resolve.js")(Promise); _dereq_("./synchronous_inspection.js")(Promise); _dereq_("./join.js")(Promise, PromiseArray, cast, INTERNAL); Promise.RangeError = RangeError; Promise.CancellationError = CancellationError; Promise.TimeoutError = TimeoutError; Promise.TypeError = TypeError; Promise.OperationalError = OperationalError; Promise.RejectionError = OperationalError; Promise.AggregateError = errors.AggregateError; util.toFastProperties(Promise); util.toFastProperties(Promise.prototype); Promise.Promise = Promise; _dereq_('./nodeify.js')(Promise); Promise.prototype = Promise.prototype; return Promise; }; },{"./async.js":1,"./captured_trace.js":3,"./catch_filter.js":4,"./direct_resolve.js":5,"./errors.js":6,"./errors_api_rejection":7,"./finally.js":9,"./join.js":10,"./nodeify.js":11,"./promise_array.js":13,"./promise_resolver.js":14,"./synchronous_inspection.js":17,"./thenables.js":18,"./util.js":19}],13:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise, INTERNAL, cast) { var canAttach = _dereq_("./errors.js").canAttach; var util = _dereq_("./util.js"); var isArray = util.isArray; function toResolutionValue(val) { switch(val) { case -1: return void 0; case -2: return []; case -3: return {}; } } function PromiseArray(values) { var promise = this._promise = new Promise(INTERNAL); var parent = void 0; if (values instanceof Promise) { parent = values; promise._propagateFrom(parent, 1 | 4); } promise._setTrace(parent); this._values = values; this._length = 0; this._totalResolved = 0; this._init(void 0, -2); } PromiseArray.prototype.length = function PromiseArray$length() { return this._length; }; PromiseArray.prototype.promise = function PromiseArray$promise() { return this._promise; }; PromiseArray.prototype._init = function PromiseArray$_init(_, resolveValueIfEmpty) { var values = cast(this._values, void 0); if (values instanceof Promise) { this._values = values; values._setBoundTo(this._promise._boundTo); if (values.isFulfilled()) { values = values._settledValue; if (!isArray(values)) { var err = new Promise.TypeError("expecting an array, a promise or a thenable"); this.__hardReject__(err); return; } } else if (values.isPending()) { values._then( PromiseArray$_init, this._reject, void 0, this, resolveValueIfEmpty ); return; } else { values._unsetRejectionIsUnhandled(); this._reject(values._settledValue); return; } } else if (!isArray(values)) { var err = new Promise.TypeError("expecting an array, a promise or a thenable"); this.__hardReject__(err); return; } if (values.length === 0) { if (resolveValueIfEmpty === -5) { this._resolveEmptyArray(); } else { this._resolve(toResolutionValue(resolveValueIfEmpty)); } return; } var len = this.getActualLength(values.length); var newLen = len; var newValues = this.shouldCopyValues() ? new Array(len) : this._values; var isDirectScanNeeded = false; for (var i = 0; i < len; ++i) { var maybePromise = cast(values[i], void 0); if (maybePromise instanceof Promise) { if (maybePromise.isPending()) { maybePromise._proxyPromiseArray(this, i); } else { maybePromise._unsetRejectionIsUnhandled(); isDirectScanNeeded = true; } } else { isDirectScanNeeded = true; } newValues[i] = maybePromise; } this._values = newValues; this._length = newLen; if (isDirectScanNeeded) { this._scanDirectValues(len); } }; PromiseArray.prototype._settlePromiseAt = function PromiseArray$_settlePromiseAt(index) { var value = this._values[index]; if (!(value instanceof Promise)) { this._promiseFulfilled(value, index); } else if (value.isFulfilled()) { this._promiseFulfilled(value._settledValue, index); } else if (value.isRejected()) { this._promiseRejected(value._settledValue, index); } }; PromiseArray.prototype._scanDirectValues = function PromiseArray$_scanDirectValues(len) { for (var i = 0; i < len; ++i) { if (this._isResolved()) { break; } this._settlePromiseAt(i); } }; PromiseArray.prototype._isResolved = function PromiseArray$_isResolved() { return this._values === null; }; PromiseArray.prototype._resolve = function PromiseArray$_resolve(value) { this._values = null; this._promise._fulfill(value); }; PromiseArray.prototype.__hardReject__ = PromiseArray.prototype._reject = function PromiseArray$_reject(reason) { this._values = null; var trace = canAttach(reason) ? reason : new Error(reason + ""); this._promise._attachExtraTrace(trace); this._promise._reject(reason, trace); }; PromiseArray.prototype._promiseProgressed = function PromiseArray$_promiseProgressed(progressValue, index) { if (this._isResolved()) return; this._promise._progress({ index: index, value: progressValue }); }; PromiseArray.prototype._promiseFulfilled = function PromiseArray$_promiseFulfilled(value, index) { if (this._isResolved()) return; this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); } }; PromiseArray.prototype._promiseRejected = function PromiseArray$_promiseRejected(reason, index) { if (this._isResolved()) return; this._totalResolved++; this._reject(reason); }; PromiseArray.prototype.shouldCopyValues = function PromiseArray$_shouldCopyValues() { return true; }; PromiseArray.prototype.getActualLength = function PromiseArray$getActualLength(len) { return len; }; return PromiseArray; }; },{"./errors.js":6,"./util.js":19}],14:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 util = _dereq_("./util.js"); var maybeWrapAsError = util.maybeWrapAsError; var errors = _dereq_("./errors.js"); var TimeoutError = errors.TimeoutError; var OperationalError = errors.OperationalError; var async = _dereq_("./async.js"); var haveGetters = util.haveGetters; var es5 = _dereq_("./es5.js"); function isUntypedError(obj) { return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype; } function wrapAsOperationalError(obj) { var ret; if (isUntypedError(obj)) { ret = new OperationalError(obj); } else { ret = obj; } errors.markAsOriginatingFromRejection(ret); return ret; } function nodebackForPromise(promise) { function PromiseResolver$_callback(err, value) { if (promise === null) return; if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); promise._attachExtraTrace(wrapped); promise._reject(wrapped); } else if (arguments.length > 2) { var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} promise._fulfill(args); } else { promise._fulfill(value); } promise = null; } return PromiseResolver$_callback; } var PromiseResolver; if (!haveGetters) { PromiseResolver = function PromiseResolver(promise) { this.promise = promise; this.asCallback = nodebackForPromise(promise); this.callback = this.asCallback; }; } else { PromiseResolver = function PromiseResolver(promise) { this.promise = promise; }; } if (haveGetters) { var prop = { get: function() { return nodebackForPromise(this.promise); } }; es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); es5.defineProperty(PromiseResolver.prototype, "callback", prop); } PromiseResolver._nodebackForPromise = nodebackForPromise; PromiseResolver.prototype.toString = function PromiseResolver$toString() { return "[object PromiseResolver]"; }; PromiseResolver.prototype.resolve = PromiseResolver.prototype.fulfill = function PromiseResolver$resolve(value) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } var promise = this.promise; if (promise._tryFollow(value)) { return; } async.invoke(promise._fulfill, promise, value); }; PromiseResolver.prototype.reject = function PromiseResolver$reject(reason) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } var promise = this.promise; errors.markAsOriginatingFromRejection(reason); var trace = errors.canAttach(reason) ? reason : new Error(reason + ""); promise._attachExtraTrace(trace); async.invoke(promise._reject, promise, reason); if (trace !== reason) { async.invoke(this._setCarriedStackTrace, this, trace); } }; PromiseResolver.prototype.progress = function PromiseResolver$progress(value) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } async.invoke(this.promise._progress, this.promise, value); }; PromiseResolver.prototype.cancel = function PromiseResolver$cancel() { async.invoke(this.promise.cancel, this.promise, void 0); }; PromiseResolver.prototype.timeout = function PromiseResolver$timeout() { this.reject(new TimeoutError("timeout")); }; PromiseResolver.prototype.isResolved = function PromiseResolver$isResolved() { return this.promise.isResolved(); }; PromiseResolver.prototype.toJSON = function PromiseResolver$toJSON() { return this.promise.toJSON(); }; PromiseResolver.prototype._setCarriedStackTrace = function PromiseResolver$_setCarriedStackTrace(trace) { if (this.promise.isRejected()) { this.promise._setCarriedStackTrace(trace); } }; module.exports = PromiseResolver; },{"./async.js":1,"./errors.js":6,"./es5.js":8,"./util.js":19}],15:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; function arrayCopy(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) { dst[j + dstIndex] = src[j + srcIndex]; } } function Queue(capacity) { this._capacity = capacity; this._length = 0; this._front = 0; this._makeCapacity(); } Queue.prototype._willBeOverCapacity = function Queue$_willBeOverCapacity(size) { return this._capacity < size; }; Queue.prototype._pushOne = function Queue$_pushOne(arg) { var length = this.length(); this._checkCapacity(length + 1); var i = (this._front + length) & (this._capacity - 1); this[i] = arg; this._length = length + 1; }; Queue.prototype.push = function Queue$push(fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) { this._pushOne(fn); this._pushOne(receiver); this._pushOne(arg); return; } var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[(j + 0) & wrapMask] = fn; this[(j + 1) & wrapMask] = receiver; this[(j + 2) & wrapMask] = arg; this._length = length; }; Queue.prototype.shift = function Queue$shift() { var front = this._front, ret = this[front]; this[front] = void 0; this._front = (front + 1) & (this._capacity - 1); this._length--; return ret; }; Queue.prototype.length = function Queue$length() { return this._length; }; Queue.prototype._makeCapacity = function Queue$_makeCapacity() { var len = this._capacity; for (var i = 0; i < len; ++i) { this[i] = void 0; } }; Queue.prototype._checkCapacity = function Queue$_checkCapacity(size) { if (this._capacity < size) { this._resizeTo(this._capacity << 3); } }; Queue.prototype._resizeTo = function Queue$_resizeTo(capacity) { var oldFront = this._front; var oldCapacity = this._capacity; var oldQueue = new Array(oldCapacity); var length = this.length(); arrayCopy(this, 0, oldQueue, 0, oldCapacity); this._capacity = capacity; this._makeCapacity(); this._front = 0; if (oldFront + length <= oldCapacity) { arrayCopy(oldQueue, oldFront, this, 0, length); } else { var lengthBeforeWrapping = length - ((oldFront + length) & (oldCapacity - 1)); arrayCopy(oldQueue, oldFront, this, 0, lengthBeforeWrapping); arrayCopy(oldQueue, 0, this, lengthBeforeWrapping, length - lengthBeforeWrapping); } }; module.exports = Queue; },{}],16:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 schedule; var _MutationObserver; if (typeof process === "object" && typeof process.version === "string") { schedule = function Promise$_Scheduler(fn) { process.nextTick(fn); }; } else if ((typeof MutationObserver !== "undefined" && (_MutationObserver = MutationObserver)) || (typeof WebKitMutationObserver !== "undefined" && (_MutationObserver = WebKitMutationObserver))) { schedule = (function() { var div = document.createElement("div"); var queuedFn = void 0; var observer = new _MutationObserver( function Promise$_Scheduler() { var fn = queuedFn; queuedFn = void 0; fn(); } ); observer.observe(div, { attributes: true }); return function Promise$_Scheduler(fn) { queuedFn = fn; div.classList.toggle("foo"); }; })(); } else if (typeof setTimeout !== "undefined") { schedule = function Promise$_Scheduler(fn) { setTimeout(fn, 0); }; } else throw new Error("no async scheduler available"); module.exports = schedule; },{}],17:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise) { function PromiseInspection(promise) { if (promise !== void 0) { this._bitField = promise._bitField; this._settledValue = promise.isResolved() ? promise._settledValue : void 0; } else { this._bitField = 0; this._settledValue = void 0; } } PromiseInspection.prototype.isFulfilled = Promise.prototype.isFulfilled = function Promise$isFulfilled() { return (this._bitField & 268435456) > 0; }; PromiseInspection.prototype.isRejected = Promise.prototype.isRejected = function Promise$isRejected() { return (this._bitField & 134217728) > 0; }; PromiseInspection.prototype.isPending = Promise.prototype.isPending = function Promise$isPending() { return (this._bitField & 402653184) === 0; }; PromiseInspection.prototype.value = Promise.prototype.value = function Promise$value() { if (!this.isFulfilled()) { throw new TypeError("cannot get fulfillment value of a non-fulfilled promise"); } return this._settledValue; }; PromiseInspection.prototype.error = PromiseInspection.prototype.reason = Promise.prototype.reason = function Promise$reason() { if (!this.isRejected()) { throw new TypeError("cannot get rejection reason of a non-rejected promise"); } return this._settledValue; }; PromiseInspection.prototype.isResolved = Promise.prototype.isResolved = function Promise$isResolved() { return (this._bitField & 402653184) > 0; }; Promise.PromiseInspection = PromiseInspection; }; },{}],18:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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"; module.exports = function(Promise, INTERNAL) { var util = _dereq_("./util.js"); var canAttach = _dereq_("./errors.js").canAttach; var errorObj = util.errorObj; var isObject = util.isObject; function getThen(obj) { try { return obj.then; } catch(e) { errorObj.e = e; return errorObj; } } function Promise$_Cast(obj, originalPromise) { if (isObject(obj)) { if (obj instanceof Promise) { return obj; } else if (isAnyBluebirdPromise(obj)) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); obj._then( ret._fulfillUnchecked, ret._rejectUncheckedCheckError, ret._progressUnchecked, ret, null ); ret._setFollowing(); return ret; } var then = getThen(obj); if (then === errorObj) { if (originalPromise !== void 0 && canAttach(then.e)) { originalPromise._attachExtraTrace(then.e); } return Promise.reject(then.e); } else if (typeof then === "function") { return Promise$_doThenable(obj, then, originalPromise); } } return obj; } var hasProp = {}.hasOwnProperty; function isAnyBluebirdPromise(obj) { return hasProp.call(obj, "_promise0"); } function Promise$_doThenable(x, then, originalPromise) { var resolver = Promise.defer(); var called = false; try { then.call( x, Promise$_resolveFromThenable, Promise$_rejectFromThenable, Promise$_progressFromThenable ); } catch(e) { if (!called) { called = true; var trace = canAttach(e) ? e : new Error(e + ""); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(trace); } resolver.promise._reject(e, trace); } } return resolver.promise; function Promise$_resolveFromThenable(y) { if (called) return; called = true; if (x === y) { var e = Promise._makeSelfResolutionError(); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(e); } resolver.promise._reject(e, void 0); return; } resolver.resolve(y); } function Promise$_rejectFromThenable(r) { if (called) return; called = true; var trace = canAttach(r) ? r : new Error(r + ""); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(trace); } resolver.promise._reject(r, trace); } function Promise$_progressFromThenable(v) { if (called) return; var promise = resolver.promise; if (typeof promise._progress === "function") { promise._progress(v); } } } return Promise$_Cast; }; },{"./errors.js":6,"./util.js":19}],19:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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 es5 = _dereq_("./es5.js"); var haveGetters = (function(){ try { var o = {}; es5.defineProperty(o, "f", { get: function () { return 3; } }); return o.f === 3; } catch (e) { return false; } })(); var canEvaluate = typeof navigator == "undefined"; var errorObj = {e: {}}; function tryCatch1(fn, receiver, arg) { try { return fn.call(receiver, arg); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch2(fn, receiver, arg, arg2) { try { return fn.call(receiver, arg, arg2); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch3(fn, receiver, arg, arg2, arg3) { try { return fn.call(receiver, arg, arg2, arg3); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch4(fn, receiver, arg, arg2, arg3, arg4) { try { return fn.call(receiver, arg, arg2, arg3, arg4); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatchApply(fn, args, receiver) { try { return fn.apply(receiver, args); } catch (e) { errorObj.e = e; return errorObj; } } var inherits = function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length-1) !== "$" ) { this[propertyName + "$"] = Parent.prototype[propertyName]; } } } T.prototype = Parent.prototype; Child.prototype = new T(); return Child.prototype; }; function asString(val) { return typeof val === "string" ? val : ("" + val); } function isPrimitive(val) { return val == null || val === true || val === false || typeof val === "string" || typeof val === "number"; } function isObject(value) { return !isPrimitive(value); } function maybeWrapAsError(maybeError) { if (!isPrimitive(maybeError)) return maybeError; return new Error(asString(maybeError)); } function withAppended(target, appendee) { var len = target.length; var ret = new Array(len + 1); var i; for (i = 0; i < len; ++i) { ret[i] = target[i]; } ret[i] = appendee; return ret; } function getDataPropertyOrDefault(obj, key, defaultValue) { if (es5.isES5) { var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null) { return desc.get == null && desc.set == null ? desc.value : defaultValue; } } else { return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; } } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value: value, configurable: true, enumerable: false, writable: true }; es5.defineProperty(obj, name, descriptor); return obj; } var wrapsPrimitiveReceiver = (function() { return this !== "string"; }).call("string"); function thrower(r) { throw r; } var inheritedDataKeys = (function() { if (es5.isES5) { return function(obj, opts) { var ret = []; var visitedKeys = Object.create(null); var getKeys = Object(opts).includeHidden ? Object.getOwnPropertyNames : Object.keys; while (obj != null) { var keys; try { keys = getKeys(obj); } catch (e) { return ret; } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (visitedKeys[key]) continue; visitedKeys[key] = true; var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null && desc.get == null && desc.set == null) { ret.push(key); } } obj = es5.getPrototypeOf(obj); } return ret; }; } else { return function(obj) { var ret = []; /*jshint forin:false */ for (var key in obj) { ret.push(key); } return ret; }; } })(); function isClass(fn) { try { if (typeof fn === "function") { var keys = es5.keys(fn.prototype); return keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor"); } return false; } catch (e) { return false; } } function toFastProperties(obj) { /*jshint -W027*/ function f() {} f.prototype = obj; return f; eval(obj); } var rident = /^[a-z$_][a-z$_0-9]*$/i; function isIdentifier(str) { return rident.test(str); } function filledRange(count, prefix, suffix) { var ret = new Array(count); for(var i = 0; i < count; ++i) { ret[i] = prefix + i + suffix; } return ret; } var ret = { isClass: isClass, isIdentifier: isIdentifier, inheritedDataKeys: inheritedDataKeys, getDataPropertyOrDefault: getDataPropertyOrDefault, thrower: thrower, isArray: es5.isArray, haveGetters: haveGetters, notEnumerableProp: notEnumerableProp, isPrimitive: isPrimitive, isObject: isObject, canEvaluate: canEvaluate, errorObj: errorObj, tryCatch1: tryCatch1, tryCatch2: tryCatch2, tryCatch3: tryCatch3, tryCatch4: tryCatch4, tryCatchApply: tryCatchApply, inherits: inherits, withAppended: withAppended, asString: asString, maybeWrapAsError: maybeWrapAsError, wrapsPrimitiveReceiver: wrapsPrimitiveReceiver, toFastProperties: toFastProperties, filledRange: filledRange }; module.exports = ret; },{"./es5.js":8}]},{},[2]) (2) }); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } /** FILE: src/remotestorage.js **/ (function (global) { // wrapper to implement defer() functionality Promise.defer = function () { var resolve, reject; var promise = new Promise(function() { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; function logError(error) { if (typeof(error) === 'string') { console.error(error); } else { console.error(error.message, error.stack); } } function emitUnauthorized(r) { if (r.statusCode === 403 || r.statusCode === 401) { this._emit('error', new RemoteStorage.Unauthorized()); } return Promise.resolve(r); } function shareFirst(path) { return ( this.backend === 'dropbox' && path.match(/^\/public\/.*[^\/]$/) ); } var SyncedGetPutDelete = { get: function (path, maxAge) { var self = this; if (this.local) { if (maxAge === undefined) { if ((typeof this.remote === 'object') && this.remote.connected && this.remote.online) { maxAge = 2*this.getSyncInterval(); } else { RemoteStorage.log('Not setting default maxAge, because remote is offline or not connected'); maxAge = false; } } var maxAgeInvalid = function (maxAge) { return maxAge !== false && typeof(maxAge) !== 'number'; }; if (maxAgeInvalid(maxAge)) { return Promise.reject('Argument \'maxAge\' must be false or a number'); } return this.local.get(path, maxAge, this.sync.queueGetRequest.bind(this.sync)); } else { return this.remote.get(path); } }, put: function (path, body, contentType) { if (shareFirst.bind(this)(path)) { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.put(path, body, contentType)); } else if (this.local) { return this.local.put(path, body, contentType); } else { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.put(path, body, contentType)); } }, 'delete': function (path) { if (this.local) { return this.local.delete(path); } else { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.delete(path)); } }, _wrapBusyDone: function (result) { var self = this; this._emit('wire-busy'); return result.then(function (r) { self._emit('wire-done', { success: true }); return Promise.resolve(r); }, function (err) { self._emit('wire-done', { success: false }); return Promise.reject(err); }); } }; /** * Class: RemoteStorage * * TODO needs proper introduction and links to relevant classes etc * * Constructor for global remoteStorage object. * * This class primarily contains feature detection code and a global convenience API. * * Depending on which features are built in, it contains different attributes and * functions. See the individual features for more information. * * (start code) * var remoteStorage = new RemoteStorage({ * logging: true, // defaults to false * cordovaRedirectUri: 'https://app.mygreatapp.com' // defaults to undefined * }); * (end code) */ var RemoteStorage = function (cfg) { /** * Event: ready * * Fired when ready **/ /** * Event: not-connected * * Fired when ready, but no storage connected ("anonymous mode") **/ /** * Event: connected * * Fired when a remote storage has been connected **/ /** * Event: disconnected * * Fired after disconnect **/ /** * Event: error * * Fired when an error occurs * * Arguments: * the error **/ /** * Event: features-loaded * * Fired when all features are loaded **/ /** * Event: connecting * * Fired before webfinger lookup **/ /** * Event: authing * * Fired before redirecting to the authing server **/ /** * Event: wire-busy * * Fired when a wire request starts **/ /** * Event: wire-done * * Fired when a wire request completes **/ // Initial configuration property settings. if (typeof cfg === 'object') { RemoteStorage.config.logging = !!cfg.logging; RemoteStorage.config.cordovaRedirectUri = cfg.cordovaRedirectUri; } RemoteStorage.eventHandling( this, 'ready', 'connected', 'disconnected', 'not-connected', 'conflict', 'error', 'features-loaded', 'connecting', 'authing', 'wire-busy', 'wire-done', 'sync-interval-change' ); // pending get/put/delete calls. this._pending = []; this._setGPD({ get: this._pendingGPD('get'), put: this._pendingGPD('put'), delete: this._pendingGPD('delete') }); this._cleanups = []; this._pathHandlers = { change: {} }; this.apiKeys = {}; if (this.localStorageAvailable()) { try { this.apiKeys = JSON.parse(localStorage['remotestorage:api-keys']); } catch(exc) { // ignored } this.setBackend(localStorage['remotestorage:backend'] || 'remotestorage'); } var origOn = this.on; this.on = function (eventName, handler) { if (eventName === 'ready' && this.remote.connected && this._allLoaded) { setTimeout(handler, 0); } else if (eventName === 'features-loaded' && this._allLoaded) { setTimeout(handler, 0); } return origOn.call(this, eventName, handler); }; this._init(); this.fireInitial = function () { if (this.local) { setTimeout(this.local.fireInitial.bind(this.local), 0); } }.bind(this); this.on('ready', this.fireInitial.bind(this)); }; RemoteStorage.SyncedGetPutDelete = SyncedGetPutDelete; RemoteStorage.DiscoveryError = function (message) { Error.apply(this, arguments); this.message = message; }; RemoteStorage.DiscoveryError.prototype = Object.create(Error.prototype); RemoteStorage.Unauthorized = function () { Error.apply(this, arguments); }; RemoteStorage.Unauthorized.prototype = Object.create(Error.prototype); /** * Method: RemoteStorage.log * * Log using console.log, when remoteStorage logging is enabled. * * You can enable logging with <enableLog>. * * (In node.js you can also enable logging during remoteStorage object * creation. See: <RemoteStorage>). */ RemoteStorage.log = function () { if (RemoteStorage.config.logging) { console.log.apply(console, arguments); } }; RemoteStorage.config = { logging: false, changeEvents: { local: true, window: false, remote: true, conflict: true }, discoveryTimeout: 10000, cordovaRedirectUri: undefined }; RemoteStorage.prototype = { /** * Method: displayWidget * * Displays the widget at the top right of the page. Make sure to call this function * once on every pageload (after the html 'body' tag), unless you use a custom widget. * * Parameters: * * domID: identifier of the DOM element which should embody the widget (optional) */ // (see src/widget.js for implementation) /** * Property: remote * * Properties: * * connected - Boolean, whether or not a remote store is connected * online - Boolean, whether last sync action was successful or not * userAddress - String, the user address of the connected user * properties - String, the properties of the WebFinger link */ /** * Method: scope * * Returns a BaseClient with a certain scope (base path). Please use this method * only for debugging, and always use defineModule instead, to get access to a * BaseClient from a module in an app. * * Parameters: * * scope - A string, with a leading and a trailing slash, specifying the * base path of the BaseClient that will be returned. * * Code example: * * (start code) * remoteStorage.scope('/pictures/').getListing(''); * remoteStorage.scope('/public/pictures/').getListing(''); */ /** * Method: connect * * Connect to a remoteStorage server. * * Parameters: * userAddress - The user address (user@host) to connect to. * token - (optional) A bearer token acquired beforehand * * Discovers the WebFinger profile of the given user address and initiates * the OAuth dance. * * This method must be called *after* all required access has been claimed. * When using the connect widget, it will call this method itself. * * Special cases: * * 1. If a bearer token is supplied as second argument, the OAuth dance * will be skipped and the supplied token be used instead. This is * useful outside of browser environments, where the token has been * acquired in a different way. * * 2. If the Webfinger profile for the given user address doesn't contain * an auth URL, the library will assume that client and server have * established authorization among themselves, which will omit bearer * tokens in all requests later on. This is useful for example when using * Kerberos and similar protocols. */ connect: function (userAddress, token) { this.setBackend('remotestorage'); if (userAddress.indexOf('@') < 0) { this._emit('error', new RemoteStorage.DiscoveryError("User address doesn't contain an @.")); return; } if (global.cordova) { if (typeof RemoteStorage.config.cordovaRedirectUri !== 'string') { this._emit('error', new RemoteStorage.DiscoveryError("Please supply a custom HTTPS redirect URI for your Cordova app")); return; } if (!global.cordova.InAppBrowser) { this._emit('error', new RemoteStorage.DiscoveryError("Please include the InAppBrowser Cordova plugin to enable OAuth")); return; } } this.remote.configure({ userAddress: userAddress }); this._emit('connecting'); var discoveryTimeout = setTimeout(function () { this._emit('error', new RemoteStorage.DiscoveryError("No storage information found at that user address.")); }.bind(this), RemoteStorage.config.discoveryTimeout); RemoteStorage.Discover(userAddress).then(function (info) { // Info contains fields: href, storageApi, authURL (optional), properties clearTimeout(discoveryTimeout); this._emit('authing'); info.userAddress = userAddress; this.remote.configure(info); if (! this.remote.connected) { if (info.authURL) { if (typeof token === 'undefined') { // Normal authorization step; the default way to connect this.authorize(info.authURL, RemoteStorage.config.cordovaRedirectUri); } else if (typeof token === 'string') { // Token supplied directly by app/developer/user RemoteStorage.log('Skipping authorization sequence and connecting with known token'); this.remote.configure({ token: token }); } else { throw new Error("Supplied bearer token must be a string"); } } else { // In lieu of an excplicit authURL, assume that the browser and // server handle any authorization needs; for instance, TLS may // trigger the browser to use a client certificate, or a 401 Not // Authorized response may make the browser send a Kerberos ticket // using the SPNEGO method. this.impliedauth(); } } }.bind(this), function(err) { this._emit('error', new RemoteStorage.DiscoveryError("Failed to contact storage server.")); }.bind(this)); }, /** * Method: disconnect * * "Disconnect" from remotestorage server to terminate current session. * This method clears all stored settings and deletes the entire local * cache. */ disconnect: function () { if (this.remote) { this.remote.configure({ userAddress: null, href: null, storageApi: null, token: null, properties: null }); } this._setGPD({ get: this._pendingGPD('get'), put: this._pendingGPD('put'), delete: this._pendingGPD('delete') }); var n = this._cleanups.length, i = 0; var oneDone = function () { i++; if (i >= n) { this._init(); RemoteStorage.log('Done cleaning up, emitting disconnected and disconnect events'); this._emit('disconnected'); } }.bind(this); if (n > 0) { this._cleanups.forEach(function (cleanup) { var cleanupResult = cleanup(this); if (typeof(cleanup) === 'object' && typeof(cleanup.then) === 'function') { cleanupResult.then(oneDone); } else { oneDone(); } }.bind(this)); } else { oneDone(); } }, setBackend: function (what) { this.backend = what; if (this.localStorageAvailable()) { if (what) { localStorage['remotestorage:backend'] = what; } else { delete localStorage['remotestorage:backend']; } } }, /** * Method: onChange * * Add a "change" event handler to the given path. Whenever a "change" * happens (as determined by the backend, such as e.g. * <RemoteStorage.IndexedDB>) and the affected path is equal to or below * the given 'path', the given handler is called. * * You should usually not use this method directly, but instead use the * "change" events provided by <RemoteStorage.BaseClient>. * * Parameters: * path - Absolute path to attach handler to. * handler - Handler function. */ onChange: function (path, handler) { if (! this._pathHandlers.change[path]) { this._pathHandlers.change[path] = []; } this._pathHandlers.change[path].push(handler); }, /** * Method: enableLog * * Enable remoteStorage logging. */ enableLog: function () { RemoteStorage.config.logging = true; }, /** * Method: disableLog * * Disable remoteStorage logging */ disableLog: function () { RemoteStorage.config.logging = false; }, /** * Method: log * * The same as <RemoteStorage.log>. */ log: function () { RemoteStorage.log.apply(RemoteStorage, arguments); }, /** * Method: setApiKeys (experimental) * * Set API keys for (currently) GoogleDrive and/or Dropbox backend support. * See also the 'backends' example in the starter-kit. Note that support for * both these backends is still experimental. * * Parameters: * type - string, either 'googledrive' or 'dropbox' * keys - object, with one string field; 'clientId' for GoogleDrive, or * 'appKey' for Dropbox. * */ setApiKeys: function (type, keys) { if (keys) { this.apiKeys[type] = keys; } else { delete this.apiKeys[type]; } if (this.localStorageAvailable()) { localStorage['remotestorage:api-keys'] = JSON.stringify(this.apiKeys); } }, /** * Method: setCordovaRedirectUri * * Set redirect URI to be used for the OAuth redirect within the * in-app-browser window in Cordova apps. * * Parameters: * uri - string, valid HTTP(S) URI */ setCordovaRedirectUri: function (uri) { if (typeof uri !== 'string' || !uri.match(/http(s)?\:\/\//)) { throw new Error("Cordova redirect URI must be a URI string"); } RemoteStorage.config.cordovaRedirectUri = uri; }, /** ** INITIALIZATION **/ _init: function () { var self = this, readyFired = false; function fireReady() { try { if (!readyFired) { self._emit('ready'); readyFired = true; } } catch(e) { console.error("'ready' failed: ", e, e.stack); self._emit('error', e); } } this._loadFeatures(function (features) { this.log('[RemoteStorage] All features loaded'); this.local = features.local && new features.local(); // this.remote set by WireClient._rs_init as lazy property on // RS.prototype if (this.local && this.remote) { this._setGPD(SyncedGetPutDelete, this); this._bindChange(this.local); } else if (this.remote) { this._setGPD(this.remote, this.remote); } if (this.remote) { this.remote.on('connected', function (){ fireReady(); self._emit('connected'); }); this.remote.on('not-connected', function (){ fireReady(); self._emit('not-connected'); }); if (this.remote.connected) { fireReady(); self._emit('connected'); } if (!this.hasFeature('Authorize')) { this.remote.stopWaitingForToken(); } } this._collectCleanupFunctions(); try { this._allLoaded = true; this._emit('features-loaded'); } catch(exc) { logError(exc); this._emit('error', exc); } this._processPending(); }.bind(this)); }, _collectCleanupFunctions: function () { for (var i=0; i < this.features.length; i++) { var cleanup = this.features[i].cleanup; if (typeof(cleanup) === 'function') { this._cleanups.push(cleanup); } } }, /** ** FEATURE DETECTION **/ _loadFeatures: function (callback) { var featureList = [ 'WireClient', 'I18n', 'Dropbox', 'GoogleDrive', 'Access', 'Caching', 'Discover', 'Authorize', 'Widget', 'IndexedDB', 'LocalStorage', 'InMemoryStorage', 'Sync', 'BaseClient', 'Env' ]; var features = []; var featuresDone = 0; var self = this; function featureDone() { featuresDone++; if (featuresDone === featureList.length) { setTimeout(function () { features.caching = !!RemoteStorage.Caching; features.sync = !!RemoteStorage.Sync; [ 'IndexedDB', 'LocalStorage', 'InMemoryStorage' ].some(function (cachingLayer) { if (features.some(function (feature) { return feature.name === cachingLayer; })) { features.local = RemoteStorage[cachingLayer]; return true; } }); self.features = features; callback(features); }, 0); } } function featureInitialized(name) { self.log("[RemoteStorage] [FEATURE "+name+"] initialized."); features.push({ name : name, init : RemoteStorage[name]._rs_init, supported : true, cleanup : RemoteStorage[name]._rs_cleanup }); featureDone(); } function featureFailed(name, err) { self.log("[RemoteStorage] [FEATURE "+name+"] initialization failed ( "+err+")"); featureDone(); } function featureSupported(name, success) { self.log("[RemoteStorage] [FEATURE "+name+"]" + success ? "":" not"+" supported"); if (!success) { featureDone(); } } function initFeature(name) { var initResult; try { initResult = RemoteStorage[name]._rs_init(self); } catch(e) { featureFailed(name, e); return; } if (typeof(initResult) === 'object' && typeof(initResult.then) === 'function') { initResult.then( function (){ featureInitialized(name); }, function (err){ featureFailed(name, err); } ); } else { featureInitialized(name); } } featureList.forEach(function (featureName) { self.log("[RemoteStorage] [FEATURE " + featureName + "] initializing..."); var impl = RemoteStorage[featureName]; var supported; if (impl) { supported = !impl._rs_supported || impl._rs_supported(); if (typeof supported === 'object') { supported.then( function (){ featureSupported(featureName, true); initFeature(featureName); }, function (){ featureSupported(featureName, false); } ); } else if (typeof supported === 'boolean') { featureSupported(featureName, supported); if (supported) { initFeature(featureName); } } } else { featureSupported(featureName, false); } }); }, /** * Method: hasFeature * * Checks whether a feature is enabled or not within remoteStorage. * Returns a boolean. * * Parameters: * name - Capitalized name of the feature. e.g. Authorize, or IndexedDB * * Example: * (start code) * if (remoteStorage.hasFeature('LocalStorage')) { * console.log('LocalStorage is enabled!'); * } * (end code) * */ hasFeature: function (feature) { for (var i = this.features.length - 1; i >= 0; i--) { if (this.features[i].name === feature) { return this.features[i].supported; } } return false; }, localStorageAvailable: function () { try { return !!global.localStorage; } catch(error) { return false; } }, /** ** GET/PUT/DELETE INTERFACE HELPERS **/ _setGPD: function (impl, context) { function wrap(func) { return function () { return func.apply(context, arguments) .then(emitUnauthorized.bind(this)); }; } this.get = wrap(impl.get); this.put = wrap(impl.put); this.delete = wrap(impl.delete); }, _pendingGPD: function (methodName) { return function () { var pending = Promise.defer(); this._pending.push({ method: methodName, args: Array.prototype.slice.call(arguments), promise: pending }); return pending.promise; }.bind(this); }, _processPending: function () { this._pending.forEach(function (pending) { try { this[pending.method].apply(this, pending.args).then(pending.promise.resolve, pending.promise.reject); } catch(e) { pending.promise.reject(e); } }.bind(this)); this._pending = []; }, /** ** CHANGE EVENT HANDLING **/ _bindChange: function (object) { object.on('change', this._dispatchEvent.bind(this, 'change')); }, _dispatchEvent: function (eventName, event) { var self = this; Object.keys(this._pathHandlers[eventName]).forEach(function (path) { var pl = path.length; if (event.path.substr(0, pl) === path) { self._pathHandlers[eventName][path].forEach(function (handler) { var ev = {}; for (var key in event) { ev[key] = event[key]; } ev.relativePath = event.path.replace(new RegExp('^' + path), ''); try { handler(ev); } catch(e) { console.error("'change' handler failed: ", e, e.stack); self._emit('error', e); } }); } }); } }; /** * Property: connected * * Boolean property indicating if remoteStorage is currently connected. */ Object.defineProperty(RemoteStorage.prototype, 'connected', { get: function () { return this.remote.connected; } }); /** * Property: access * * Tracking claimed access scopes. A <RemoteStorage.Access> instance. * * * Property: caching * * Caching settings. A <RemoteStorage.Caching> instance. * * Not available in no-cache builds. * * * Property: remote * * Access to the remote backend used. Usually a <RemoteStorage.WireClient>. * * * Property: local * * Access to the local caching backend used. Usually either a * <RemoteStorage.IndexedDB> or <RemoteStorage.LocalStorage> instance. * * Not available in no-cache builds. */ if ((typeof module === 'object') && (typeof module.exports !== undefined)){ module.exports = RemoteStorage; } else { global.RemoteStorage = RemoteStorage; } })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/util.js **/ /** * Class: RemoteStorage.Util * * Provides reusable utility functions at RemoteStorage.util * */ (function () { /** * Function: fixArrayBuffers * * Takes an object and its copy as produced by the _deepClone function * below, and finds and fixes any ArrayBuffers that were cast to `{}` instead * of being cloned to new ArrayBuffers with the same content. * * It recurses into sub-objects, but skips arrays if they occur. */ function fixArrayBuffers(srcObj, dstObj) { var field, srcArr, dstArr; if (typeof(srcObj) !== 'object' || Array.isArray(srcObj) || srcObj === null) { return; } for (field in srcObj) { if (typeof(srcObj[field]) === 'object' && srcObj[field] !== null) { if (srcObj[field].toString() === '[object ArrayBuffer]') { dstObj[field] = new ArrayBuffer(srcObj[field].byteLength); srcArr = new Int8Array(srcObj[field]); dstArr = new Int8Array(dstObj[field]); dstArr.set(srcArr); } else { fixArrayBuffers(srcObj[field], dstObj[field]); } } } } RemoteStorage.util = { getEventEmitter: function () { var object = {}; var args = Array.prototype.slice.call(arguments); args.unshift(object); RemoteStorage.eventHandling.apply(RemoteStorage, args); object.emit = object._emit; return object; }, extend: function (target) { var sources = Array.prototype.slice.call(arguments, 1); sources.forEach(function (source) { for (var key in source) { target[key] = source[key]; } }); return target; }, asyncEach: function (array, callback) { return this.asyncMap(array, callback). then(function () { return array; }); }, asyncMap: function (array, callback) { var pending = Promise.defer(); var n = array.length, i = 0; var results = [], errors = []; function oneDone() { i++; if (i === n) { pending.resolve(results, errors); } } array.forEach(function (item, index) { var result; try { result = callback(item); } catch(exc) { oneDone(); errors[index] = exc; } if (typeof(result) === 'object' && typeof(result.then) === 'function') { result.then(function (res) { results[index] = res; oneDone(); }, function (error) { errors[index] = error; oneDone(); }); } else { oneDone(); results[index] = result; } }); return pending.promise; }, containingFolder: function (path) { if (path === '') { return '/'; } if (! path) { throw "Path not given!"; } return path.replace(/\/+/g, '/').replace(/[^\/]+\/?$/, ''); }, isFolder: function (path) { return path.substr(-1) === '/'; }, isDocument: function (path) { return path.substr(-1) !== '/'; }, baseName: function (path) { var parts = path.split('/'); if (this.isFolder(path)) { return parts[parts.length-2]+'/'; } else { return parts[parts.length-1]; } }, cleanPath: function (path) { return path.replace(/\/+/g, '/') .split('/').map(encodeURIComponent).join('/') .replace(/'/g, '%27'); }, bindAll: function (object) { for (var key in this) { if (typeof(object[key]) === 'function') { object[key] = object[key].bind(object); } } }, equal: function (a, b, seen) { var key; seen = seen || []; if (typeof(a) !== typeof(b)) { return false; } if (typeof(a) === 'number' || typeof(a) === 'boolean' || typeof(a) === 'string') { return a === b; } if (typeof(a) === 'function') { return a.toString() === b.toString(); } if (a instanceof ArrayBuffer && b instanceof ArrayBuffer) { // Without the following conversion the browsers wouldn't be able to // tell the ArrayBuffer instances apart. a = new Uint8Array(a); b = new Uint8Array(b); } // If this point has been reached, a and b are either arrays or objects. if (a instanceof Array) { if (a.length !== b.length) { return false; } for (var i = 0, c = a.length; i < c; i++) { if (!RemoteStorage.util.equal(a[i], b[i], seen)) { return false; } } } else { // Check that keys from a exist in b for (key in a) { if (a.hasOwnProperty(key) && !(key in b)) { return false; } } // Check that keys from b exist in a, and compare the values for (key in b) { if (!b.hasOwnProperty(key)) { continue; } if (!(key in a)) { return false; } var seenArg; if (typeof(b[key]) === 'object') { if (seen.indexOf(b[key]) >= 0) { // Circular reference, don't attempt to compare this object. // If nothing else returns false, the objects match. continue; } seenArg = seen.slice(); seenArg.push(b[key]); } if (!RemoteStorage.util.equal(a[key], b[key], seenArg)) { return false; } } } return true; }, equalObj: function (obj1, obj2) { console.warn('DEPRECATION WARNING: RemoteStorage.util.equalObj has been replaced by RemoteStorage.util.equal.'); return RemoteStorage.util.equal(obj1, obj2); }, deepClone: function (obj) { var clone; if (obj === undefined) { return undefined; } else { clone = JSON.parse(JSON.stringify(obj)); fixArrayBuffers(obj, clone); return clone; } }, pathsFromRoot: function (path) { var paths = [path]; var parts = path.replace(/\/$/, '').split('/'); while (parts.length > 1) { parts.pop(); paths.push(parts.join('/')+'/'); } return paths; }, /* jshint ignore:start */ md5sum: function(str) { // // http://www.myersdaily.org/joseph/javascript/md5.js // function md5cycle(x, k) { var a = x[0], b = x[1], c = x[2], d = x[3]; a = ff(a, b, c, d, k[0], 7, -680876936); d = ff(d, a, b, c, k[1], 12, -389564586); c = ff(c, d, a, b, k[2], 17, 606105819); b = ff(b, c, d, a, k[3], 22, -1044525330); a = ff(a, b, c, d, k[4], 7, -176418897); d = ff(d, a, b, c, k[5], 12, 1200080426); c = ff(c, d, a, b, k[6], 17, -1473231341); b = ff(b, c, d, a, k[7], 22, -45705983); a = ff(a, b, c, d, k[8], 7, 1770035416); d = ff(d, a, b, c, k[9], 12, -1958414417); c = ff(c, d, a, b, k[10], 17, -42063); b = ff(b, c, d, a, k[11], 22, -1990404162); a = ff(a, b, c, d, k[12], 7, 1804603682); d = ff(d, a, b, c, k[13], 12, -40341101); c = ff(c, d, a, b, k[14], 17, -1502002290); b = ff(b, c, d, a, k[15], 22, 1236535329); a = gg(a, b, c, d, k[1], 5, -165796510); d = gg(d, a, b, c, k[6], 9, -1069501632); c = gg(c, d, a, b, k[11], 14, 643717713); b = gg(b, c, d, a, k[0], 20, -373897302); a = gg(a, b, c, d, k[5], 5, -701558691); d = gg(d, a, b, c, k[10], 9, 38016083); c = gg(c, d, a, b, k[15], 14, -660478335); b = gg(b, c, d, a, k[4], 20, -405537848); a = gg(a, b, c, d, k[9], 5, 568446438); d = gg(d, a, b, c, k[14], 9, -1019803690); c = gg(c, d, a, b, k[3], 14, -187363961); b = gg(b, c, d, a, k[8], 20, 1163531501); a = gg(a, b, c, d, k[13], 5, -1444681467); d = gg(d, a, b, c, k[2], 9, -51403784); c = gg(c, d, a, b, k[7], 14, 1735328473); b = gg(b, c, d, a, k[12], 20, -1926607734); a = hh(a, b, c, d, k[5], 4, -378558); d = hh(d, a, b, c, k[8], 11, -2022574463); c = hh(c, d, a, b, k[11], 16, 1839030562); b = hh(b, c, d, a, k[14], 23, -35309556); a = hh(a, b, c, d, k[1], 4, -1530992060); d = hh(d, a, b, c, k[4], 11, 1272893353); c = hh(c, d, a, b, k[7], 16, -155497632); b = hh(b, c, d, a, k[10], 23, -1094730640); a = hh(a, b, c, d, k[13], 4, 681279174); d = hh(d, a, b, c, k[0], 11, -358537222); c = hh(c, d, a, b, k[3], 16, -722521979); b = hh(b, c, d, a, k[6], 23, 76029189); a = hh(a, b, c, d, k[9], 4, -640364487); d = hh(d, a, b, c, k[12], 11, -421815835); c = hh(c, d, a, b, k[15], 16, 530742520); b = hh(b, c, d, a, k[2], 23, -995338651); a = ii(a, b, c, d, k[0], 6, -198630844); d = ii(d, a, b, c, k[7], 10, 1126891415); c = ii(c, d, a, b, k[14], 15, -1416354905); b = ii(b, c, d, a, k[5], 21, -57434055); a = ii(a, b, c, d, k[12], 6, 1700485571); d = ii(d, a, b, c, k[3], 10, -1894986606); c = ii(c, d, a, b, k[10], 15, -1051523); b = ii(b, c, d, a, k[1], 21, -2054922799); a = ii(a, b, c, d, k[8], 6, 1873313359); d = ii(d, a, b, c, k[15], 10, -30611744); c = ii(c, d, a, b, k[6], 15, -1560198380); b = ii(b, c, d, a, k[13], 21, 1309151649); a = ii(a, b, c, d, k[4], 6, -145523070); d = ii(d, a, b, c, k[11], 10, -1120210379); c = ii(c, d, a, b, k[2], 15, 718787259); b = ii(b, c, d, a, k[9], 21, -343485551); x[0] = add32(a, x[0]); x[1] = add32(b, x[1]); x[2] = add32(c, x[2]); x[3] = add32(d, x[3]); } function cmn(q, a, b, x, s, t) { a = add32(add32(a, q), add32(x, t)); return add32((a << s) | (a >>> (32 - s)), b); } function ff(a, b, c, d, x, s, t) { return cmn((b & c) | ((~b) & d), a, b, x, s, t); } function gg(a, b, c, d, x, s, t) { return cmn((b & d) | (c & (~d)), a, b, x, s, t); } function hh(a, b, c, d, x, s, t) { return cmn(b ^ c ^ d, a, b, x, s, t); } function ii(a, b, c, d, x, s, t) { return cmn(c ^ (b | (~d)), a, b, x, s, t); } function md51(s) { txt = ''; var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i; for (i=64; i<=s.length; i+=64) { md5cycle(state, md5blk(s.substring(i-64, i))); } s = s.substring(i-64); var tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; for (i=0; i<s.length; i++) tail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3); tail[i>>2] |= 0x80 << ((i%4) << 3); if (i > 55) { md5cycle(state, tail); for (i=0; i<16; i++) tail[i] = 0; } tail[14] = n*8; md5cycle(state, tail); return state; } function md5blk(s) { var md5blks = [], i; for (i=0; i<64; i+=4) { md5blks[i>>2] = s.charCodeAt(i) + (s.charCodeAt(i+1) << 8) + (s.charCodeAt(i+2) << 16) + (s.charCodeAt(i+3) << 24); } return md5blks; } var hex_chr = '0123456789abcdef'.split(''); function rhex(n) { var s='', j=0; for(; j<4; j++) s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; return s; } function hex(x) { for (var i=0; i<x.length; i++) x[i] = rhex(x[i]); return x.join(''); } function md5(s) { return hex(md51(s)); } var add32 = function (a, b) { return (a + b) & 0xFFFFFFFF; }; if (md5('hello') !== '5d41402abc4b2a76b9719d911017c592') { add32 = function (x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF), msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }; } return md5(str); } /* jshint ignore:end */ }; if (!RemoteStorage.prototype.util) { Object.defineProperty(RemoteStorage.prototype, 'util', { get: function () { console.log('DEPRECATION WARNING: remoteStorage.util was moved to RemoteStorage.util'); return RemoteStorage.util; } }); } })(); /** FILE: src/eventhandling.js **/ (function (global) { /** * Interface: eventhandling */ var methods = { /** * Method: addEventListener * * Install an event handler for the given event name */ addEventListener: function (eventName, handler) { if (typeof(eventName) !== 'string') { throw new Error('Argument eventName should be a string'); } if (typeof(handler) !== 'function') { throw new Error('Argument handler should be a function'); } RemoteStorage.log('[Eventhandling] Adding event listener', eventName, handler); this._validateEvent(eventName); this._handlers[eventName].push(handler); }, /** * Method: removeEventListener * * Remove a previously installed event handler */ removeEventListener: function (eventName, handler) { this._validateEvent(eventName); var hl = this._handlers[eventName].length; for (var i=0;i<hl;i++) { if (this._handlers[eventName][i] === handler) { this._handlers[eventName].splice(i, 1); return; } } }, _emit: function (eventName) { this._validateEvent(eventName); var args = Array.prototype.slice.call(arguments, 1); this._handlers[eventName].forEach(function (handler) { handler.apply(this, args); }); }, _validateEvent: function (eventName) { if (! (eventName in this._handlers)) { throw new Error("Unknown event: " + eventName); } }, _delegateEvent: function (eventName, target) { target.on(eventName, function (event) { this._emit(eventName, event); }.bind(this)); }, _addEvent: function (eventName) { this._handlers[eventName] = []; } }; /** * Method: eventhandling.on * * Alias for <addEventListener> **/ methods.on = methods.addEventListener; /** * Function: eventHandling * * Mixes event handling functionality into an object. * * The first parameter is always the object to be extended. * All remaining parameter are expected to be strings, interpreted as valid event * names. * * Example: * (start code) * var MyConstructor = function () { * eventHandling(this, 'connected', 'disconnected'); * * this._emit('connected'); * this._emit('disconnected'); * // This would throw an exception: * // this._emit('something-else'); * }; * * var myObject = new MyConstructor(); * myObject.on('connected', function () { console.log('connected'); }); * myObject.on('disconnected', function () { console.log('disconnected'); }); * // This would throw an exception as well: * // myObject.on('something-else', function () {}); * (end code) */ RemoteStorage.eventHandling = function (object) { var eventNames = Array.prototype.slice.call(arguments, 1); for (var key in methods) { object[key] = methods[key]; } object._handlers = {}; eventNames.forEach(function (eventName) { object._addEvent(eventName); }); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/wireclient.js **/ (function (global) { var RS = RemoteStorage; /** * Class: RemoteStorage.WireClient * * WireClient Interface * -------------------- * * This file exposes a get/put/delete interface on top of XMLHttpRequest. * It requires to be configured with parameters about the remotestorage server to * connect to. * Each instance of WireClient is always associated with a single remotestorage * server and access token. * * Usually the WireClient instance can be accessed via `remoteStorage.remote`. * * This is the get/put/delete interface: * * - #get() takes a path and optionally a ifNoneMatch option carrying a version * string to check. It returns a promise that will be fulfilled with the HTTP * response status, the response body, the MIME type as returned in the * 'Content-Type' header and the current revision, as returned in the 'ETag' * header. * - #put() takes a path, the request body and a content type string. It also * accepts the ifMatch and ifNoneMatch options, that map to the If-Match and * If-None-Match headers respectively. See the remotestorage-01 specification * for details on handling these headers. It returns a promise, fulfilled with * the same values as the one for #get(). * - #delete() takes a path and the ifMatch option as well. It returns a promise * fulfilled with the same values as the one for #get(). * * In addition to this, the WireClient has some compatibility features to work with * remotestorage 2012.04 compatible storages. For example it will cache revisions * from folder listings in-memory and return them accordingly as the "revision" * parameter in response to #get() requests. Similarly it will return 404 when it * receives an empty folder listing, to mimic remotestorage-01 behavior. Note * that it is not always possible to know the revision beforehand, hence it may * be undefined at times (especially for caching-roots). */ var hasLocalStorage; var SETTINGS_KEY = 'remotestorage:wireclient'; var API_2012 = 1, API_00 = 2, API_01 = 3, API_02 = 4, API_HEAD = 5; var STORAGE_APIS = { 'draft-dejong-remotestorage-00': API_00, 'draft-dejong-remotestorage-01': API_01, 'draft-dejong-remotestorage-02': API_02, 'https://www.w3.org/community/rww/wiki/read-write-web-00#simple': API_2012 }; var isArrayBufferView; if (typeof(ArrayBufferView) === 'function') { isArrayBufferView = function (object) { return object && (object instanceof ArrayBufferView); }; } else { var arrayBufferViews = [ Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ]; isArrayBufferView = function (object) { for (var i=0;i<8;i++) { if (object instanceof arrayBufferViews[i]) { return true; } } return false; }; } var isFolder = RemoteStorage.util.isFolder; var cleanPath = RemoteStorage.util.cleanPath; function addQuotes(str) { if (typeof(str) !== 'string') { return str; } if (str === '*') { return '*'; } return '"' + str + '"'; } function stripQuotes(str) { if (typeof(str) !== 'string') { return str; } return str.replace(/^["']|["']$/g, ''); } function readBinaryData(content, mimeType, callback) { var blob; global.BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder; if (typeof global.BlobBuilder !== 'undefined') { var bb = new global.BlobBuilder(); bb.append(content); blob = bb.getBlob(mimeType); } else { blob = new Blob([content], { type: mimeType }); } var reader = new FileReader(); if (typeof reader.addEventListener === 'function') { reader.addEventListener('loadend', function () { callback(reader.result); // reader.result contains the contents of blob as a typed array }); } else { reader.onloadend = function() { callback(reader.result); // reader.result contains the contents of blob as a typed array }; } reader.readAsArrayBuffer(blob); } function getTextFromArrayBuffer(arrayBuffer, encoding) { var pending = Promise.defer(); if (typeof Blob === 'undefined') { var buffer = new Buffer(new Uint8Array(arrayBuffer)); pending.resolve(buffer.toString(encoding)); } else { var blob; global.BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder; if (typeof global.BlobBuilder !== 'undefined') { var bb = new global.BlobBuilder(); bb.append(arrayBuffer); blob = bb.getBlob(); } else { blob = new Blob([arrayBuffer]); } var fileReader = new FileReader(); if (typeof fileReader.addEventListener === 'function') { fileReader.addEventListener('loadend', function (evt) { pending.resolve(evt.target.result); }); } else { fileReader.onloadend = function(evt) { pending.resolve(evt.target.result); }; } fileReader.readAsText(blob, encoding); } return pending.promise; } function determineCharset(mimeType) { var charset = 'UTF-8'; var charsetMatch; if (mimeType) { charsetMatch = mimeType.match(/charset=(.+)$/); if (charsetMatch) { charset = charsetMatch[1]; } } return charset; } function isFolderDescription(body) { return ((body['@context'] === 'http://remotestorage.io/spec/folder-description') && (typeof(body['items']) === 'object')); } function isSuccessStatus(status) { return [201, 204, 304].indexOf(status) >= 0; } function isErrorStatus(status) { return [401, 403, 404, 412].indexOf(status) >= 0; } var onErrorCb; /** * Class : RemoteStorage.WireClient **/ RS.WireClient = function (rs) { this.connected = false; /** * Event: change * Never fired for some reason * # TODO create issue and fix or remove * * Event: connected * Fired when the wireclient connect method realizes that it is in * possession of a token and href **/ RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); onErrorCb = function (error){ if (error instanceof RemoteStorage.Unauthorized) { this.configure({token: null}); } }.bind(this); rs.on('error', onErrorCb); if (hasLocalStorage) { var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e) {} if (settings) { setTimeout(function () { this.configure(settings); }.bind(this), 0); } } this._revisionCache = {}; if (this.connected) { setTimeout(this._emit.bind(this), 0, 'connected'); } }; RS.WireClient.REQUEST_TIMEOUT = 30000; RS.WireClient.prototype = { /** * Property: token * * Holds the bearer token of this WireClient, as obtained in the OAuth dance * * Example: * (start code) * * remoteStorage.remote.token * // -> 'DEADBEEF01==' */ /** * Property: href * * Holds the server's base URL, as obtained in the Webfinger discovery * * Example: * (start code) * * remoteStorage.remote.href * // -> 'https://storage.example.com/users/jblogg/' */ /** * Property: storageApi * * Holds the spec version the server claims to be compatible with * * Example: * (start code) * * remoteStorage.remote.storageApi * // -> 'draft-dejong-remotestorage-01' */ _request: function (method, uri, token, headers, body, getEtag, fakeRevision) { if ((method === 'PUT' || method === 'DELETE') && uri[uri.length - 1] === '/') { return Promise.reject('Don\'t ' + method + ' on directories!'); } var revision; var reqType; var self = this; if (token !== RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN) { headers['Authorization'] = 'Bearer ' + token; } this._emit('wire-busy', { method: method, isFolder: isFolder(uri) }); return RS.WireClient.request(method, uri, { body: body, headers: headers, responseType: 'arraybuffer' }).then(function (response) { self._emit('wire-done', { method: method, isFolder: isFolder(uri), success: true }); self.online = true; if (isErrorStatus(response.status)) { RemoteStorage.log('[WireClient] Error response status', response.status); if (getEtag) { revision = stripQuotes(response.getResponseHeader('ETag')); } else { revision = undefined; } return Promise.resolve({statusCode: response.status, revision: revision}); } else if (isSuccessStatus(response.status) || (response.status === 200 && method !== 'GET')) { revision = stripQuotes(response.getResponseHeader('ETag')); RemoteStorage.log('[WireClient] Successful request', revision); return Promise.resolve({statusCode: response.status, revision: revision}); } else { var mimeType = response.getResponseHeader('Content-Type'); var body; if (getEtag) { revision = stripQuotes(response.getResponseHeader('ETag')); } else { revision = response.status === 200 ? fakeRevision : undefined; } var charset = determineCharset(mimeType); if ((!mimeType) || charset === 'binary') { RemoteStorage.log('[WireClient] Successful request with unknown or binary mime-type', revision); return Promise.resolve({statusCode: response.status, body: response.response, contentType: mimeType, revision: revision}); } else { return getTextFromArrayBuffer(response.response, charset).then(function (body) { RemoteStorage.log('[WireClient] Successful request', revision); return Promise.resolve({statusCode: response.status, body: body, contentType: mimeType, revision: revision}); }); } } }, function (error) { self._emit('wire-done', { method: method, isFolder: isFolder(uri), success: false }); return Promise.reject(error); }); }, /** * * Method: configure * * Sets the userAddress, href, storageApi, token, and properties of a * remote store. Also sets connected and online to true and emits the * 'connected' event, if both token and href are present. * * Parameters: * settings - An object that may contain userAddress (string or null), * href (string or null), storageApi (string or null), token (string * or null), and/or properties (the JSON-parsed properties object * from the user's WebFinger record, see section 10 of * http://tools.ietf.org/html/draft-dejong-remotestorage-03 * or null). * Fields that are not included (i.e. `undefined`), stay at * their current value. To set a field, include that field * with a `string` value. To reset a field, for instance when * the user disconnected their storage, or you found that the * token you have has expired, simply set that field to `null`. */ configure: function (settings) { if (typeof settings !== 'object') { throw new Error('WireClient configure settings parameter should be an object'); } if (typeof settings.userAddress !== 'undefined') { this.userAddress = settings.userAddress; } if (typeof settings.href !== 'undefined') { this.href = settings.href; } if (typeof settings.storageApi !== 'undefined') { this.storageApi = settings.storageApi; } if (typeof settings.token !== 'undefined') { this.token = settings.token; } if (typeof settings.properties !== 'undefined') { this.properties = settings.properties; } if (typeof this.storageApi !== 'undefined') { this._storageApi = STORAGE_APIS[this.storageApi] || API_HEAD; this.supportsRevs = this._storageApi >= API_00; } if (this.href && this.token) { this.connected = true; this.online = true; this._emit('connected'); } else { this.connected = false; } if (hasLocalStorage) { localStorage[SETTINGS_KEY] = JSON.stringify({ userAddress: this.userAddress, href: this.href, storageApi: this.storageApi, token: this.token, properties: this.properties }); } }, stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, get: function (path, options) { var self = this; if (!this.connected) { return Promise.reject('not connected (path: ' + path + ')'); } if (!options) { options = {}; } var headers = {}; if (this.supportsRevs) { if (options.ifNoneMatch) { headers['If-None-Match'] = addQuotes(options.ifNoneMatch); } } else if (options.ifNoneMatch) { var oldRev = this._revisionCache[path]; } return this._request('GET', this.href + cleanPath(path), this.token, headers, undefined, this.supportsRevs, this._revisionCache[path]) .then(function (r) { if (!isFolder(path)) { return Promise.resolve(r); } var itemsMap = {}; if (typeof(r.body) !== 'undefined') { try { r.body = JSON.parse(r.body); } catch (e) { return Promise.reject('Folder description at ' + self.href + cleanPath(path) + ' is not JSON'); } } if (r.statusCode === 200 && typeof(r.body) === 'object') { // New folder listing received if (Object.keys(r.body).length === 0) { // Empty folder listing of any spec r.statusCode = 404; } else if (isFolderDescription(r.body)) { // >= 02 spec for (var item in r.body.items) { self._revisionCache[path + item] = r.body.items[item].ETag; } itemsMap = r.body.items; } else { // < 02 spec Object.keys(r.body).forEach(function (key){ self._revisionCache[path + key] = r.body[key]; itemsMap[key] = {'ETag': r.body[key]}; }); } r.body = itemsMap; return Promise.resolve(r); } else { return Promise.resolve(r); } }); }, put: function (path, body, contentType, options) { if (!this.connected) { return Promise.reject('not connected (path: ' + path + ')'); } if (!options) { options = {}; } if ((!contentType.match(/charset=/)) && (body instanceof ArrayBuffer || isArrayBufferView(body))) { contentType += '; charset=binary'; } var headers = { 'Content-Type': contentType }; if (this.supportsRevs) { if (options.ifMatch) { headers['If-Match'] = addQuotes(options.ifMatch); } if (options.ifNoneMatch) { headers['If-None-Match'] = addQuotes(options.ifNoneMatch); } } return this._request('PUT', this.href + cleanPath(path), this.token, headers, body, this.supportsRevs); }, 'delete': function (path, options) { if (!this.connected) { throw new Error('not connected (path: ' + path + ')'); } if (!options) { options = {}; } var headers = {}; if (this.supportsRevs) { if (options.ifMatch) { headers['If-Match'] = addQuotes(options.ifMatch); } } return this._request('DELETE', this.href + cleanPath(path), this.token, headers, undefined, this.supportsRevs); } }; // Shared cleanPath used by Dropbox RS.WireClient.cleanPath = cleanPath; // Shared isArrayBufferView used by WireClient and Dropbox RS.WireClient.isArrayBufferView = isArrayBufferView; RS.WireClient.readBinaryData = readBinaryData; // Shared request function used by WireClient, GoogleDrive and Dropbox. RS.WireClient.request = function (method, url, options) { var pending = Promise.defer(); RemoteStorage.log('[WireClient]', method, url); var timedOut = false; var timer = setTimeout(function () { timedOut = true; pending.reject('timeout'); }, RS.WireClient.REQUEST_TIMEOUT); var xhr = new XMLHttpRequest(); xhr.open(method, url, true); if (options.responseType) { xhr.responseType = options.responseType; } if (options.headers) { for (var key in options.headers) { xhr.setRequestHeader(key, options.headers[key]); } } xhr.onload = function () { if (timedOut) { return; } clearTimeout(timer); pending.resolve(xhr); }; xhr.onerror = function (error) { if (timedOut) { return; } clearTimeout(timer); pending.reject(error); }; var body = options.body; if (typeof(body) === 'object' && !isArrayBufferView(body) && body instanceof ArrayBuffer) { body = new Uint8Array(body); } xhr.send(body); return pending.promise; }; Object.defineProperty(RemoteStorage.WireClient.prototype, 'storageType', { get: function () { if (this.storageApi) { var spec = this.storageApi.match(/draft-dejong-(remotestorage-\d\d)/); return spec ? spec[1] : '2012.04'; } } }); RS.WireClient._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); remoteStorage.remote = new RS.WireClient(remoteStorage); this.online = true; }; RS.WireClient._rs_supported = function () { return !! global.XMLHttpRequest; }; RS.WireClient._rs_cleanup = function (remoteStorage){ if (hasLocalStorage){ delete localStorage[SETTINGS_KEY]; } remoteStorage.removeEventListener('error', onErrorCb); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/discover.js **/ (function (global) { // feature detection flags var haveXMLHttpRequest, hasLocalStorage; // used to store settings in localStorage var SETTINGS_KEY = 'remotestorage:discover'; // cache loaded from localStorage var cachedInfo = {}; /** * Class: RemoteStorage.Discover * * This function deals with the Webfinger lookup, discovering a connecting * user's storage details. * * The discovery timeout can be configured via * `RemoteStorage.config.discoveryTimeout` (in ms). * * Arguments: * * userAddress - user@host * * Returns: * * A promise for an object with the following properties. * * href - Storage base URL, * storageType - Storage type, * authUrl - OAuth URL, * properties - Webfinger link properties **/ RemoteStorage.Discover = function (userAddress) { if (userAddress in cachedInfo) { return Promise.resolve(cachedInfo[userAddress]); } var webFinger = new WebFinger({ tls_only: false, uri_fallback: true, request_timeout: 5000 }); var pending = Promise.defer(); webFinger.lookup(userAddress, function (err, response) { if (err) { return pending.reject(err.message); } else if ((typeof response.idx.links.remotestorage !== 'object') || (typeof response.idx.links.remotestorage.length !== 'number') || (response.idx.links.remotestorage.length <= 0)) { RemoteStorage.log("[Discover] WebFinger record for " + userAddress + " does not have remotestorage defined in the links section ", JSON.stringify(response.json)); return pending.reject("WebFinger record for " + userAddress + " does not have remotestorage defined in the links section."); } var rs = response.idx.links.remotestorage[0]; var authURL = rs.properties['http://tools.ietf.org/html/rfc6749#section-4.2'] || rs.properties['auth-endpoint']; var storageType = rs.properties['http://remotestorage.io/spec/version'] || rs.type; // cache fetched data cachedInfo[userAddress] = { href: rs.href, storageType: storageType, authURL: authURL, properties: rs.properties }; if (hasLocalStorage) { localStorage[SETTINGS_KEY] = JSON.stringify({ cache: cachedInfo }); } return pending.resolve(cachedInfo[userAddress]); }); return pending.promise; }; RemoteStorage.Discover._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); if (hasLocalStorage) { var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e) {} if (settings) { cachedInfo = settings.cache; } } }; RemoteStorage.Discover._rs_supported = function () { haveXMLHttpRequest = !! global.XMLHttpRequest; return haveXMLHttpRequest; }; RemoteStorage.Discover._rs_cleanup = function () { if (hasLocalStorage) { delete localStorage[SETTINGS_KEY]; } }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: node_modules/webfinger.js/src/webfinger.js **/ /*! * webfinger.js * version 2.1.4 * http://github.com/silverbucket/webfinger.js * * Developed and Maintained by: * Nick Jennings <nick@silverbucket.net> 2012 - 2014 * * webfinger.js is released under the AGPL (see LICENSE). * * You don't have to do anything special to choose one license or the other and you don't * have to notify anyone which license you are using. * Please see the corresponding license file for details of these licenses. * You are free to use, modify and distribute this software, but all copyright * information must remain. * */ if (typeof XMLHttpRequest === 'undefined') { XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; } (function (undefined) { // URI to property name map var LINK_URI_MAPS = { 'http://webfist.org/spec/rel': 'webfist', 'http://webfinger.net/rel/avatar': 'avatar', 'remotestorage': 'remotestorage', 'remoteStorage': 'remotestorage', 'http://www.packetizer.com/rel/share': 'share', 'http://webfinger.net/rel/profile-page': 'profile', 'me': 'profile', 'vcard': 'vcard', 'blog': 'blog', 'http://packetizer.com/rel/blog': 'blog', 'http://schemas.google.com/g/2010#updates-from': 'updates', 'https://camlistore.org/rel/server': 'camilstore' }; var LINK_PROPERTIES = { 'avatar': [], 'remotestorage': [], 'blog': [], 'vcard': [], 'updates': [], 'share': [], 'profile': [], 'webfist': [], 'camilstore': [] }; // list of endpoints to try, fallback from beginning to end. var URIS = ['webfinger', 'host-meta', 'host-meta.json']; function _err(obj) { obj.toString = function () { return this.message; }; return obj; } /** * Function: WebFinger * * WebFinger constructor * * Returns: * * return WebFinger object */ function WebFinger(config) { if (typeof config !== 'object') { config = {}; } this.config = { tls_only: (typeof config.tls_only !== 'undefined') ? config.tls_only : true, webfist_fallback: (typeof config.webfist_fallback !== 'undefined') ? config.webfist_fallback : false, uri_fallback: (typeof config.uri_fallback !== 'undefined') ? config.uri_fallback : false, request_timeout: (typeof config.request_timeout !== 'undefined') ? config.request_timeout : 10000 }; } // make an http request and look for JRD response, fails if request fails // or response not json. WebFinger.prototype._fetchJRD = function (url, cb) { var self = this; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { if (self._isValidJSON(xhr.responseText)) { cb(null, xhr.responseText); } else { cb(_err({ message: 'invalid json', url: url, status: xhr.status })); } } else if (xhr.status === 404) { cb(_err({ message: 'endpoint unreachable', url: url, status: xhr.status })); } else { cb(_err({ message: 'error during request', url: url, status: xhr.status })); } } }; xhr.open('GET', url, true); xhr.setRequestHeader('Accept', 'application/jrd+json, application/json'); xhr.send(); }; WebFinger.prototype._isValidJSON = function (str) { try { JSON.parse(str); } catch (e) { return false; } return true; }; WebFinger.prototype._isLocalhost = function (host) { var local = /^localhost(\.localdomain)?(\:[0-9]+)?$/; return local.test(host); }; // processes JRD object as if it's a webfinger response object // looks for known properties and adds them to profile datat struct. WebFinger.prototype._processJRD = function (JRD, cb) { var self = this; var parsedJRD = JSON.parse(JRD); if ((typeof parsedJRD !== 'object') || (typeof parsedJRD.links !== 'object')) { if (typeof parsedJRD.error !== 'undefined') { cb(_err({ message: parsedJRD.error })); } else { cb(_err({ message: 'unknown response from server' })); } return false; } var links = parsedJRD.links; var result = { // webfinger JRD - object, json, and our own indexing object: parsedJRD, json: JRD, idx: {} }; result.idx.properties = { 'name': undefined }; result.idx.links = JSON.parse(JSON.stringify(LINK_PROPERTIES)); // process links links.map(function (link, i) { if (LINK_URI_MAPS.hasOwnProperty(link.rel)) { if (result.idx.links[LINK_URI_MAPS[link.rel]]) { var entry = {}; Object.keys(link).map(function (item, n) { entry[item] = link[item]; }); result.idx.links[LINK_URI_MAPS[link.rel]].push(entry); } } }); // process properties var props = JSON.parse(JRD).properties; for (var key in props) { if (props.hasOwnProperty(key)) { if (key === 'http://packetizer.com/ns/name') { result.idx.properties.name = props[key]; } } } cb(null, result); }; WebFinger.prototype.lookup = function (address, cb) { if (typeof address !== 'string') { throw new Error('first parameter must be a user address'); } else if (typeof cb !== 'function') { throw new Error('second parameter must be a callback'); } var self = this; var parts = address.replace(/ /g,'').split('@'); var host = parts[1]; // host name for this useraddress var uri_index = 0; // track which URIS we've tried already var protocol = 'https'; // we use https by default if (parts.length !== 2) { cb(_err({ message: 'invalid user address ' + address + ' ( expected format: user@host.com )' })); return false; } else if (self._isLocalhost(host)) { protocol = 'http'; } function _buildURL() { return protocol + '://' + host + '/.well-known/' + URIS[uri_index] + '?resource=acct:' + address; } // control flow for failures, what to do in various cases, etc. function _fallbackChecks(err) { if ((self.config.uri_fallback) && (host !== 'webfist.org') && (uri_index !== URIS.length - 1)) { // we have uris left to try uri_index = uri_index + 1; _call(); } else if ((!self.config.tls_only) && (protocol === 'https')) { // try normal http uri_index = 0; protocol = 'http'; _call(); } else if ((self.config.webfist_fallback) && (host !== 'webfist.org')) { // webfist attempt uri_index = 0; protocol = 'http'; host = 'webfist.org'; // webfist will // 1. make a query to the webfist server for the users account // 2. from the response, get a link to the actual webfinger json data // (stored somewhere in control of the user) // 3. make a request to that url and get the json // 4. process it like a normal webfinger response self._fetchJRD(_buildURL(), function (err, data) { // get link to users JRD if (err) { cb(err); return false; } self._processJRD(data, function (err, result) { if ((typeof result.idx.links.webfist === 'object') && (typeof result.idx.links.webfist[0].href === 'string')) { self._fetchJRD(result.idx.links.webfist[0].href, function (err, JRD) { if (err) { cb(err); } else { self._processJRD(JRD, cb); } }); } }); }); } else { cb(err); return false; } } function _call() { // make request self._fetchJRD(_buildURL(), function (err, JRD) { if (err) { _fallbackChecks(err); } else { self._processJRD(JRD, cb); } }); } setTimeout(_call, 0); }; if (typeof window === 'object') { window.WebFinger = WebFinger; } else if (typeof (define) === 'function' && define.amd) { define([], function () { return WebFinger; }); } else { try { module.exports = WebFinger; } catch (e) {} } })(); /** FILE: src/authorize.js **/ (function (global) { function extractParams(url) { //FF already decodes the URL fragment in document.location.hash, so use this instead: var location = url || RemoteStorage.Authorize.getLocation().href, hashPos = location.indexOf('#'), hash; if (hashPos === -1) { return; } hash = location.substring(hashPos+1); // if hash is not of the form #key=val&key=val, it's probably not for us if (hash.indexOf('=') === -1) { return; } return hash.split('&').reduce(function (m, kvs) { var kv = kvs.split('='); m[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); return m; }, {}); } RemoteStorage.ImpliedAuth = function (storageApi, redirectUri) { RemoteStorage.log('ImpliedAuth proceeding due to absent authURL; storageApi = ' + storageApi + ' redirectUri = ' + redirectUri); // Set a fixed access token, signalling to not send it as Bearer remoteStorage.remote.configure({ token: RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN }); document.location = redirectUri; }; RemoteStorage.Authorize = function (authURL, scope, redirectUri, clientId) { RemoteStorage.log('[Authorize] authURL = ', authURL, 'scope = ', scope, 'redirectUri = ', redirectUri, 'clientId = ', clientId); var url = authURL, hashPos = redirectUri.indexOf('#'); url += authURL.indexOf('?') > 0 ? '&' : '?'; url += 'redirect_uri=' + encodeURIComponent(redirectUri.replace(/#.*$/, '')); url += '&scope=' + encodeURIComponent(scope); url += '&client_id=' + encodeURIComponent(clientId); if (hashPos !== -1) { url += '&state=' + encodeURIComponent(redirectUri.substring(hashPos+1)); } url += '&response_type=token'; if (global.cordova) { return RemoteStorage.Authorize.openWindow( url, redirectUri, 'location=yes,clearsessioncache=yes,clearcache=yes' ) .then(function(authResult) { remoteStorage.remote.configure({ token: authResult.access_token }); // TODO // sync doesn't start until after reload // possibly missing some initialization step? global.location.reload(); }) .then(null, function(error) { console.error(error); remoteStorage.widget.view.setState('initial'); }); } RemoteStorage.Authorize.setLocation(url); }; RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN = false; RemoteStorage.prototype.authorize = function (authURL, cordovaRedirectUri) { this.access.setStorageType(this.remote.storageType); var scope = this.access.scopeParameter; var redirectUri = global.cordova ? cordovaRedirectUri : String(RemoteStorage.Authorize.getLocation()); var clientId = redirectUri.match(/^(https?:\/\/[^\/]+)/)[0]; RemoteStorage.Authorize(authURL, scope, redirectUri, clientId); }; /** * Get current document location * * Override this method if access to document.location is forbidden */ RemoteStorage.Authorize.getLocation = function () { return global.document.location; }; /** * Set current document location * * Override this method if access to document.location is forbidden */ RemoteStorage.Authorize.setLocation = function (location) { if (typeof location === 'string') { global.document.location.href = location; } else if (typeof location === 'object') { global.document.location = location; } else { throw "Invalid location " + location; } }; /** * Open new InAppBrowser window for OAuth in Cordova */ RemoteStorage.Authorize.openWindow = function (url, redirectUri, options) { var pending = Promise.defer(); var newWindow = global.open(url, '_blank', options); if (!newWindow || newWindow.closed) { pending.reject('Authorization popup was blocked'); return pending.promise; } var handleExit = function () { pending.reject('Authorization was canceled'); }; var handleLoadstart = function (event) { if (event.url.indexOf(redirectUri) !== 0) { return; } newWindow.removeEventListener('exit', handleExit); newWindow.close(); var authResult = extractParams(event.url); if (!authResult) { return pending.reject('Authorization error'); } return pending.resolve(authResult); }; newWindow.addEventListener('loadstart', handleLoadstart); newWindow.addEventListener('exit', handleExit); return pending.promise; }; RemoteStorage.prototype.impliedauth = function () { RemoteStorage.ImpliedAuth(this.remote.storageApi, String(document.location)); }; RemoteStorage.Authorize._rs_supported = function () { return typeof(document) !== 'undefined'; }; var onFeaturesLoaded; RemoteStorage.Authorize._rs_init = function (remoteStorage) { onFeaturesLoaded = function () { var authParamsUsed = false; if (params) { if (params.error) { throw "Authorization server errored: " + params.error; } if (params.access_token) { remoteStorage.remote.configure({ token: params.access_token }); authParamsUsed = true; } if (params.remotestorage) { remoteStorage.connect(params.remotestorage); authParamsUsed = true; } if (params.state) { RemoteStorage.Authorize.setLocation('#'+params.state); } } if (!authParamsUsed) { remoteStorage.remote.stopWaitingForToken(); } }; var params = extractParams(), location; if (params) { location = RemoteStorage.Authorize.getLocation(); location.hash = ''; } remoteStorage.on('features-loaded', onFeaturesLoaded); }; RemoteStorage.Authorize._rs_cleanup = function (remoteStorage) { remoteStorage.removeEventListener('features-loaded', onFeaturesLoaded); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/access.js **/ (function(global) { var SETTINGS_KEY = "remotestorage:access"; /** * Class: RemoteStorage.Access * * Keeps track of claimed access and scopes. */ RemoteStorage.Access = function() { this.reset(); }; RemoteStorage.Access.prototype = { /** * Method: claim * * Claim access on a given scope with given mode. * * Parameters: * scope - An access scope, such as "contacts" or "calendar" * mode - Access mode. Either "r" for read-only or "rw" for read/write * * Example: * (start code) * remoteStorage.access.claim('contacts', 'r'); * remoteStorage.access.claim('pictures', 'rw'); * (end code) * * Root access: * Claiming root access, meaning complete access to all files and folders * of a storage, can be done using an asterisk: * * (start code) * remoteStorage.access.claim('*', 'rw'); * (end code) */ claim: function(scope, mode) { if (typeof(scope) !== 'string' || scope.indexOf('/') !== -1 || scope.length === 0) { throw new Error('Scope should be a non-empty string without forward slashes'); } if (!mode.match(/^rw?$/)) { throw new Error('Mode should be either \'r\' or \'rw\''); } this._adjustRootPaths(scope); this.scopeModeMap[scope] = mode; }, get: function(scope) { return this.scopeModeMap[scope]; }, remove: function(scope) { var savedMap = {}; var name; for (name in this.scopeModeMap) { savedMap[name] = this.scopeModeMap[name]; } this.reset(); delete savedMap[scope]; for (name in savedMap) { this.set(name, savedMap[name]); } }, /** * Verify permission for a given scope. */ checkPermission: function(scope, mode) { var actualMode = this.get(scope); return actualMode && (mode === 'r' || actualMode === 'rw'); }, /** * Verify permission for a given path. */ checkPathPermission: function(path, mode) { if (this.checkPermission('*', mode)) { return true; } return !!this.checkPermission(this._getModuleName(path), mode); }, reset: function() { this.rootPaths = []; this.scopeModeMap = {}; }, /** * Return the module name for a given path. */ _getModuleName: function(path) { if (path[0] !== '/') { throw new Error('Path should start with a slash'); } var moduleMatch = path.replace(/^\/public/, '').match(/^\/([^\/]*)\//); return moduleMatch ? moduleMatch[1] : '*'; }, _adjustRootPaths: function(newScope) { if ('*' in this.scopeModeMap || newScope === '*') { this.rootPaths = ['/']; } else if (! (newScope in this.scopeModeMap)) { this.rootPaths.push('/' + newScope + '/'); this.rootPaths.push('/public/' + newScope + '/'); } }, _scopeNameForParameter: function(scope) { if (scope.name === '*' && this.storageType) { if (this.storageType === '2012.04') { return ''; } else if (this.storageType.match(/remotestorage-0[01]/)) { return 'root'; } } return scope.name; }, setStorageType: function(type) { this.storageType = type; } }; /** * Property: scopes * * Holds an array of claimed scopes in the form * > { name: "<scope-name>", mode: "<mode>" } */ Object.defineProperty(RemoteStorage.Access.prototype, 'scopes', { get: function() { return Object.keys(this.scopeModeMap).map(function(key) { return { name: key, mode: this.scopeModeMap[key] }; }.bind(this)); } }); Object.defineProperty(RemoteStorage.Access.prototype, 'scopeParameter', { get: function() { return this.scopes.map(function(scope) { return this._scopeNameForParameter(scope) + ':' + scope.mode; }.bind(this)).join(' '); } }); // Documented in src/remotestorage.js Object.defineProperty(RemoteStorage.prototype, 'access', { get: function() { var access = new RemoteStorage.Access(); Object.defineProperty(this, 'access', { value: access }); return access; }, configurable: true }); RemoteStorage.Access._rs_init = function() {}; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/env.js **/ (function (pMode) { var mode = pMode, env = {}, isBackground = false; RemoteStorage.Env = function () { return env; }; RemoteStorage.Env.isBrowser = function () { return mode === "browser"; }; RemoteStorage.Env.isNode = function () { return mode === "node"; }; RemoteStorage.Env.goBackground = function () { isBackground = true; RemoteStorage.Env._emit("background"); }; RemoteStorage.Env.goForeground = function () { isBackground = false; RemoteStorage.Env._emit("foreground"); }; RemoteStorage.Env._rs_init = function (remoteStorage) { RemoteStorage.eventHandling(RemoteStorage.Env, "background", "foreground"); function visibility() { if (document[env.hiddenProperty]) { RemoteStorage.Env.goBackground(); } else { RemoteStorage.Env.goForeground(); } } if ( mode === 'browser') { if ( typeof(document.hidden) !== "undefined" ) { env.hiddenProperty = "hidden"; env.visibilityChangeEvent = "visibilitychange"; } else if ( typeof(document.mozHidden) !== "undefined" ) { env.hiddenProperty = "mozHidden"; env.visibilityChangeEvent = "mozvisibilitychange"; } else if ( typeof(document.msHidden) !== "undefined" ) { env.hiddenProperty = "msHidden"; env.visibilityChangeEvent = "msvisibilitychange"; } else if ( typeof(document.webkitHidden) !== "undefined" ) { env.hiddenProperty = "webkitHidden"; env.visibilityChangeEvent = "webkitvisibilitychange"; } document.addEventListener(env.visibilityChangeEvent, visibility, false); visibility(); } }; RemoteStorage.Env._rs_cleanup = function (remoteStorage) { }; })(typeof(window) !== 'undefined' ? 'browser' : 'node'); /** FILE: src/i18n.js **/ (function () { /** * Class: RemoteStorage.I18n * * TODO add documentation **/ "use strict"; var dictionary = { "view_info": 'This app allows you to use your own storage. <a href="http://remotestorage.io/" target="_blank">Learn more!</a>', "view_connect": "<strong>Connect</strong> remote storage", "view_connecting": "Connecting <strong>%s</strong>", "view_offline": "Offline", "view_error_occured": "Sorry! An error occured.", "view_invalid_key": "Wrong key!", "view_confirm_reset": "Are you sure you want to reset everything? This will clear your local data and reload the page.", "view_get_me_out": "Get me out of here!", "view_error_plz_report": 'If this problem persists, please <a href="http://remotestorage.io/community/" target="_blank">let us know</a>!', "view_unauthorized": "Unauthorized! Click here to reconnect." }; RemoteStorage.I18n = { translate: function () { var str = arguments[0], params = Array.prototype.splice.call(arguments, 1); if (typeof dictionary[str] !== "string") { throw "Unknown translation string: " + str; } else { str = dictionary[str]; } return (str.replace(/%s/g, function (){ return params.shift(); })); }, getDictionary: function () { return dictionary; }, setDictionary: function (newDictionary) { dictionary = newDictionary; } }; })(); /** FILE: src/assets.js **/ /** THIS FILE WAS GENERATED BY build/compile-assets.js. DO NOT CHANGE IT MANUALLY, BUT INSTEAD CHANGE THE ASSETS IN assets/. **/ RemoteStorage.Assets = { cipherIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHdpZHRoPSIyNS4xNzciIHZlcnNpb249IjEuMSIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxwYXRoIGQ9Im0yNS4xNzcgNS41MzIzYy0wLjA1NjQtMC4xMTI5MS0wLjA1NjQtMC4yMjU4MS0wLjE2OTM2LTAuMzM4NzEtMC4xMTI5LTAuMTEyOS0wLjI4MjI1LTAuMTY5MzYtMC4zOTUxNi0wLjE2OTM2aC0xMS40MDNjLTAuNzMzLTIuODc5LTMuMzg2NC01LjAyNDItNi40OTEzLTUuMDI0Mi0zLjY2OTMgMC02LjcxNzcgMy4wNDg0LTYuNzE3NyA2LjcxNzcgMCAzLjcyNjMgMy4wNDg0IDYuNzE3MyA2LjcxNzcgNi43MTczIDMuMzMwNyAwIDYuMDQwMy0yLjQyNzQgNi42MDQ4LTUuNTg4N2gyLjU0MDN2My42Njk0YzAgMC4yODIyNiAwLjI4MjI2IDAuNTA4MDYgMC41NjQ1MiAwLjUwODA2aDEuNzVjMC4yODIyNiAwIDAuNTY0NTItMC4yMjU4IDAuNTY0NTItMC41MDgwNnYtMy42Njk0aDEuNDY3N3Y1LjY0NTJjMCAwLjI4MjI1IDAuMjI1OCAwLjUwODA2IDAuNTA4MDYgMC41MDgwNmgxLjgwNjRjMC4yODIyNiAwIDAuNTA4MDctMC4yMjU4MSAwLjU2NDUyLTAuNTA4MDZ2LTUuNjQ1MmgxLjUyNDJjMC4xMTI5MSAwIDAuMjgyMjYgMCAwLjM5NTE2LTAuMTEyOSAwLjExMjkxLTAuMTEyOSAwLjE2OTM2LTAuMjgyMjYgMC4xNjkzNi0wLjM5NTE2di0xLjgwNjR6bS0xOC40NTkgNS4wODA3Yy0yLjA4ODcgMC0zLjgzODctMS42OTM2LTMuODM4Ny0zLjgzODcgMC0yLjE0NTIgMS43NS0zLjgzODcgMy44Mzg3LTMuODM4NyAyLjE0NTIgMCAzLjgzODcgMS42OTM2IDMuODM4NyAzLjgzODcgMCAyLjE0NTItMS42OTM2IDMuODM4Ny0zLjgzODcgMy44Mzg3eiIgZmlsbD0iI2ZmZiIvPgo8L3N2Zz4K', connectIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMTAzNi40KSI+CiAgPHBhdGggZD0ibTEgMTA0Ny40di02aDd2LTRsNyA3LTcgN3YtNHoiIGZpbGw9IiNmZmYiLz4KIDwvZz4KPC9zdmc+Cg==', disconnectIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4wIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxwYXRoIHN0eWxlPSJibG9jay1wcm9ncmVzc2lvbjp0Yjt0ZXh0LWluZGVudDowO2NvbG9yOiMwMDAwMDA7dGV4dC10cmFuc2Zvcm06bm9uZSIgZD0ibTguMDAwMSAwYy0wLjQ3MTQgMC0wLjk2MTAzIDAuNTQxOS0wLjk1IDF2NmMtMC4wMDc0NyAwLjUyODMxIDAuNDIxNjMgMSAwLjk1IDFzMC45NTc0Ny0wLjQ3MTY5IDAuOTUtMXYtNmMwLjAxNDYyMi0wLjYwNTEtMC40Nzg2LTEtMC45NS0xem0tMy4zNDM4IDIuNWMtMC4wODcxODYgMC4wMTkyOTQtMC4xNzE2MyAwLjA1MDk1OS0wLjI1IDAuMDkzNzUtMi45OTk1IDEuNTcxNS0zLjkxODQgNC43OTc5LTMuMTI1IDcuNDY4OCAwLjc5MzQgMi42NyAzLjI3OTkgNC45MzcgNi42ODc1IDQuOTM3IDMuMzU5MiAwIDUuODc3Mi0yLjE0OSA2LjcxOTItNC43ODEgMC44NDEtMi42MzIxLTAuMDU4LTUuODIzNC0zLjEyNS03LjU5NC0wLjQzNC0wLjI1MzYtMS4wNTktMC4wODk5LTEuMzEzIDAuMzQzNy0wLjI1MzYgMC40MzM2LTAuMDkgMS4wNTg5IDAuMzQ0IDEuMzEyNSAyLjM5MDggMS4zNzk4IDIuODgyNSAzLjQ5NDQgMi4yODEyIDUuMzc1LTAuNjAxMiAxLjg4MDYtMi4zNDQgMy40Mzc1LTQuOTA2MiAzLjQzNzUtMi41NzU5IDAtNC4yOTc2LTEuNjUwMi00Ljg3NS0zLjU5MzgtMC41Nzc2LTEuOTQzNS0wLjA0Ny00LjA0OCAyLjE4NzMtNS4yMTg3IDAuMzc4Ny0wLjIwNjMgMC41NzkxLTAuNjkyNSAwLjQ1NTgtMS4xMDU3LTAuMTIzMi0wLjQxMzMtMC41NTcyLTAuNzEwMy0wLjk4Ny0wLjY3NTUtMC4wMzEzLTAuMDAxNS0wLjA2MjYtMC4wMDE1LTAuMDkzOCAweiIgZmlsbD0iI2ZmZiIvPgo8L3N2Zz4K', dropbox: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgPEBAhEOpfuQAABhZJREFUWMPVl31snVUdxz+/5/2577e3b7QbHaOD0nXshW4ZZkpGQmJYZkJUDAaZzCBGAxGd+pdZQsJIjCaKgFu09GWybIggm8yhMCsY92rcOkPHunbdtKOUbX36svX23uc+xz+eDsrWlztiNJzk5D7JPS+fc8739/2dA5+EsqJtyK18ZlCKbX9Lk6fd1uo5xbTVZmtwa4v35Np5Mry4TLYXCzAnyhsry2SwrmnokdnaTruq6i3e0lXl0tqQlkURCxwdDp9Th5p3+p9iS8afqk/VZq9kaZoDN8apdU3B1KFnmLde7AkezH0n3V0UQOJpz2hIsqEhLU+WOeAagmtCxISYBe1nVf4vfWrByYdSpyf3W9ziLapy6JgbAduAiBn2S1rCQBYODAQP7H01/zxby4JpAW5s8mproxypiRKNGIJrQNT8EMA1wTGEU8MBP/q7umPw0dSbAA3N3n3zI2yLG2oScPgbNYWICY4Be86o/le6g0W576bPXQWwcqvXdJ2t1idMsA1hJoCoCRfGYdOhwsa4TUWFrr7pGmDrzAiQCHfD//Xxwk/33Z/6HoA0tnhLXZ3XMoYqsy4PYs4M4Ohg6pB2ddqO+vR6BWL27AARXbBNiBjwh9Oqs+O8ukcT4eaopjLqGsJSCdSX29SX23x/lctXlzgE1zBAANxWIQuGxlWNACxr8WozJp0lljKsGXbA0qGu1GRBxsTUQRAGLgboIuQVvHI8S+f7eeK2TLsDSQd296rhPaeDm09+PdX/gQYqN3uZ+jh7ro+oRusKDdgmVEY1GqstSiOhdegCmoQAIoImIWTPYIHdXVlyBYhaVwLA70+rPz7fllvLi2W5KcPw9q3eS/VJ7kmYgm1A3BIWV5osq7IIlMLUQJOrAXQBXQtr1BR2d2XpOu8TtULR+gq2nQh+vv8rqUdnNaKGZm/9qnJpmp/U+fxCB5lYsaGFdTYAY9L3jmNj9F9S7OgKVh9/KNVelBVf8untv8TYSS8gbsrHyh8C2LqQtGE0z9CJYfVuUblgRZv3WGOJvJG0cF8/lWPNdo+O93xsHYoVuqkL/xzIs/HPHt2DPg0Zko+v0I8vbfHun9aKE5sH9YaobJsf5V4mRLXv33kSlmAYwspqgw23R7A1EJlahKYOSsHTB0cZHQ9IOBA3NSrjGo4hWAY82xH8rH1b/jF2laoPAOb80jPqYtKTMdRcTQNd+xAgbgmuJbiGELfh3lsc7q41KQSTABBcC1qPjLH/XzniNqScsP1kgMsm9nJ34e2mNcmFAMby1qFPZyz1WlxXrprhuEUgUPDbd8Y59n6edbe61KZ1TF14vSfPLw5dYjhXIOMIM6lGAV+u0+tv+ttI/2+6/LsMQVXpUFCAqJkS9MT5anB2NGDjWxf5Yp3DvjN5th/LUhETolaRTqigxMGIWVKtHVyX2tGTJd2X5agUIfi8CmvUFOKGT++gT8wqLlKUgnwATxwq7P32m35Z+32pPQZA54MpH1iSb/XWZmx2VthTD1AATCBlCZ+dpwNg6EJjlUH3hQIKRaCujhZFaOPtfUH+8HvBnQceSP11yjA8vC616+A5FevL8jt/YiCR0HiQcAUVrnDHHO0jHTUNllXrpC0NRXiefjAxM4rhHLzQpZqf+eFFd/LkM17JGlu9p+xC8IgPhGlaqE1rNJZrxOzQok0dnjviY+nhbSntCH3DAWN+QMIWEhYsqTD4wYHChrPfSP9kqnmM6QAMkYtz4xqmDqeGA+rLNObGZVozkglx1ZfqZAvC2ZGAz9RYlEbAlsLoNd+Kx5RqO5/njKXDsnKdhCXFOaFAZUzjznlhyt5xIjiSLbBz2oVO98fRdalOoGZ5m/dUQ4pvJZ3Zr/CXlS5A74gabzlYePztr6U2faxr+eRy/RYvtjgjHauvkxvi9oTDXaGBuAUJWyh1hb3vqsOvfiG5/L/yMAE483BqdNeuXO3LvcGX3vEUhsZVsaYL9IzACz3BXcVOXvQOfKRsupBZv8R4bnW19rmqGPzqHz4BcMGn5U/Hgod5oiT3P3kvVj7rrfnx/pHBu7d7Azc1eY3/l0drzWbPXNjsGXySy38AbtMqneWU7BkAAAAASUVORK5CYII=', googledrive: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgPEA85ztzJcQAABZVJREFUWMPtl1uoXVcVhr8x5tprn7M1NG1i0pQqSG2jLcXipYJXjPogqFgpaHMSFUkpIjU+leKbDxIQSiHgjZgmrfXgQ6SKj5Ji7YVS05aUUqKQlNLQeDnN5Zzk9Jy99xy/D3OttU/StDlV33TBZM3FXmuMf/5jjv+fG/7XL1vti9tnv3Dtnnf+87JY8YmZNxEMM1sZ7tWpjz764mriVqvKvmfb1ONLy3+dGyWu6EWbvQwoydv5BMSqFuereakmfnls1GP25IDaBGYYjplhljDz5tk7YMtPfurAf6UE9Z6tNwDPAPXwtcxL1x9n4zRgDjjm1gCyC6JpCLoW/OX65of1nzCwG6gNo3aYeXF981mTvK2/WWFiMmoj7X+z5JcE0N87c4e7b3EvyTwZT5/r8ezZHu6GuWGpSegJ8/ZeBu6fHv35s1/7t0rQv29mjWF/ATZ1L4bQwohrpkYc/sBpwhJYAVdKYECzYAESIk4Am3sf+sPCW2LAzb9jbpvMDXfD3fEqkRIcGdbsevlt9LylPYG1K6/K3QzK75uAr78lBgb3b7sc2cl2Uaa21sDiGMvB2iQeu/EMm6bKHjD3SUsCEChnpEAKiLisd/PB+UsyMPjZNwzzh1ixcnOfsFCX51NU/PTvA6pkTUdYw4R3zyu1ArMDqyvBQB82+FiJUQJ4C8YgVT1SSvSTs+vEmkcwe7qEsUnt233Aij0BW4ZPbfngKpRQs7hXpYQNvRiuEtATWOW4bLi+z04pJbCnBAkBJggBQlIBIZCUJM0Cm9+QgcED2+/G7BprdMZaAFZExm1FWcz+NLdj32G/6XfPCB5GoJKp7H5FARHRtgRI1y0/+cm7Lwpg+v7t64DvNd5S2mqirKXHy6RoArp1Ykrc2hKtKCtXlNEyoQ6Ydi498fF1F2FAdwEbV9UnZne+8q19Z7o63vTb+TPnRneeWxwxHGdyziii6wApQNEydKUUd5wHYGrftvci7tKKLSME5bvCaruynI9rNL7vdZgiHhiP898Wl8bMnxty+uyIhcURo1FgjSg1DCDph4uPfuR9AFbvvS25p2cxbiyKVuh2o1O44n2lLLacb5v75v5fX6yl5h753IwUD+YcRAQ5B6FMMhj0jboSRhnAE258wvp7Z7aYcbCYCeCGt97ubfICLDP/q4WZ32x7M20fPfb+hxbH9ZdjHOQIIoR74EDywA3coa6MqtJnrP+LmRmcB63ob8dA1wllRm95LVc//22S16TGeKqqpqoHk10ESGJj/zjjgIhAISKCyJmcY6Uu8Pbq7C0V6ABh35dzvYWQG0QAhmSYCaUlNhzdCrlX2jpE6tV4b9DYcGFKEgG8svQucoicC4CsII8zeTxutAEQzx1duPL3vrxjdlnou0SDLdTulxJQmalXNzN98jpEJiSo+qTeoEnsnWC5lVZNRhkOZiq0G8XCmz1gpp3j/ZYdYLhj9qCkn3fJQ4QKeh9OccWxz6O0hGKM9wakeoBEZ1BmqfOMyYFk4gXS+edG4J4ju6/644VK+AOJhSIYpVRBpn/qPVRL65A51dRavJoG2UQkOqf0hgVrGG7u6syoJDObB+55nRANb589Afy40W0UwkY91h39CiLweg1UU+W3ohLNvC2VurJ1htR6A3QaYPCjI7uvOvGGOlfv2XoSuBzEhmNfZXDqBrweUPVqUlWodneSG+6J1NTevThfDpEjmnsmzuuCPPfCvRvfcakT0S2Aeq9tYPr0ZryeBvOOlZBKUIEiCAVZwTgy41x6v6hm0LFZ4o7N7IuXPA+EDx+XjQ+tP/4lUrW2vCI1ydR0iYgmWdtu4yzG7bOiAdn8iYlA0iFJh1Z1JJv+ye2b3n1419XRH2riP0aqqlKClABIjUMW+rtSlw5qmCpgsynnl56/d+M/+P91wfUvQjDgTzx9h9AAAAAASUVORK5CYII=', nocipherIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogPHBhdGggZD0ibSAxMy4yMDMxMjQsMTEuNzczNDM4IGMgMC4yODEyNSwwLjI4MTI1IDAuNDIxODc1LDAuNjA5Mzc1IDAuNDIxODc1LDEuMDMxMjUgMCwwLjM3NSAtMC4xNDA2MjUsMC43NSAtMC40MjE4NzUsMS4wMzEyNSAtMC4yODEyNSwwLjIzNDM3NSAtMC42MDkzNzUsMC4zNzUgLTEuMDMxMjUsMC4zNzUgLTAuMzc1LDAgLTAuNzUsLTAuMTQwNjI1IC0xLjAzMTI1LC0wLjM3NSAwLDAgLTMuMTg3NDk4MSwtMy42NTYyNSAtMy4xODc0OTgxLC0zLjY1NjI1IDAsMCAtMy4xNDA2MjUsMy42NTYyNSAtMy4xNDA2MjUsMy42NTYyNSAtMC4yODEyNSwwLjIzNDM3NSAtMC42NTYyNSwwLjM3NSAtMS4wMzEyNSwwLjM3NSAtMC40MjE4NzUsMCAtMC43NSwtMC4xNDA2MjUgLTEuMDMxMjUsLTAuMzc1IC0wLjI4MTI1LC0wLjI4MTI1IC0wLjM3NSwtMC42NTYyNSAtMC4zNzUsLTEuMDMxMjUgMCwtMC40MjE4NzUgMC4wOTM3NSwtMC43NSAwLjM3NSwtMS4wMzEyNSAwLDAgMy4zMjgxMjUsLTMuNzUwMDAwNSAzLjMyODEyNSwtMy43NTAwMDA1IDAsMCAtMy4zMjgxMjUsLTMuNzk2ODc1IC0zLjMyODEyNSwtMy43OTY4NzUgLTAuMjgxMjUsLTAuMjgxMjUgLTAuMzc1LC0wLjYwOTM3NSAtMC4zNzUsLTEuMDMxMjUgMCwtMC4zNzUgMC4wOTM3NSwtMC43NSAwLjM3NSwtMS4wMzEyNSAwLjI4MTI1LC0wLjIzNDM3NSAwLjYwOTM3NSwtMC4zNzUgMS4wMzEyNSwtMC4zNzUgMC4zNzUsMCAwLjc1LDAuMTQwNjI1IDEuMDMxMjUsMC4zNzUgMCwwIDMuMTQwNjI1LDMuNjU2MjUgMy4xNDA2MjUsMy42NTYyNSAwLDAgMy4xODc0OTgxLC0zLjY1NjI1IDMuMTg3NDk4MSwtMy42NTYyNSAwLjI4MTI1LC0wLjIzNDM3NSAwLjY1NjI1LC0wLjM3NSAxLjAzMTI1LC0wLjM3NSAwLjQyMTg3NSwwIDAuNzUsMC4xNDA2MjUgMS4wMzEyNSwwLjM3NSAwLjI4MTI1LDAuMjgxMjUgMC40MjE4NzUsMC42NTYyNSAwLjQyMTg3NSwxLjAzMTI1IDAsMC40MjE4NzUgLTAuMTQwNjI1LDAuNzUgLTAuNDIxODc1LDEuMDMxMjUgMCwwIC0zLjMyODEyMzEsMy43OTY4NzUgLTMuMzI4MTIzMSwzLjc5Njg3NSAwLDAgMy4zMjgxMjMxLDMuNzUwMDAwNSAzLjMyODEyMzEsMy43NTAwMDA1IiBmaWxsPSIjZmZmIi8+Cjwvc3ZnPgo=', remoteStorageIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZmNGEwNCIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZmY0YTA0IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', remoteStorageIconCiphered: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZmNGEwNCIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZmY0YTA0IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xNiAwbDAuMTI1IDYuMzc1YzIuMDk4IDAuMDY3IDMuNzUgMS43NTk1IDMuNzUgMy44NzV2MS45NjloMS45MzcgMC4wMzJsOC00LjIxOS0xMy44NDQtOHpsLTEzLjg0NCA4IDggNC4yMTloMC4wMzIgMS45MDZ2LTEuOTY5YzAtMi4xMTU1IDEuNjgzLTMuODA4IDMuNzgxLTMuODc1bDAuMTI1LTYuMzc1em0tMTMuODQ0IDh2MTZsNy45OTk4LTQuODQ0di02LjA5NGwtNy45OTk4LTUuMDYyem0wIDE2bDEzLjg0NCA4LTAuMzc1LTEwLjA2MmgtNS40Njl2LTIuMzQ0bC03Ljk5OTggNC40MDZ6bTEzLjg0NCA4bDEzLjg0NC04LTgtNC40MDZ2Mi4zNDRoLTUuNDY5bC0wLjM3NSAxMC4wNjJ6bTEzLjg0NC04di0xNmwtOCA1LjA2MnY2LjA5NGw4IDQuODQ0em0tMTMuOTY5LTE3Yy0xLjczNSAwLjA2NjYtMy4xMjUgMS40OTg3LTMuMTI1IDMuMjV2MS45NjloMy4wMzFsMC4wOTQtNS4yMTl6bTAuMjUgMGwwLjA5NCA1LjIxOWgzLjAzMXYtMS45NjljMC0xLjc1MTMtMS4zOS0zLjE4MzQtMy4xMjUtMy4yNXptLTQuNzUgNS44NDRsNC4zNDQgMi4yODEgMC4wMzEtMi4yODFoLTQuMzc1em00Ljg3NSAwbDAuMDMxIDIuMjgxIDQuMzQ0LTIuMjgxaC00LjM3NXptLTUuNDM4IDAuNjI1djUuMzEybDQuMjgyLTIuNTkzLTQuMjgyLTIuNzE5em0xMC4zNzYgMGwtNC4yODIgMi43MTkgNC4yODIgMi41OTN2LTUuMzEyem0tNS43ODIgMy4yMTlsLTQuNTk0IDIuNTMxdjIuMDYyaDQuNzgybC0wLjE4OC00LjU5M3ptMS4xODggMGwtMC4xODggNC41OTNoNC43ODJ2LTIuMDYybC00LjU5NC0yLjUzMXoiIGZpbGw9InVybCgjYSkiLz4KPC9zdmc+Cg==', remoteStorageIconError: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2U5MDAwMCIgc3RvcC1vcGFjaXR5PSIuNzYwNzgiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZTkwMDAwIiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', remoteStorageIconOffline: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5Njk2OSIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjNjc2NzY3IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', syncIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDg3LjUgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTUuOTk5OTk5IDE2IiB3aWR0aD0iMTYiIHZlcnNpb249IjEuMSIgeT0iMHB4IiB4PSIwcHgiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01LjUxMTIgLTc2LjUyNSkiIGRpc3BsYXk9Im5vbmUiPgoJPHBhdGggZGlzcGxheT0iaW5saW5lIiBkPSJtNTEuNDczIDQyLjI1NS0yLjIwNSAyLjIxMmMxLjQ3OCAxLjQ3NyAyLjI5NSAzLjQ0MiAyLjI5NSA1LjUzMyAwIDQuMzA5LTMuNTA0IDcuODEyLTcuODEyIDcuODEydi0xLjU2MmwtMy4xMjUgMy4xMjUgMy4xMjQgMy4xMjV2LTEuNTYyYzYuMDI5IDAgMTAuOTM4LTQuOTA2IDEwLjkzOC0xMC45MzggMC0yLjkyNy0xLjE0MS01LjY3Ni0zLjIxNS03Ljc0NXoiLz4KCTxwYXRoIGRpc3BsYXk9ImlubGluZSIgZD0ibTQ2Ljg3NSA0MC42MjUtMy4xMjUtMy4xMjV2MS41NjJjLTYuMDMgMC0xMC45MzggNC45MDctMTAuOTM4IDEwLjkzOCAwIDIuOTI3IDEuMTQxIDUuNjc2IDMuMjE3IDcuNzQ1bDIuMjAzLTIuMjEyYy0xLjQ3Ny0xLjQ3OS0yLjI5NC0zLjQ0Mi0yLjI5NC01LjUzMyAwLTQuMzA5IDMuNTA0LTcuODEyIDcuODEyLTcuODEydjEuNTYybDMuMTI1LTMuMTI1eiIvPgo8L2c+CjxwYXRoIGZpbGw9IiNmZmYiIGQ9Im0xMCAwbC0wLjc1IDEuOTA2MmMtMS4wMDc4LTAuMjk0Mi0zLjQ1ODYtMC43NzA4LTUuNjU2MiAwLjkzNzYgMC0wLjAwMDItMy45MzAyIDIuNTk0MS0yLjA5MzggNy41OTQybDEuNjU2Mi0wLjcxOTJzLTEuNTM5OS0zLjExMjIgMS42ODc2LTUuNTMxM2MwIDAgMS42OTU3LTEuMTMzOSAzLjY4NzQtMC41OTM3bC0wLjcxODcgMS44MTI0IDMuODEyNS0xLjYyNS0xLjYyNS0zLjc4MTJ6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTE0IDUuNTYyNWwtMS42NTYgMC43MTg3czEuNTQxIDMuMTEzNS0xLjY4OCA1LjUzMDhjMCAwLTEuNzI3MiAxLjEzNS0zLjcxODUgMC41OTRsMC43NS0xLjgxMi0zLjgxMjUgMS41OTQgMS41OTM4IDMuODEyIDAuNzgxMi0xLjkwNmMxLjAxMTMgMC4yOTUgMy40NjE1IDAuNzY2IDUuNjU2LTAuOTM4IDAgMCAzLjkyOC0yLjU5NCAyLjA5NC03LjU5MzV6Ii8+Cjwvc3ZnPgo=', widget: '<div class="rs-bubble rs-hidden"> <div class="rs-bubble-text remotestorage-initial remotestorage-error remotestorage-authing remotestorage-offline"> <span class="rs-status-text">{{view_connect}}</span> </div> <div class="rs-bubble-expandable"> <!-- error --> <div class="remotestorage-error"> <pre class="rs-status-text rs-error-msg">{{ERROR_MSG}}</pre> <button class="remotestorage-reset">{{view_get_me_out}}</button> <p class="rs-centered-text rs-error-plz-report">{{view_error_plz_report}}</p> </div> <!-- connected --> <div class="rs-bubble-text remotestorage-connected"> <strong class="userAddress">{{USER_ADDRESS}}</strong> <p class="remotestorage-unauthorized">{{view_unauthorized}}</p> <p class="remotestorage-invalid-key">{{view_invalid_key}}</p> <form novalidate class="remotestorage-cipher-form"> <input placeholder="Secret key" name="userSecretKey" novalidate> <button class="rs-cipher" name="rs-cipher" title="cipher" disabled="disabled"> <img> </button> <button class="rs-nocipher" name="rs-nocipher" title="no cipher"> <img> </button> </form> </div> <div class="rs-content remotestorage-connected"> <button class="rs-sync" title="sync"><img></button> <button class="rs-disconnect" title="disconnect"><img></button> </div> <!-- initial --> <form novalidate class="remotestorage-initial"> <input type="email" placeholder="user@provider.com" name="userAddress" novalidate> <button class="connect" name="connect" title="connect" disabled="disabled"> <img> </button> </form> <div class="rs-info-msg remotestorage-initial">{{view_info}}</div> </div> </div> <img class="rs-dropbox rs-backends rs-action" alt="Connect to Dropbox"> <img class="rs-googledrive rs-backends rs-action" alt="Connect to Google Drive"> <img class="rs-cube rs-action"> ', widgetCss: '/** encoding:utf-8 **/ /* RESET */ #remotestorage-widget{text-align:left;}#remotestorage-widget input, #remotestorage-widget button{font-size:11px;}#remotestorage-widget form input[type=email]{margin-bottom:0;/* HTML5 Boilerplate */}#remotestorage-widget form input[type=submit]{margin-top:0;/* HTML5 Boilerplate */}/* /RESET */ #remotestorage-widget, #remotestorage-widget *{-moz-box-sizing:border-box;box-sizing:border-box;}#remotestorage-widget{position:absolute;right:10px;top:10px;font:normal 16px/100% sans-serif !important;user-select:none;-webkit-user-select:none;-moz-user-select:-moz-none;cursor:default;z-index:10000;}#remotestorage-widget .rs-bubble{background:rgba(80, 80, 80, .7);border-radius:5px 15px 5px 5px;color:white;font-size:0.8em;padding:5px;position:absolute;right:3px;top:9px;min-height:24px;white-space:nowrap;text-decoration:none;}.rs-bubble .rs-bubble-text{padding-right:32px;/* make sure the bubble doesn\'t "jump" when initially opening. */ min-width:182px;}#remotestorage-widget .rs-action{cursor:pointer;}/* less obtrusive cube when connected */ #remotestorage-widget.remotestorage-state-connected .rs-cube, #remotestorage-widget.remotestorage-state-busy .rs-cube{opacity:.3;-webkit-transition:opacity .3s ease;-moz-transition:opacity .3s ease;-ms-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease;}#remotestorage-widget.remotestorage-state-connected:hover .rs-cube, #remotestorage-widget.remotestorage-state-busy:hover .rs-cube, #remotestorage-widget.remotestorage-state-connected .rs-bubble:not(.rs-hidden) + .rs-cube{opacity:1 !important;}#remotestorage-widget .rs-backends{position:relative;top:5px;right:0;}#remotestorage-widget .rs-cube{position:relative;top:5px;right:0;}/* pulsing animation for cube when loading */ #remotestorage-widget .rs-cube.remotestorage-loading{-webkit-animation:remotestorage-loading .5s ease-in-out infinite alternate;-moz-animation:remotestorage-loading .5s ease-in-out infinite alternate;-o-animation:remotestorage-loading .5s ease-in-out infinite alternate;-ms-animation:remotestorage-loading .5s ease-in-out infinite alternate;animation:remotestorage-loading .5s ease-in-out infinite alternate;}@-webkit-keyframes remotestorage-loading{to{opacity:.7}}@-moz-keyframes remotestorage-loading{to{opacity:.7}}@-o-keyframes remotestorage-loading{to{opacity:.7}}@-ms-keyframes remotestorage-loading{to{opacity:.7}}@keyframes remotestorage-loading{to{opacity:.7}}#remotestorage-widget a{text-decoration:underline;color:inherit;}#remotestorage-widget form{margin-top:.7em;position:relative;}#remotestorage-widget form input{display:table-cell;vertical-align:top;border:none;border-radius:6px;font-weight:bold;color:white;outline:none;line-height:1.5em;height:2em;}#remotestorage-widget form input:disabled{color:#999;background:#444 !important;cursor:default !important;}#remotestorage-widget form input[type=email]:focus, #remotestorage-widget form input[type=password]:focus{background:#223;}#remotestorage-widget form input[type=email], #remotestorage-widget form input[type=password]{background:#000;width:100%;height:26px;padding:0 30px 0 5px;border-top:1px solid #111;border-bottom:1px solid #999;}#remotestorage-widget form input[type=email]:focus, #remotestorage-widget form input[type=password]:focus{background:#223;}#remotestorage-widget button:focus, #remotestorage-widget input:focus{box-shadow:0 0 4px #ccc;}#remotestorage-widget form input[type=email]::-webkit-input-placeholder, #remotestorage-widget form input[type=password]::-webkit-input-placeholder{color:#999;}#remotestorage-widget form input[type=email]:-moz-placeholder, #remotestorage-widget form input[type=password]:-moz-placeholder{color:#999;}#remotestorage-widget form input[type=email]::-moz-placeholder, #remotestorage-widget form input[type=password]::-moz-placeholder{color:#999;}#remotestorage-widget form input[type=email]:-ms-input-placeholder, #remotestorage-widget form input[type=password]:-ms-input-placeholder{color:#999;}#remotestorage-widget form input[type=submit]{background:#000;cursor:pointer;padding:0 5px;}#remotestorage-widget form input[type=submit]:hover{background:#333;}#remotestorage-widget .rs-info-msg{font-size:10px;color:#eee;margin-top:0.7em;white-space:normal;}#remotestorage-widget .rs-info-msg.last-synced-message{display:inline;white-space:nowrap;margin-bottom:.7em}#remotestorage-widget .rs-info-msg a:hover, #remotestorage-widget .rs-info-msg a:active{color:#fff;}#remotestorage-widget button img{vertical-align:baseline;}#remotestorage-widget button{border:none;border-radius:6px;font-weight:bold;color:white;outline:none;line-height:1.5em;height:26px;width:26px;background:#000;cursor:pointer;margin:0;padding:5px;}#remotestorage-widget button:hover{background:#333;}#remotestorage-widget .rs-bubble button.connect, #remotestorage-widget .rs-bubble button.rs-cipher, #remotestorage-widget .rs-bubble button.rs-nocipher{display:block;background:none;position:absolute;right:0;top:0;opacity:1;/* increase clickable area of connect, rs-cipher & rs-nocipher buttons */ margin:-5px;padding:10px;width:36px;height:36px;}#remotestorage-widget .rs-bubble button.rs-cipher{width:46px;}#remotestorage-widget .rs-bubble button.rs-nocipher{height:26px;margin:0;padding:4px 5px 5px;right:-32px;width:26px;}#remotestorage-widget .rs-bubble button.connect:not([disabled]):hover, #remotestorage-widget .rs-bubble button.rs-cipher:not([disabled]):hover, #remotestorage-widget .rs-bubble button.rs-nocipher:not([disabled]):hover{background:rgba(150,150,150,.5);}#remotestorage-widget .rs-bubble button.connect[disabled], #remotestorage-widget .rs-bubble button.rs-cipher[disabled]{opacity:.5;cursor:default !important;}#remotestorage-widget .rs-bubble button.rs-sync{position:relative;left:-5px;bottom:-5px;padding:4px 4px 0 4px;background:#555;}#remotestorage-widget .rs-bubble button.rs-sync:hover{background:#444;}#remotestorage-widget .rs-bubble button.rs-disconnect{background:#721;position:absolute;right:0;bottom:0;padding:4px 4px 0 4px;}#remotestorage-widget .rs-bubble button.rs-disconnect:hover{background:#921;}#remotestorage-widget .remotestorage-error-info{color:#f92;}#remotestorage-widget .remotestorage-reset{width:100%;background:#721;}#remotestorage-widget .remotestorage-reset:hover{background:#921;}#remotestorage-widget .rs-bubble .rs-content{margin-top:7px;}#remotestorage-widget pre{user-select:initial;-webkit-user-select:initial;-moz-user-select:text;max-width:27em;margin-top:1em;overflow:auto;}#remotestorage-widget .rs-centered-text{text-align:center;}#remotestorage-widget .rs-bubble.rs-hidden{padding-bottom:2px;border-radius:5px 15px 15px 5px;}#remotestorage-widget .rs-error-msg{min-height:5em;}.rs-bubble.rs-hidden .rs-bubble-expandable{display:none;}.remotestorage-state-connected .rs-bubble.rs-hidden{display:none;}.remotestorage-connected{display:none;}.remotestorage-state-connected .remotestorage-connected{display:block;}.remotestorage-cipher-form{display:none;}.remotestorage-cipher .remotestorage-cipher-form{display:block;}.remotestorage-invalid-key{display:none;}.remotestorage-invalid-key.remotestorage-cipher-error{display:block;}.remotestorage-initial{display:none;}.remotestorage-state-initial .remotestorage-initial{display:block;}.remotestorage-error{display:none;}.remotestorage-state-error .remotestorage-error{display:block;}.remotestorage-state-authing .remotestorage-authing{display:block;}.remotestorage-state-offline .remotestorage-connected, .remotestorage-state-offline .remotestorage-offline{display:block;}.remotestorage-unauthorized{display:none;}.remotestorage-state-unauthorized .rs-bubble.rs-hidden{display:none;}.remotestorage-state-unauthorized .remotestorage-connected, .remotestorage-state-unauthorized .remotestorage-unauthorized{display:block;}.remotestorage-state-unauthorized .rs-sync{display:none;}.remotestorage-state-busy .rs-bubble.rs-hidden{display:none;}.remotestorage-state-busy .rs-bubble{display:block;}.remotestorage-state-busy .remotestorage-connected{display:block;}.remotestorage-state-authing .rs-bubble-expandable{display:none;}' }; /** FILE: src/widget.js **/ (function (window) { var hasLocalStorage; var LS_STATE_KEY = 'remotestorage:widget:state'; // states allowed to immediately jump into after a reload. var VALID_ENTRY_STATES = { initial: true, connected: true, offline: true }; /** * Class: RemoteStorage.Widget * * The widget controller that communicates with the view and listens to * its remoteStorage instance. * * While listening to the events emitted by its remoteStorage it sets * corresponding states of the view. * * - connected -> connected * - disconnected -> initial * - connecting -> authing * - authing -> authing * - wire-busy -> busy * - wire-done -> connected * - error -> one of initial, offline, unauthorized, or error **/ RemoteStorage.Widget = function (remoteStorage) { var self = this; var requestsToFlashFor = 0; // setting event listeners on rs events to put // the widget into corresponding states this.rs = remoteStorage; this.rs.remote.on('connected', stateSetter(this, 'connected')); this.rs.on('disconnected', stateSetter(this, 'initial')); this.rs.on('connecting', stateSetter(this, 'authing')); this.rs.on('authing', stateSetter(this, 'authing')); this.rs.on('error', errorsHandler(this)); if (this.rs.remote) { this.rs.remote.on('wire-busy', function (evt) { if (flashFor(evt)) { requestsToFlashFor++; stateSetter(self, 'busy')(); } }); this.rs.remote.on('wire-done', function (evt) { if (flashFor(evt)) { requestsToFlashFor--; } if (requestsToFlashFor <= 0 && evt.success) { stateSetter(self, 'connected')(); } }); } if (hasLocalStorage) { var state = localStorage[LS_STATE_KEY]; if (state && VALID_ENTRY_STATES[state]) { this._rememberedState = state; } } }; RemoteStorage.Widget.prototype = { /** * Method: display * * Displays the widget via the view.display method * * Parameters: * * options **/ display: function (options) { if (typeof(options) === 'string') { options = { domID: options }; } else if (typeof(options) === 'undefined') { options = {}; } if (! this.view) { this.setView(new RemoteStorage.Widget.View(this.rs)); } this.view.display(options); return this; }, linkWidgetToSync: function () { if (typeof(this.rs.sync) === 'object' && typeof(this.rs.sync.sync) === 'function') { this.view.on('sync', this.rs.sync.sync.bind(this.rs.sync)); } else { RemoteStorage.log('[Widget] typeof this.rs.sync check fail', this.rs.sync); setTimeout(this.linkWidgetToSync.bind(this), 1000); } }, /** * Method: setView(view) * * Sets the view and initializes event listeners to react on * widget (widget.view) events **/ setView: function (view) { this.view = view; this.view.on('connect', function (options) { if (typeof(options) === 'string') { // options is simply a useraddress this.rs.connect(options); } else if (options.special) { this.rs[options.special].connect(options); } }.bind(this)); this.view.on('secret-entered', function (secretKey) { this.view.setUserSecretKey(secretKey); stateSetter(this, 'ciphered')(); }.bind(this)); this.view.on('secret-cancelled', function () { stateSetter(this, 'notciphered')(); }.bind(this)); this.view.on('disconnect', this.rs.disconnect.bind(this.rs)); this.linkWidgetToSync(); try { this.view.on('reset', function (){ var location = RemoteStorage.Authorize.getLocation(); this.rs.on('disconnected', location.reload.bind(location)); this.rs.disconnect(); }.bind(this)); } catch(e) { if (!(e.message && e.message.match(/Unknown event/))) { // ignored. (the 0.7 widget-view interface didn't have a 'reset' event) throw e; } } if (this._rememberedState) { setTimeout(stateSetter(this, this._rememberedState), 0); delete this._rememberedState; } } }; /** * Method: displayWidget * * Same as <display> **/ RemoteStorage.prototype.displayWidget = function (options) { return this.widget.display(options); }; RemoteStorage.Widget._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); if (! remoteStorage.widget) { remoteStorage.widget = new RemoteStorage.Widget(remoteStorage); } }; RemoteStorage.Widget._rs_supported = function (remoteStorage) { return typeof(document) !== 'undefined'; }; function stateSetter(widget, state) { RemoteStorage.log('[Widget] Producing stateSetter for', state); return function () { RemoteStorage.log('[Widget] Setting state', state, arguments); if (hasLocalStorage) { localStorage[LS_STATE_KEY] = state; } if (widget.view) { if (widget.rs.remote) { widget.view.setUserAddress(widget.rs.remote.userAddress); } widget.view.setState(state, arguments); } else { widget._rememberedState = state; } }; } function errorsHandler(widget) { return function (error) { var s; if (error instanceof RemoteStorage.DiscoveryError) { console.error('Discovery failed', error, '"' + error.message + '"'); s = stateSetter(widget, 'initial', [error.message]); } else if (error instanceof RemoteStorage.SyncError) { s = stateSetter(widget, 'offline', []); } else if (error instanceof RemoteStorage.Unauthorized) { s = stateSetter(widget, 'unauthorized'); } else { RemoteStorage.log('[Widget] Unknown error'); s = stateSetter(widget, 'error', [error]); } s.apply(); }; } function flashFor(evt) { if (evt.method === 'GET' && evt.isFolder) { return false; } return true; } })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/view.js **/ (function (window){ var t = RemoteStorage.I18n.translate; /** * Class: RemoteStorage.Widget.View * * Controls the visible widget * * States: * * initial - not connected * authing - in auth flow * connected - connected to remote storage, not syncing at the moment * ciphered - connected, with cipher * notciphered - connected, without cipher * busy - connected, syncing at the moment * offline - connected, but no network connectivity * error - connected, but sync error happened * unauthorized - connected, but request returned 401 **/ RemoteStorage.Widget.View = function (remoteStorage) { this.rs = remoteStorage; if (typeof(document) === 'undefined') { throw "Widget not supported"; } RemoteStorage.eventHandling(this, 'connect', 'secret-entered', 'secret-cancelled', 'disconnect', 'sync', 'display', 'reset'); // Re-binding the event so they can be called from the window for (var event in this.events){ this.events[event] = this.events[event].bind(this); } this.hideBubbleOnBodyClick = function (event) { for (var p = event.target; p !== document.body; p = p.parentElement) { if (p.id === 'remotestorage-widget') { return; } } this.hideBubble(); }.bind(this); }; RemoteStorage.Widget.View.prototype = { connectGdrive: function () { this._emit('connect', { special: 'googledrive' }); }, connectDropbox: function (){ this._emit('connect', { special: 'dropbox'}); }, /** * Method: setState * * Call the function that applies the state to the widget * * Parameters: * * state * args **/ setState: function (state, args) { RemoteStorage.log('[View] widget.view.setState(',state,',',args,');'); var s = this.states[state]; if (typeof(s) === 'undefined') { throw new Error("Bad State assigned to view: " + state); } s.apply(this, args); }, /** * Method: setUserAddress * * Set user address of the input field **/ setUserAddress: function (addr) { this.userAddress = addr || ''; var el; if (this.div && (el = this.div.querySelector('form.remotestorage-initial').userAddress)) { el.value = this.userAddress; } }, /** * Method: setUserSecretKey * * Set user secret key **/ setUserSecretKey: function (secretKey) { this.userSecretKey = secretKey; }, /** * Method: toggleBubble * * Show the bubble when hidden and the other way around **/ toggleBubble: function (event) { if (this.bubble.className.search('rs-hidden') < 0) { this.hideBubble(event); } else { this.showBubble(event); } }, /** * Method: hideBubble * * Hide the bubble **/ hideBubble: function (){ addClass(this.bubble, 'rs-hidden'); document.body.removeEventListener('click', this.hideBubbleOnBodyClick); }, /** * Method: showBubble * * Show the bubble **/ showBubble: function (event){ removeClass(this.bubble, 'rs-hidden'); if (typeof(event) !== 'undefined') { stopPropagation(event); } document.body.addEventListener('click', this.hideBubbleOnBodyClick); if (this.div.querySelector('.remotestorage-connected').classList.contains('remotestorage-cipher') && !this.userSecretKey) { this.bubble.querySelector('form.remotestorage-cipher-form').userSecretKey.focus(); } else { this.bubble.querySelector('form.remotestorage-initial').userAddress.focus(); } }, /** * Method: display * * Draw the widget inside of the dom element with the id options.domID * * Parameters: * * options * * Returns: * * The widget div **/ display: function (options) { if (typeof this.div !== 'undefined') { return this.div; } var element = document.createElement('div'); var style = document.createElement('style'); style.innerHTML = RemoteStorage.Assets.widgetCss; element.id = "remotestorage-widget"; element.innerHTML = RemoteStorage.Assets.widget; element.appendChild(style); if (options.domID) { var parent = document.getElementById(options.domID); if (! parent) { throw "Failed to find target DOM element with id=\"" + options.domID + "\""; } parent.appendChild(element); } else { document.body.appendChild(element); } // Sync button setupButton(element, 'rs-sync', 'syncIcon', this.events.sync); // Disconnect button setupButton(element, 'rs-disconnect', 'disconnectIcon', this.events.disconnect); // Get me out of here setupButton(element, 'remotestorage-reset', undefined, this.events.reset); // Connect button var connectButton = setupButton(element, 'connect', 'connectIcon', this.events.connect); // Handle connectButton state this.form = element.querySelector('form.remotestorage-initial'); var el = this.form.userAddress; el.addEventListener('load', handleButtonState); el.addEventListener('keyup', handleButtonState); if (this.userAddress) { el.value = this.userAddress; } if (options.encryption) { this.cipher = true; var secretKeyInput = element.querySelector('form.remotestorage-cipher-form').userSecretKey; // This is to avoid the 'password field on an insecured page' warning, when not used and on http (not https) secretKeyInput.type = 'password'; // Cipher button var cipherButton = setupButton(element, 'rs-cipher', 'cipherIcon', this.events['secret-entered']); // Handle cipherButton state secretKeyInput.addEventListener('load', handleButtonState); secretKeyInput.addEventListener('keyup', handleButtonState); // No cipher button setupButton(element, 'rs-nocipher', 'nocipherIcon', this.events['secret-cancelled']); } // The cube this.cube = setupButton(element, 'rs-cube', 'remoteStorageIcon', this.toggleBubble.bind(this)); // Google Drive and Dropbox icons setupButton(element, 'rs-dropbox', 'dropbox', this.connectDropbox.bind(this)); setupButton(element, 'rs-googledrive', 'googledrive', this.connectGdrive.bind(this)); var bubbleDontCatch = { INPUT: true, BUTTON: true, IMG: true }; var eventListener = function (event) { if (! bubbleDontCatch[event.target.tagName] && ! (this.div.classList.contains('remotestorage-state-unauthorized') )) { this.showBubble(event); } }.bind(this); this.bubble = setupButton(element, 'rs-bubble', undefined, eventListener); this.hideBubble(); this.div = element; this.states.initial.call(this); this.events.display.call(this); return this.div; }, states: { initial: function (message) { var cube = this.cube; var info = message || t("view_info"); cube.src = RemoteStorage.Assets.remoteStorageIcon; this._renderTranslatedInitialContent(); if (message) { cube.src = RemoteStorage.Assets.remoteStorageIconError; removeClass(this.cube, 'remotestorage-loading'); this.showBubble(); // Show the red error cube for 5 seconds, then show the normal orange one again setTimeout(function (){ cube.src = RemoteStorage.Assets.remoteStorageIcon; },2000); } else { this.hideBubble(); } this.div.className = "remotestorage-state-initial"; if (this.userSecretKey) { delete this.userSecretKey; } // Google Drive and Dropbox icons var backends = 1; if (this._activateBackend('dropbox')) { backends += 1; } if (this._activateBackend('googledrive')) { backends += 1; } this.div.querySelector('.rs-bubble-text').style.paddingRight = backends*32+8+'px'; // If address not empty connect button enabled var cb = this.div.querySelector('.connect'); if (this.form.userAddress.value) { cb.removeAttribute('disabled'); } var infoEl = this.div.querySelector('.rs-info-msg'); infoEl.innerHTML = info; if (message) { infoEl.classList.add('remotestorage-error-info'); } else { infoEl.classList.remove('remotestorage-error-info'); } }, authing: function () { this.div.removeEventListener('click', this.events.connect); this.div.className = "remotestorage-state-authing"; this.div.querySelector('.rs-status-text').innerHTML = t("view_connecting", this.userAddress); addClass(this.cube, 'remotestorage-loading'); }, connected: function () { var cube = this.cube; this.div.className = "remotestorage-state-connected"; this.div.querySelector('.userAddress').innerHTML = this.userAddress; cube.src = RemoteStorage.Assets.remoteStorageIcon; removeClass(cube, 'remotestorage-loading'); if (this.cipher) { if (this.userSecretKey) { if (this.userSecretKeyError) { cube.src = RemoteStorage.Assets.remoteStorageIconError; addClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); addClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); this.showBubble(); // Show the red error cube for 5 seconds, then show the normal orange one again setTimeout(function (){ cube.src = RemoteStorage.Assets.remoteStorageIcon; },5000); } else { removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); cube.src = RemoteStorage.Assets.remoteStorageIconCiphered; } } else { addClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.showBubble(); } } var icons = { googledrive: this.div.querySelector('.rs-googledrive'), dropbox: this.div.querySelector('.rs-dropbox') }; icons.googledrive.style.display = icons.dropbox.style.display = 'none'; if (icons[this.rs.backend]) { icons[this.rs.backend].style.display = 'inline-block'; this.div.querySelector('.rs-bubble-text').style.paddingRight = 2*32+8+'px'; } else { this.div.querySelector('.rs-bubble-text').style.paddingRight = 32+8+'px'; } }, ciphered: function () { this.div.querySelector('form.remotestorage-cipher-form').userSecretKey.value = ''; removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); removeClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.cube.src = RemoteStorage.Assets.remoteStorageIconCiphered; this.hideBubble(); }, notciphered: function () { this.cipher = false; removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); removeClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.hideBubble(); }, busy: function () { this.div.className = "remotestorage-state-busy"; addClass(this.cube, 'remotestorage-loading'); //TODO needs to be undone when is that neccesary }, offline: function () { this.div.className = "remotestorage-state-offline"; this.cube.src = RemoteStorage.Assets.remoteStorageIconOffline; this.div.querySelector('.rs-status-text').innerHTML = t("view_offline"); }, error: function (err) { var errorMsg = err; this.div.className = "remotestorage-state-error"; this.div.querySelector('.rs-bubble-text').innerHTML = '<strong>'+t('view_error_occured')+'</strong>'; //FIXME I don't know what an DOMError is and my browser doesn't know too(how to handle this?) if (err instanceof Error /*|| err instanceof DOMError*/) { errorMsg = err.message + '\n\n' + err.stack; } this.div.querySelector('.rs-error-msg').textContent = errorMsg; this.cube.src = RemoteStorage.Assets.remoteStorageIconError; this.showBubble(); }, unauthorized: function () { this.div.className = "remotestorage-state-unauthorized"; this.cube.src = RemoteStorage.Assets.remoteStorageIconError; this.showBubble(); this.div.addEventListener('click', this.events.connect); } }, events: { /** * Event: connect * * Emitted when the connect button is clicked **/ connect: function (event) { stopPropagation(event); event.preventDefault(); this._emit('connect', this.div.querySelector('form.remotestorage-initial').userAddress.value); }, /** * Event: secret-entered * * Emitted when the cipher button is clicked **/ 'secret-entered': function (event) { stopPropagation(event); event.preventDefault(); this._emit('secret-entered', this.div.querySelector('form.remotestorage-cipher-form').userSecretKey.value); }, /** * Event: secret-cancelled * * Emitted when the nocipher button is clicked **/ 'secret-cancelled': function (event) { stopPropagation(event); event.preventDefault(); this._emit('secret-cancelled'); }, /** * Event: sync * * Emitted when the sync button is clicked **/ sync: function (event) { stopPropagation(event); event.preventDefault(); this._emit('sync'); }, /** * Event: disconnect * * Emitted when the disconnect button is clicked **/ disconnect: function (event) { stopPropagation(event); event.preventDefault(); this._emit('disconnect'); }, /** * Event: reset * * Emitted after crash triggers disconnect **/ reset: function (event){ event.preventDefault(); var result = window.confirm(t('view_confirm_reset')); if (result){ this._emit('reset'); } }, /** * Event: display * * Emitted when finished displaying the widget **/ display : function (event) { if (event) { event.preventDefault(); } this._emit('display'); } }, _renderTranslatedInitialContent: function () { this.div.querySelector('.rs-status-text').innerHTML = t("view_connect"); this.div.querySelector('.remotestorage-reset').innerHTML = t("view_get_me_out"); this.div.querySelector('.rs-error-plz-report').innerHTML = t("view_error_plz_report"); this.div.querySelector('.remotestorage-unauthorized').innerHTML = t("view_unauthorized"); this.div.querySelector('.remotestorage-invalid-key').innerHTML = t("view_invalid_key"); }, _activateBackend: function activateBackend(backendName) { var className = 'rs-' + backendName; if (this.rs.apiKeys[backendName]) { this.div.querySelector('.' + className).style.display = 'inline-block'; return true; } else { this.div.querySelector('.' + className).style.display = 'none'; return false; } } }; function removeClass(el, className) { return el.classList.remove(className); } function addClass(el, className) { return el.classList.add(className); } function stopPropagation(event) { if (typeof(event.stopPropagation) === 'function') { event.stopPropagation(); } else { event.cancelBubble = true; } } function setupButton(parent, className, iconName, eventListener) { var element = parent.querySelector('.' + className); if (typeof iconName !== 'undefined') { var img = element.querySelector('img'); (img || element).src = RemoteStorage.Assets[iconName]; } element.addEventListener('click', eventListener); return element; } function handleButtonState(event) { if (event.target.value) { event.target.nextElementSibling.removeAttribute('disabled'); } else { event.target.nextElementSibling.setAttribute('disabled','disabled'); } } })(typeof(window) !== 'undefined' ? window : global); /** FILE: node_modules/tv4/tv4.js **/ /* Author: Geraint Luff and others Year: 2013 This code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code. If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory. */ (function (global, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else if (typeof module !== 'undefined' && module.exports){ // CommonJS. Define export. module.exports = factory(); } else { // Browser globals global.tv4 = factory(); } }(this, function () { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys if (!Object.keys) { Object.keys = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function (obj) { if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) { throw new TypeError('Object.keys called on non-object'); } var result = []; for (var prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (var i=0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; })(); } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create if (!Object.create) { Object.create = (function(){ function F(){} return function(o){ if (arguments.length !== 1) { throw new Error('Object.create implementation only accepts one parameter.'); } F.prototype = o; return new F(); }; })(); } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray if(!Array.isArray) { Array.isArray = function (vArg) { return Object.prototype.toString.call(vArg) === "[object Array]"; }; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { if (this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n !== n) { // shortcut for verifying if it's NaN n = 0; } else if (n !== 0 && n !== Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } // Grungey Object.isFrozen hack if (!Object.isFrozen) { Object.isFrozen = function (obj) { var key = "tv4_test_frozen_key"; while (obj.hasOwnProperty(key)) { key += Math.random(); } try { obj[key] = true; delete obj[key]; return false; } catch (e) { return true; } }; } // Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed var uriTemplateGlobalModifiers = { "+": true, "#": true, ".": true, "/": true, ";": true, "?": true, "&": true }; var uriTemplateSuffices = { "*": true }; function notReallyPercentEncode(string) { return encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) { return "%" + doubleEncoded.substring(3); }); } function uriTemplateSubstitution(spec) { var modifier = ""; if (uriTemplateGlobalModifiers[spec.charAt(0)]) { modifier = spec.charAt(0); spec = spec.substring(1); } var separator = ""; var prefix = ""; var shouldEscape = true; var showVariables = false; var trimEmptyString = false; if (modifier === '+') { shouldEscape = false; } else if (modifier === ".") { prefix = "."; separator = "."; } else if (modifier === "/") { prefix = "/"; separator = "/"; } else if (modifier === '#') { prefix = "#"; shouldEscape = false; } else if (modifier === ';') { prefix = ";"; separator = ";"; showVariables = true; trimEmptyString = true; } else if (modifier === '?') { prefix = "?"; separator = "&"; showVariables = true; } else if (modifier === '&') { prefix = "&"; separator = "&"; showVariables = true; } var varNames = []; var varList = spec.split(","); var varSpecs = []; var varSpecMap = {}; for (var i = 0; i < varList.length; i++) { var varName = varList[i]; var truncate = null; if (varName.indexOf(":") !== -1) { var parts = varName.split(":"); varName = parts[0]; truncate = parseInt(parts[1], 10); } var suffices = {}; while (uriTemplateSuffices[varName.charAt(varName.length - 1)]) { suffices[varName.charAt(varName.length - 1)] = true; varName = varName.substring(0, varName.length - 1); } var varSpec = { truncate: truncate, name: varName, suffices: suffices }; varSpecs.push(varSpec); varSpecMap[varName] = varSpec; varNames.push(varName); } var subFunction = function (valueFunction) { var result = ""; var startIndex = 0; for (var i = 0; i < varSpecs.length; i++) { var varSpec = varSpecs[i]; var value = valueFunction(varSpec.name); if (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0)) { startIndex++; continue; } if (i === startIndex) { result += prefix; } else { result += (separator || ","); } if (Array.isArray(value)) { if (showVariables) { result += varSpec.name + "="; } for (var j = 0; j < value.length; j++) { if (j > 0) { result += varSpec.suffices['*'] ? (separator || ",") : ","; if (varSpec.suffices['*'] && showVariables) { result += varSpec.name + "="; } } result += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, "%21") : notReallyPercentEncode(value[j]); } } else if (typeof value === "object") { if (showVariables && !varSpec.suffices['*']) { result += varSpec.name + "="; } var first = true; for (var key in value) { if (!first) { result += varSpec.suffices['*'] ? (separator || ",") : ","; } first = false; result += shouldEscape ? encodeURIComponent(key).replace(/!/g, "%21") : notReallyPercentEncode(key); result += varSpec.suffices['*'] ? '=' : ","; result += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, "%21") : notReallyPercentEncode(value[key]); } } else { if (showVariables) { result += varSpec.name; if (!trimEmptyString || value !== "") { result += "="; } } if (varSpec.truncate != null) { value = value.substring(0, varSpec.truncate); } result += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value); } } return result; }; subFunction.varNames = varNames; return { prefix: prefix, substitution: subFunction }; } function UriTemplate(template) { if (!(this instanceof UriTemplate)) { return new UriTemplate(template); } var parts = template.split("{"); var textParts = [parts.shift()]; var prefixes = []; var substitutions = []; var varNames = []; while (parts.length > 0) { var part = parts.shift(); var spec = part.split("}")[0]; var remainder = part.substring(spec.length + 1); var funcs = uriTemplateSubstitution(spec); substitutions.push(funcs.substitution); prefixes.push(funcs.prefix); textParts.push(remainder); varNames = varNames.concat(funcs.substitution.varNames); } this.fill = function (valueFunction) { var result = textParts[0]; for (var i = 0; i < substitutions.length; i++) { var substitution = substitutions[i]; result += substitution(valueFunction); result += textParts[i + 1]; } return result; }; this.varNames = varNames; this.template = template; } UriTemplate.prototype = { toString: function () { return this.template; }, fillFromObject: function (obj) { return this.fill(function (varName) { return obj[varName]; }); } }; var ValidatorContext = function ValidatorContext(parent, collectMultiple, errorReporter, checkRecursive, trackUnknownProperties) { this.missing = []; this.missingMap = {}; this.formatValidators = parent ? Object.create(parent.formatValidators) : {}; this.schemas = parent ? Object.create(parent.schemas) : {}; this.collectMultiple = collectMultiple; this.errors = []; this.handleError = collectMultiple ? this.collectError : this.returnError; if (checkRecursive) { this.checkRecursive = true; this.scanned = []; this.scannedFrozen = []; this.scannedFrozenSchemas = []; this.scannedFrozenValidationErrors = []; this.validatedSchemasKey = 'tv4_validation_id'; this.validationErrorsKey = 'tv4_validation_errors_id'; } if (trackUnknownProperties) { this.trackUnknownProperties = true; this.knownPropertyPaths = {}; this.unknownPropertyPaths = {}; } this.errorReporter = errorReporter || defaultErrorReporter('en'); if (typeof this.errorReporter === 'string') { throw new Error('debug'); } this.definedKeywords = {}; if (parent) { for (var key in parent.definedKeywords) { this.definedKeywords[key] = parent.definedKeywords[key].slice(0); } } }; ValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) { this.definedKeywords[keyword] = this.definedKeywords[keyword] || []; this.definedKeywords[keyword].push(keywordFunction); }; ValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors, data, schema) { var error = new ValidationError(code, messageParams, dataPath, schemaPath, subErrors); error.message = this.errorReporter(error, data, schema); return error; }; ValidatorContext.prototype.returnError = function (error) { return error; }; ValidatorContext.prototype.collectError = function (error) { if (error) { this.errors.push(error); } return null; }; ValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) { for (var i = startIndex; i < this.errors.length; i++) { this.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath); } return this; }; ValidatorContext.prototype.banUnknownProperties = function (data, schema) { for (var unknownPath in this.unknownPropertyPaths) { var error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, "", null, data, schema); var result = this.handleError(error); if (result) { return result; } } return null; }; ValidatorContext.prototype.addFormat = function (format, validator) { if (typeof format === 'object') { for (var key in format) { this.addFormat(key, format[key]); } return this; } this.formatValidators[format] = validator; }; ValidatorContext.prototype.resolveRefs = function (schema, urlHistory) { if (schema['$ref'] !== undefined) { urlHistory = urlHistory || {}; if (urlHistory[schema['$ref']]) { return this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(', ')}, '', '', null, undefined, schema); } urlHistory[schema['$ref']] = true; schema = this.getSchema(schema['$ref'], urlHistory); } return schema; }; ValidatorContext.prototype.getSchema = function (url, urlHistory) { var schema; if (this.schemas[url] !== undefined) { schema = this.schemas[url]; return this.resolveRefs(schema, urlHistory); } var baseUrl = url; var fragment = ""; if (url.indexOf('#') !== -1) { fragment = url.substring(url.indexOf("#") + 1); baseUrl = url.substring(0, url.indexOf("#")); } if (typeof this.schemas[baseUrl] === 'object') { schema = this.schemas[baseUrl]; var pointerPath = decodeURIComponent(fragment); if (pointerPath === "") { return this.resolveRefs(schema, urlHistory); } else if (pointerPath.charAt(0) !== "/") { return undefined; } var parts = pointerPath.split("/").slice(1); for (var i = 0; i < parts.length; i++) { var component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~"); if (schema[component] === undefined) { schema = undefined; break; } schema = schema[component]; } if (schema !== undefined) { return this.resolveRefs(schema, urlHistory); } } if (this.missing[baseUrl] === undefined) { this.missing.push(baseUrl); this.missing[baseUrl] = baseUrl; this.missingMap[baseUrl] = baseUrl; } }; ValidatorContext.prototype.searchSchemas = function (schema, url) { if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) { this.searchSchemas(schema[i], url); } } else if (schema && typeof schema === "object") { if (typeof schema.id === "string") { if (isTrustedUrl(url, schema.id)) { if (this.schemas[schema.id] === undefined) { this.schemas[schema.id] = schema; } } } for (var key in schema) { if (key !== "enum") { if (typeof schema[key] === "object") { this.searchSchemas(schema[key], url); } else if (key === "$ref") { var uri = getDocumentUri(schema[key]); if (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) { this.missingMap[uri] = uri; } } } } } }; ValidatorContext.prototype.addSchema = function (url, schema) { //overload if (typeof url !== 'string' || typeof schema === 'undefined') { if (typeof url === 'object' && typeof url.id === 'string') { schema = url; url = schema.id; } else { return; } } if (url === getDocumentUri(url) + "#") { // Remove empty fragment url = getDocumentUri(url); } this.schemas[url] = schema; delete this.missingMap[url]; normSchema(schema, url); this.searchSchemas(schema, url); }; ValidatorContext.prototype.getSchemaMap = function () { var map = {}; for (var key in this.schemas) { map[key] = this.schemas[key]; } return map; }; ValidatorContext.prototype.getSchemaUris = function (filterRegExp) { var list = []; for (var key in this.schemas) { if (!filterRegExp || filterRegExp.test(key)) { list.push(key); } } return list; }; ValidatorContext.prototype.getMissingUris = function (filterRegExp) { var list = []; for (var key in this.missingMap) { if (!filterRegExp || filterRegExp.test(key)) { list.push(key); } } return list; }; ValidatorContext.prototype.dropSchemas = function () { this.schemas = {}; this.reset(); }; ValidatorContext.prototype.reset = function () { this.missing = []; this.missingMap = {}; this.errors = []; }; ValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) { var topLevel; schema = this.resolveRefs(schema); if (!schema) { return null; } else if (schema instanceof ValidationError) { this.errors.push(schema); return schema; } var startErrorCount = this.errors.length; var frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null; if (this.checkRecursive && data && typeof data === 'object') { topLevel = !this.scanned.length; if (data[this.validatedSchemasKey]) { var schemaIndex = data[this.validatedSchemasKey].indexOf(schema); if (schemaIndex !== -1) { this.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]); return null; } } if (Object.isFrozen(data)) { frozenIndex = this.scannedFrozen.indexOf(data); if (frozenIndex !== -1) { var frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema); if (frozenSchemaIndex !== -1) { this.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]); return null; } } } this.scanned.push(data); if (Object.isFrozen(data)) { if (frozenIndex === -1) { frozenIndex = this.scannedFrozen.length; this.scannedFrozen.push(data); this.scannedFrozenSchemas.push([]); } scannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length; this.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema; this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = []; } else { if (!data[this.validatedSchemasKey]) { try { Object.defineProperty(data, this.validatedSchemasKey, { value: [], configurable: true }); Object.defineProperty(data, this.validationErrorsKey, { value: [], configurable: true }); } catch (e) { //IE 7/8 workaround data[this.validatedSchemasKey] = []; data[this.validationErrorsKey] = []; } } scannedSchemasIndex = data[this.validatedSchemasKey].length; data[this.validatedSchemasKey][scannedSchemasIndex] = schema; data[this.validationErrorsKey][scannedSchemasIndex] = []; } } var errorCount = this.errors.length; var error = this.validateBasic(data, schema, dataPointerPath) || this.validateNumeric(data, schema, dataPointerPath) || this.validateString(data, schema, dataPointerPath) || this.validateArray(data, schema, dataPointerPath) || this.validateObject(data, schema, dataPointerPath) || this.validateCombinations(data, schema, dataPointerPath) || this.validateHypermedia(data, schema, dataPointerPath) || this.validateFormat(data, schema, dataPointerPath) || this.validateDefinedKeywords(data, schema, dataPointerPath) || null; if (topLevel) { while (this.scanned.length) { var item = this.scanned.pop(); delete item[this.validatedSchemasKey]; } this.scannedFrozen = []; this.scannedFrozenSchemas = []; } if (error || errorCount !== this.errors.length) { while ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) { var dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null; var schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null; if (error) { error = error.prefixWith(dataPart, schemaPart); } this.prefixErrors(errorCount, dataPart, schemaPart); } } if (scannedFrozenSchemaIndex !== null) { this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount); } else if (scannedSchemasIndex !== null) { data[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount); } return this.handleError(error); }; ValidatorContext.prototype.validateFormat = function (data, schema) { if (typeof schema.format !== 'string' || !this.formatValidators[schema.format]) { return null; } var errorMessage = this.formatValidators[schema.format].call(null, data, schema); if (typeof errorMessage === 'string' || typeof errorMessage === 'number') { return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}, '', '/format', null, data, schema); } else if (errorMessage && typeof errorMessage === 'object') { return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || '', errorMessage.schemaPath || "/format", null, data, schema); } return null; }; ValidatorContext.prototype.validateDefinedKeywords = function (data, schema, dataPointerPath) { for (var key in this.definedKeywords) { if (typeof schema[key] === 'undefined') { continue; } var validationFunctions = this.definedKeywords[key]; for (var i = 0; i < validationFunctions.length; i++) { var func = validationFunctions[i]; var result = func(data, schema[key], schema, dataPointerPath); if (typeof result === 'string' || typeof result === 'number') { return this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}, '', '', null, data, schema).prefixWith(null, key); } else if (result && typeof result === 'object') { var code = result.code; if (typeof code === 'string') { if (!ErrorCodes[code]) { throw new Error('Undefined error code (use defineError): ' + code); } code = ErrorCodes[code]; } else if (typeof code !== 'number') { code = ErrorCodes.KEYWORD_CUSTOM; } var messageParams = (typeof result.message === 'object') ? result.message : {key: key, message: result.message || "?"}; var schemaPath = result.schemaPath || ("/" + key.replace(/~/g, '~0').replace(/\//g, '~1')); return this.createError(code, messageParams, result.dataPath || null, schemaPath, null, data, schema); } } } return null; }; function recursiveCompare(A, B) { if (A === B) { return true; } if (A && B && typeof A === "object" && typeof B === "object") { if (Array.isArray(A) !== Array.isArray(B)) { return false; } else if (Array.isArray(A)) { if (A.length !== B.length) { return false; } for (var i = 0; i < A.length; i++) { if (!recursiveCompare(A[i], B[i])) { return false; } } } else { var key; for (key in A) { if (B[key] === undefined && A[key] !== undefined) { return false; } } for (key in B) { if (A[key] === undefined && B[key] !== undefined) { return false; } } for (key in A) { if (!recursiveCompare(A[key], B[key])) { return false; } } } return true; } return false; } ValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) { var error; if (error = this.validateType(data, schema, dataPointerPath)) { return error.prefixWith(null, "type"); } if (error = this.validateEnum(data, schema, dataPointerPath)) { return error.prefixWith(null, "type"); } return null; }; ValidatorContext.prototype.validateType = function validateType(data, schema) { if (schema.type === undefined) { return null; } var dataType = typeof data; if (data === null) { dataType = "null"; } else if (Array.isArray(data)) { dataType = "array"; } var allowedTypes = schema.type; if (!Array.isArray(allowedTypes)) { allowedTypes = [allowedTypes]; } for (var i = 0; i < allowedTypes.length; i++) { var type = allowedTypes[i]; if (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) { return null; } } return this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")}, '', '', null, data, schema); }; ValidatorContext.prototype.validateEnum = function validateEnum(data, schema) { if (schema["enum"] === undefined) { return null; } for (var i = 0; i < schema["enum"].length; i++) { var enumVal = schema["enum"][i]; if (recursiveCompare(data, enumVal)) { return null; } } return this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== 'undefined') ? JSON.stringify(data) : data}, '', '', null, data, schema); }; ValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) { return this.validateMultipleOf(data, schema, dataPointerPath) || this.validateMinMax(data, schema, dataPointerPath) || this.validateNaN(data, schema, dataPointerPath) || null; }; var CLOSE_ENOUGH_LOW = Math.pow(2, -51); var CLOSE_ENOUGH_HIGH = 1 - CLOSE_ENOUGH_LOW; ValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) { var multipleOf = schema.multipleOf || schema.divisibleBy; if (multipleOf === undefined) { return null; } if (typeof data === "number") { var remainder = (data/multipleOf)%1; if (remainder >= CLOSE_ENOUGH_LOW && remainder < CLOSE_ENOUGH_HIGH) { return this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}, '', '', null, data, schema); } } return null; }; ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) { if (typeof data !== "number") { return null; } if (schema.minimum !== undefined) { if (data < schema.minimum) { return this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}, '', '/minimum', null, data, schema); } if (schema.exclusiveMinimum && data === schema.minimum) { return this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}, '', '/exclusiveMinimum', null, data, schema); } } if (schema.maximum !== undefined) { if (data > schema.maximum) { return this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}, '', '/maximum', null, data, schema); } if (schema.exclusiveMaximum && data === schema.maximum) { return this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}, '', '/exclusiveMaximum', null, data, schema); } } return null; }; ValidatorContext.prototype.validateNaN = function validateNaN(data, schema) { if (typeof data !== "number") { return null; } if (isNaN(data) === true || data === Infinity || data === -Infinity) { return this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}, '', '/type', null, data, schema); } return null; }; ValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) { return this.validateStringLength(data, schema, dataPointerPath) || this.validateStringPattern(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) { if (typeof data !== "string") { return null; } if (schema.minLength !== undefined) { if (data.length < schema.minLength) { return this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}, '', '/minLength', null, data, schema); } } if (schema.maxLength !== undefined) { if (data.length > schema.maxLength) { return this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}, '', '/maxLength', null, data, schema); } } return null; }; ValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) { if (typeof data !== "string" || (typeof schema.pattern !== "string" && !(schema.pattern instanceof RegExp))) { return null; } var regexp; if (schema.pattern instanceof RegExp) { regexp = schema.pattern; } else { var body, flags = ''; // Check for regular expression literals // @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5 var literal = schema.pattern.match(/^\/(.+)\/([img]*)$/); if (literal) { body = literal[1]; flags = literal[2]; } else { body = schema.pattern; } regexp = new RegExp(body, flags); } if (!regexp.test(data)) { return this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}, '', '/pattern', null, data, schema); } return null; }; ValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) { if (!Array.isArray(data)) { return null; } return this.validateArrayLength(data, schema, dataPointerPath) || this.validateArrayUniqueItems(data, schema, dataPointerPath) || this.validateArrayItems(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) { var error; if (schema.minItems !== undefined) { if (data.length < schema.minItems) { error = this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems}, '', '/minItems', null, data, schema); if (this.handleError(error)) { return error; } } } if (schema.maxItems !== undefined) { if (data.length > schema.maxItems) { error = this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems}, '', '/maxItems', null, data, schema); if (this.handleError(error)) { return error; } } } return null; }; ValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) { if (schema.uniqueItems) { for (var i = 0; i < data.length; i++) { for (var j = i + 1; j < data.length; j++) { if (recursiveCompare(data[i], data[j])) { var error = this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j}, '', '/uniqueItems', null, data, schema); if (this.handleError(error)) { return error; } } } } } return null; }; ValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) { if (schema.items === undefined) { return null; } var error, i; if (Array.isArray(schema.items)) { for (i = 0; i < data.length; i++) { if (i < schema.items.length) { if (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) { return error; } } else if (schema.additionalItems !== undefined) { if (typeof schema.additionalItems === "boolean") { if (!schema.additionalItems) { error = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {}, '/' + i, '/additionalItems', null, data, schema)); if (this.handleError(error)) { return error; } } } else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) { return error; } } } } else { for (i = 0; i < data.length; i++) { if (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) { return error; } } } return null; }; ValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) { if (typeof data !== "object" || data === null || Array.isArray(data)) { return null; } return this.validateObjectMinMaxProperties(data, schema, dataPointerPath) || this.validateObjectRequiredProperties(data, schema, dataPointerPath) || this.validateObjectProperties(data, schema, dataPointerPath) || this.validateObjectDependencies(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) { var keys = Object.keys(data); var error; if (schema.minProperties !== undefined) { if (keys.length < schema.minProperties) { error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}, '', '/minProperties', null, data, schema); if (this.handleError(error)) { return error; } } } if (schema.maxProperties !== undefined) { if (keys.length > schema.maxProperties) { error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}, '', '/maxProperties', null, data, schema); if (this.handleError(error)) { return error; } } } return null; }; ValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) { if (schema.required !== undefined) { for (var i = 0; i < schema.required.length; i++) { var key = schema.required[i]; if (data[key] === undefined) { var error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}, '', '/required/' + i, null, data, schema); if (this.handleError(error)) { return error; } } } } return null; }; ValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) { var error; for (var key in data) { var keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, '~0').replace(/\//g, '~1'); var foundMatch = false; if (schema.properties !== undefined && schema.properties[key] !== undefined) { foundMatch = true; if (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) { return error; } } if (schema.patternProperties !== undefined) { for (var patternKey in schema.patternProperties) { var regexp = new RegExp(patternKey); if (regexp.test(key)) { foundMatch = true; if (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) { return error; } } } } if (!foundMatch) { if (schema.additionalProperties !== undefined) { if (this.trackUnknownProperties) { this.knownPropertyPaths[keyPointerPath] = true; delete this.unknownPropertyPaths[keyPointerPath]; } if (typeof schema.additionalProperties === "boolean") { if (!schema.additionalProperties) { error = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {key: key}, '', '/additionalProperties', null, data, schema).prefixWith(key, null); if (this.handleError(error)) { return error; } } } else { if (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) { return error; } } } else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) { this.unknownPropertyPaths[keyPointerPath] = true; } } else if (this.trackUnknownProperties) { this.knownPropertyPaths[keyPointerPath] = true; delete this.unknownPropertyPaths[keyPointerPath]; } } return null; }; ValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) { var error; if (schema.dependencies !== undefined) { for (var depKey in schema.dependencies) { if (data[depKey] !== undefined) { var dep = schema.dependencies[depKey]; if (typeof dep === "string") { if (data[dep] === undefined) { error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}, '', '', null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies"); if (this.handleError(error)) { return error; } } } else if (Array.isArray(dep)) { for (var i = 0; i < dep.length; i++) { var requiredKey = dep[i]; if (data[requiredKey] === undefined) { error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}, '', '/' + i, null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies"); if (this.handleError(error)) { return error; } } } } else { if (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) { return error; } } } } } return null; }; ValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) { return this.validateAllOf(data, schema, dataPointerPath) || this.validateAnyOf(data, schema, dataPointerPath) || this.validateOneOf(data, schema, dataPointerPath) || this.validateNot(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) { if (schema.allOf === undefined) { return null; } var error; for (var i = 0; i < schema.allOf.length; i++) { var subSchema = schema.allOf[i]; if (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) { return error; } } return null; }; ValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) { if (schema.anyOf === undefined) { return null; } var errors = []; var startErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; } var errorAtEnd = true; for (var i = 0; i < schema.anyOf.length; i++) { if (this.trackUnknownProperties) { this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var subSchema = schema.anyOf[i]; var errorCount = this.errors.length; var error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath); if (error === null && errorCount === this.errors.length) { this.errors = this.errors.slice(0, startErrorCount); if (this.trackUnknownProperties) { for (var knownKey in this.knownPropertyPaths) { oldKnownPropertyPaths[knownKey] = true; delete oldUnknownPropertyPaths[knownKey]; } for (var unknownKey in this.unknownPropertyPaths) { if (!oldKnownPropertyPaths[unknownKey]) { oldUnknownPropertyPaths[unknownKey] = true; } } // We need to continue looping so we catch all the property definitions, but we don't want to return an error errorAtEnd = false; continue; } return null; } if (error) { errors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf")); } } if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (errorAtEnd) { errors = errors.concat(this.errors.slice(startErrorCount)); this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors, data, schema); } }; ValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) { if (schema.oneOf === undefined) { return null; } var validIndex = null; var errors = []; var startErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; } for (var i = 0; i < schema.oneOf.length; i++) { if (this.trackUnknownProperties) { this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var subSchema = schema.oneOf[i]; var errorCount = this.errors.length; var error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath); if (error === null && errorCount === this.errors.length) { if (validIndex === null) { validIndex = i; } else { this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf", null, data, schema); } if (this.trackUnknownProperties) { for (var knownKey in this.knownPropertyPaths) { oldKnownPropertyPaths[knownKey] = true; delete oldUnknownPropertyPaths[knownKey]; } for (var unknownKey in this.unknownPropertyPaths) { if (!oldKnownPropertyPaths[unknownKey]) { oldUnknownPropertyPaths[unknownKey] = true; } } } } else if (error) { errors.push(error); } } if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (validIndex === null) { errors = errors.concat(this.errors.slice(startErrorCount)); this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors, data, schema); } else { this.errors = this.errors.slice(0, startErrorCount); } return null; }; ValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) { if (schema.not === undefined) { return null; } var oldErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var error = this.validateAll(data, schema.not, null, null, dataPointerPath); var notErrors = this.errors.slice(oldErrorCount); this.errors = this.errors.slice(0, oldErrorCount); if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (error === null && notErrors.length === 0) { return this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not", null, data, schema); } return null; }; ValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) { if (!schema.links) { return null; } var error; for (var i = 0; i < schema.links.length; i++) { var ldo = schema.links[i]; if (ldo.rel === "describedby") { var template = new UriTemplate(ldo.href); var allPresent = true; for (var j = 0; j < template.varNames.length; j++) { if (!(template.varNames[j] in data)) { allPresent = false; break; } } if (allPresent) { var schemaUrl = template.fillFromObject(data); var subSchema = {"$ref": schemaUrl}; if (error = this.validateAll(data, subSchema, [], ["links", i], dataPointerPath)) { return error; } } } } }; // parseURI() and resolveUrl() are from https://gist.github.com/1088850 // - released as public domain by author ("Yaffle") - see comments on gist function parseURI(url) { var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); // authority = '//' + user + ':' + pass '@' + hostname + ':' port return (m ? { href : m[0] || '', protocol : m[1] || '', authority: m[2] || '', host : m[3] || '', hostname : m[4] || '', port : m[5] || '', pathname : m[6] || '', search : m[7] || '', hash : m[8] || '' } : null); } function resolveUrl(base, href) {// RFC 3986 function removeDotSegments(input) { var output = []; input.replace(/^(\.\.?(\/|$))+/, '') .replace(/\/(\.(\/|$))+/g, '/') .replace(/\/\.\.$/, '/../') .replace(/\/?[^\/]*/g, function (p) { if (p === '/..') { output.pop(); } else { output.push(p); } }); return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : ''); } href = parseURI(href || ''); base = parseURI(base || ''); return !href || !base ? null : (href.protocol || base.protocol) + (href.protocol || href.authority ? href.authority : base.authority) + removeDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === '/' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? '/' : '') + base.pathname.slice(0, base.pathname.lastIndexOf('/') + 1) + href.pathname) : base.pathname)) + (href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) + href.hash; } function getDocumentUri(uri) { return uri.split('#')[0]; } function normSchema(schema, baseUri) { if (schema && typeof schema === "object") { if (baseUri === undefined) { baseUri = schema.id; } else if (typeof schema.id === "string") { baseUri = resolveUrl(baseUri, schema.id); schema.id = baseUri; } if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) { normSchema(schema[i], baseUri); } } else { if (typeof schema['$ref'] === "string") { schema['$ref'] = resolveUrl(baseUri, schema['$ref']); } for (var key in schema) { if (key !== "enum") { normSchema(schema[key], baseUri); } } } } } function defaultErrorReporter(language) { language = language || 'en'; var errorMessages = languages[language]; return function (error) { var messageTemplate = errorMessages[error.code] || ErrorMessagesDefault[error.code]; if (typeof messageTemplate !== 'string') { return "Unknown error code " + error.code + ": " + JSON.stringify(error.messageParams); } var messageParams = error.params; // Adapted from Crockford's supplant() return messageTemplate.replace(/\{([^{}]*)\}/g, function (whole, varName) { var subValue = messageParams[varName]; return typeof subValue === 'string' || typeof subValue === 'number' ? subValue : whole; }); }; } var ErrorCodes = { INVALID_TYPE: 0, ENUM_MISMATCH: 1, ANY_OF_MISSING: 10, ONE_OF_MISSING: 11, ONE_OF_MULTIPLE: 12, NOT_PASSED: 13, // Numeric errors NUMBER_MULTIPLE_OF: 100, NUMBER_MINIMUM: 101, NUMBER_MINIMUM_EXCLUSIVE: 102, NUMBER_MAXIMUM: 103, NUMBER_MAXIMUM_EXCLUSIVE: 104, NUMBER_NOT_A_NUMBER: 105, // String errors STRING_LENGTH_SHORT: 200, STRING_LENGTH_LONG: 201, STRING_PATTERN: 202, // Object errors OBJECT_PROPERTIES_MINIMUM: 300, OBJECT_PROPERTIES_MAXIMUM: 301, OBJECT_REQUIRED: 302, OBJECT_ADDITIONAL_PROPERTIES: 303, OBJECT_DEPENDENCY_KEY: 304, // Array errors ARRAY_LENGTH_SHORT: 400, ARRAY_LENGTH_LONG: 401, ARRAY_UNIQUE: 402, ARRAY_ADDITIONAL_ITEMS: 403, // Custom/user-defined errors FORMAT_CUSTOM: 500, KEYWORD_CUSTOM: 501, // Schema structure CIRCULAR_REFERENCE: 600, // Non-standard validation options UNKNOWN_PROPERTY: 1000 }; var ErrorCodeLookup = {}; for (var key in ErrorCodes) { ErrorCodeLookup[ErrorCodes[key]] = key; } var ErrorMessagesDefault = { INVALID_TYPE: "Invalid type: {type} (expected {expected})", ENUM_MISMATCH: "No enum match for: {value}", ANY_OF_MISSING: "Data does not match any schemas from \"anyOf\"", ONE_OF_MISSING: "Data does not match any schemas from \"oneOf\"", ONE_OF_MULTIPLE: "Data is valid against more than one schema from \"oneOf\": indices {index1} and {index2}", NOT_PASSED: "Data matches schema from \"not\"", // Numeric errors NUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}", NUMBER_MINIMUM: "Value {value} is less than minimum {minimum}", NUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}", NUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}", NUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}", NUMBER_NOT_A_NUMBER: "Value {value} is not a valid number", // String errors STRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}", STRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}", STRING_PATTERN: "String does not match pattern: {pattern}", // Object errors OBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}", OBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}", OBJECT_REQUIRED: "Missing required property: {key}", OBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed", OBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})", // Array errors ARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}", ARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}", ARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})", ARRAY_ADDITIONAL_ITEMS: "Additional items not allowed", // Format errors FORMAT_CUSTOM: "Format validation failed ({message})", KEYWORD_CUSTOM: "Keyword failed: {key} ({message})", // Schema structure CIRCULAR_REFERENCE: "Circular $refs: {urls}", // Non-standard validation options UNKNOWN_PROPERTY: "Unknown property (not in schema)" }; function ValidationError(code, params, dataPath, schemaPath, subErrors) { Error.call(this); if (code === undefined) { throw new Error ("No error code supplied: " + schemaPath); } this.message = ''; this.params = params; this.code = code; this.dataPath = dataPath || ""; this.schemaPath = schemaPath || ""; this.subErrors = subErrors || null; var err = new Error(this.message); this.stack = err.stack || err.stacktrace; if (!this.stack) { try { throw err; } catch(err) { this.stack = err.stack || err.stacktrace; } } } ValidationError.prototype = Object.create(Error.prototype); ValidationError.prototype.constructor = ValidationError; ValidationError.prototype.name = 'ValidationError'; ValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) { if (dataPrefix !== null) { dataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); this.dataPath = "/" + dataPrefix + this.dataPath; } if (schemaPrefix !== null) { schemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); this.schemaPath = "/" + schemaPrefix + this.schemaPath; } if (this.subErrors !== null) { for (var i = 0; i < this.subErrors.length; i++) { this.subErrors[i].prefixWith(dataPrefix, schemaPrefix); } } return this; }; function isTrustedUrl(baseUrl, testUrl) { if(testUrl.substring(0, baseUrl.length) === baseUrl){ var remainder = testUrl.substring(baseUrl.length); if ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/") || remainder.charAt(0) === "#" || remainder.charAt(0) === "?") { return true; } } return false; } var languages = {}; function createApi(language) { var globalContext = new ValidatorContext(); var currentLanguage; var customErrorReporter; var api = { setErrorReporter: function (reporter) { if (typeof reporter === 'string') { return this.language(reporter); } customErrorReporter = reporter; return true; }, addFormat: function () { globalContext.addFormat.apply(globalContext, arguments); }, language: function (code) { if (!code) { return currentLanguage; } if (!languages[code]) { code = code.split('-')[0]; // fall back to base language } if (languages[code]) { currentLanguage = code; return code; // so you can tell if fall-back has happened } return false; }, addLanguage: function (code, messageMap) { var key; for (key in ErrorCodes) { if (messageMap[key] && !messageMap[ErrorCodes[key]]) { messageMap[ErrorCodes[key]] = messageMap[key]; } } var rootCode = code.split('-')[0]; if (!languages[rootCode]) { // use for base language if not yet defined languages[code] = messageMap; languages[rootCode] = messageMap; } else { languages[code] = Object.create(languages[rootCode]); for (key in messageMap) { if (typeof languages[rootCode][key] === 'undefined') { languages[rootCode][key] = messageMap[key]; } languages[code][key] = messageMap[key]; } } return this; }, freshApi: function (language) { var result = createApi(); if (language) { result.language(language); } return result; }, validate: function (data, schema, checkRecursive, banUnknownProperties) { var def = defaultErrorReporter(currentLanguage); var errorReporter = customErrorReporter ? function (error, data, schema) { return customErrorReporter(error, data, schema) || def(error, data, schema); } : def; var context = new ValidatorContext(globalContext, false, errorReporter, checkRecursive, banUnknownProperties); if (typeof schema === "string") { schema = {"$ref": schema}; } context.addSchema("", schema); var error = context.validateAll(data, schema, null, null, ""); if (!error && banUnknownProperties) { error = context.banUnknownProperties(data, schema); } this.error = error; this.missing = context.missing; this.valid = (error === null); return this.valid; }, validateResult: function () { var result = {}; this.validate.apply(result, arguments); return result; }, validateMultiple: function (data, schema, checkRecursive, banUnknownProperties) { var def = defaultErrorReporter(currentLanguage); var errorReporter = customErrorReporter ? function (error, data, schema) { return customErrorReporter(error, data, schema) || def(error, data, schema); } : def; var context = new ValidatorContext(globalContext, true, errorReporter, checkRecursive, banUnknownProperties); if (typeof schema === "string") { schema = {"$ref": schema}; } context.addSchema("", schema); context.validateAll(data, schema, null, null, ""); if (banUnknownProperties) { context.banUnknownProperties(data, schema); } var result = {}; result.errors = context.errors; result.missing = context.missing; result.valid = (result.errors.length === 0); return result; }, addSchema: function () { return globalContext.addSchema.apply(globalContext, arguments); }, getSchema: function () { return globalContext.getSchema.apply(globalContext, arguments); }, getSchemaMap: function () { return globalContext.getSchemaMap.apply(globalContext, arguments); }, getSchemaUris: function () { return globalContext.getSchemaUris.apply(globalContext, arguments); }, getMissingUris: function () { return globalContext.getMissingUris.apply(globalContext, arguments); }, dropSchemas: function () { globalContext.dropSchemas.apply(globalContext, arguments); }, defineKeyword: function () { globalContext.defineKeyword.apply(globalContext, arguments); }, defineError: function (codeName, codeNumber, defaultMessage) { if (typeof codeName !== 'string' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) { throw new Error('Code name must be a string in UPPER_CASE_WITH_UNDERSCORES'); } if (typeof codeNumber !== 'number' || codeNumber%1 !== 0 || codeNumber < 10000) { throw new Error('Code number must be an integer > 10000'); } if (typeof ErrorCodes[codeName] !== 'undefined') { throw new Error('Error already defined: ' + codeName + ' as ' + ErrorCodes[codeName]); } if (typeof ErrorCodeLookup[codeNumber] !== 'undefined') { throw new Error('Error code already used: ' + ErrorCodeLookup[codeNumber] + ' as ' + codeNumber); } ErrorCodes[codeName] = codeNumber; ErrorCodeLookup[codeNumber] = codeName; ErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage; for (var langCode in languages) { var language = languages[langCode]; if (language[codeName]) { language[codeNumber] = language[codeNumber] || language[codeName]; } } }, reset: function () { globalContext.reset(); this.error = null; this.missing = []; this.valid = true; }, missing: [], error: null, valid: true, normSchema: normSchema, resolveUrl: resolveUrl, getDocumentUri: getDocumentUri, errorCodes: ErrorCodes }; api.language(language || 'en'); return api; } var tv4 = createApi(); tv4.addLanguage('en-gb', ErrorMessagesDefault); //legacy property tv4.tv4 = tv4; return tv4; // used by _header.js to globalise. })); /** FILE: lib/Math.uuid.js **/ /*! Math.uuid.js (v1.4) http://www.broofa.com mailto:robert@broofa.com Copyright (c) 2010 Robert Kieffer Dual licensed under the MIT and GPL licenses. ******** Changes within remoteStorage.js: 2012-10-31: - added AMD wrapper <niklas@unhosted.org> - moved extensions for Math object into exported object. */ /* * Generate a random uuid. * * USAGE: Math.uuid(length, radix) * length - the desired number of characters * radix - the number of allowable values for each character. * * EXAMPLES: * // No arguments - returns RFC4122, version 4 ID * >>> Math.uuid() * "92329D39-6F5C-4520-ABFC-AAB64544E172" * * // One argument - returns ID of the specified length * >>> Math.uuid(15) // 15 character ID (default base=62) * "VcydxgltxrVZSTV" * * // Two arguments - returns ID of the specified length, and radix. (Radix must be <= 62) * >>> Math.uuid(8, 2) // 8 character ID (base=2) * "01001010" * >>> Math.uuid(8, 10) // 8 character ID (base=10) * "47473046" * >>> Math.uuid(8, 16) // 8 character ID (base=16) * "098F4D35" */ // Private array of chars to use var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); Math.uuid = function (len, radix) { var chars = CHARS, uuid = [], i; radix = radix || chars.length; if (len) { // Compact form for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix]; } else { // rfc4122, version 4 form var r; // rfc4122 requires these characters uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[14] = '4'; // Fill in random data. At i==19 set the high bits of clock sequence as // per rfc4122, sec. 4.1.5 for (i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | Math.random()*16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; } } } return uuid.join(''); }; /** FILE: src/baseclient.js **/ (function (global) { function deprecate(thing, replacement) { console.log('WARNING: ' + thing + ' is deprecated. Use ' + replacement + ' instead.'); } var RS = RemoteStorage; /** * Class: RemoteStorage.BaseClient * * Provides a high-level interface to access data below a given root path. * * A BaseClient deals with three types of data: folders, objects and files. * * <getListing> returns a mapping of all items within a folder. Items that * end with a forward slash ("/") are child folders. For instance: * { * 'folder/': true, * 'document.txt': true * } * * <getObject> / <storeObject> operate on JSON objects. Each object has a type. * * <getFile> / <storeFile> operates on files. Each file has a MIME type. * * <remove> operates on either objects or files (but not folders, folders are * created and removed implictly). */ RS.BaseClient = function (storage, base) { if (base[base.length - 1] !== '/') { throw "Not a folder: " + base; } if (base === '/') { // allow absolute and relative paths for the root scope. this.makePath = function (path) { return (path[0] === '/' ? '' : '/') + path; }; } /** * Property: storage * * The <RemoteStorage> instance this <BaseClient> operates on. */ this.storage = storage; /** * Property: base * * Base path this <BaseClient> operates on. * * For the module's privateClient this would be /<moduleName>/, for the * corresponding publicClient /public/<moduleName>/. */ this.base = base; var parts = this.base.split('/'); if (parts.length > 2) { this.moduleName = parts[1]; } else { this.moduleName = 'root'; } // Defined in baseclient/types.js /** * Property: schemas * * Contains schema objects of all types known to the BaseClient instance **/ /** * Event: change * * Emitted when a node changes * * Arguments: * event - Event object containing information about the changed node * * (start code) * { * path: path, // Absolute path of the changed node, from the storage root * relativePath: relativePath, // Path of the changed node, relative to this baseclient's scope root * origin: 'window', 'local', 'remote', or 'conflict' // emitted by user action within the app, local data store, remote sync, or versioning conflicts * oldValue: oldBody, // Old body of the changed node (local version in conflicts; undefined if creation) * newValue: newBody, // New body of the changed node (remote version in conflicts; undefined if deletion) * lastCommonValue: lastCommonValue, //most recent known common ancestor body of 'yours' and 'theirs' in case of conflict * oldContentType: oldContentType, // Old contentType of the changed node ('yours' for conflicts; undefined if creation) * newContentType: newContentType, // New contentType of the changed node ('theirs' for conflicts; undefined if deletion) * lastCommonContentType: lastCommonContentType // Most recent known common ancestor contentType of 'yours' and 'theirs' in case of conflict * } * (end code) * * Example of an event with origin 'local' (fired on page load): * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'local', * oldValue: undefined, * newValue: 'white', * oldContentType: undefined, * newContentType: 'text/plain' * } * (end code) * * Example of a conflict: * Say you changed 'color.txt' from 'white' to 'blue'; if you have set `RemoteStorage.config.changeEvents.window` to `true`, * then you will receive: * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'window', * oldValue: 'white', * newValue: 'blue', * oldContentType: 'text/plain', * newContentType: 'text/plain' * } * (end code) * * But when this change is pushed out by asynchronous synchronization, this change may rejected by the * server, if the remote version has in the meantime changed from 'white' to for instance 'red'; this will then lead to a change * event with origin 'conflict' (usually a few seconds after the event with origin 'window', if you had that activated). Note * that since you already changed it from 'white' to 'blue' in the local version a few seconds ago, `oldValue` is now your local * value of 'blue': * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'conflict', * oldValue: 'blue', * newValue: 'red', * lastCommonValue: 'white', * oldContentType: 'text/plain, * newContentType: 'text/plain' * lastCommonContentType: 'text/plain' * } * (end code) * * In practice, you should always redraw your views to display the content of the `newValue` field when a change event is received, * regardless of its origin. Events with origin 'local' are fired conveniently during the page load, so that you can fill your views * when the page loads. Events with origin 'window' are fired whenever you change a value by calling a method on the baseClient; * these are disabled by default. Events with origin 'remote' are fired when remote changes are discovered during sync (only for caching * startegies 'SEEN' and 'ALL'). Events with origin 'conflict' are fired when a conflict occurs while pushing out your local changes to * the remote store in asynchronous synchronization (see example above). **/ RS.eventHandling(this, 'change'); this.on = this.on.bind(this); storage.onChange(this.base, this._fireChange.bind(this)); }; RS.BaseClient.prototype = { extend: function (object) { for (var key in object) { this[key] = object[key]; } return this; }, /** * Method: scope * * Returns a new <BaseClient> operating on a subpath of the current <base> path. */ scope: function (path) { return new RS.BaseClient(this.storage, this.makePath(path)); }, // folder operations /** * Method: getListing * * Get a list of child nodes below a given path. * * The callback semantics of getListing are identical to those of getObject. * * Parameters: * path - The path to query. It MUST end with a forward slash. * maxAge - Either false or the maximum age of cached listing in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * * A promise for an object, representing child nodes. If the maxAge * requirement cannot be met because of network problems, this promise * will be rejected. If the maxAge requirement is set to false or the * library is in offline state, the promise will always be fulfilled with * data from the local store. * * Keys ending in a forward slash represent *folder nodes*, while all * other keys represent *data nodes*. * * For spec versions <= 01, the data node information will contain only * the item's ETag. For later spec versions, it will also contain the * content type and -length of the item. * * Example: * (start code) * client.getListing('', false).then(function (listing) { * // listing is for instance: * // { * // 'folder/': true, * // 'document.txt': true * // } * }); * (end code) */ getListing: function (path, maxAge) { if (typeof(path) !== 'string') { path = ''; } else if (path.length > 0 && path[path.length - 1] !== '/') { Promise.reject("Not a folder: " + path); } return this.storage.get(this.makePath(path), maxAge).then( function (r) { return (r.statusCode === 404) ? {} : r.body; } ); }, /** * Method: getAll * * Get all objects directly below a given path. * * Parameters: * path - Path to the folder. * maxAge - Either false or the maximum age of cached objects in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for an object in the form { path : object, ... }. If the * maxAge requirement cannot be met because of network problems, this * promise will be rejected. If the maxAge requirement is set to false, * the promise will always be fulfilled with data from the local store. * * For items that are not JSON-stringified objects (e.g. stored using * `storeFile` instead of `storeObject`), the object's value is filled in * with `true`. * * Example: * (start code) * client.getAll('', false).then(function (objects) { * for (var key in objects) { * console.log('- ' + key + ': ', objects[key]); * } * }); * (end code) */ getAll: function (path, maxAge) { if (typeof(path) !== 'string') { path = ''; } else if (path.length > 0 && path[path.length - 1] !== '/') { return Promise.reject("Not a folder: " + path); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { if (r.statusCode === 404) { return {}; } if (typeof(r.body) === 'object') { var keys = Object.keys(r.body); if (keys.length === 0) { // treat this like 404. it probably means a folder listing that // has changes that haven't been pushed out yet. return {}; } var calls = keys.map(function (key) { return this.storage.get(this.makePath(path + key), maxAge) .then(function (o) { if (typeof(o.body) === 'string') { try { o.body = JSON.parse(o.body); } catch (e) { } } if (typeof(o.body) === 'object') { r.body[key] = o.body; } }); }.bind(this)); return Promise.all(calls).then(function () { return r.body; }); } }.bind(this)); }, // file operations /** * Method: getFile * * Get the file at the given path. A file is raw data, as opposed to * a JSON object (use <getObject> for that). * * Except for the return value structure, getFile works exactly like * getObject. * * Parameters: * path - See getObject. * maxAge - Either false or the maximum age of cached file in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for an object: * * mimeType - String representing the MIME Type of the document. * data - Raw data of the document (either a string or an ArrayBuffer) * * If the maxAge requirement cannot be met because of network problems, this * promise will be rejected. If the maxAge requirement is set to false, the * promise will always be fulfilled with data from the local store. * * Example: * (start code) * // Display an image: * client.getFile('path/to/some/image', false).then(function (file) { * var blob = new Blob([file.data], { type: file.mimeType }); * var targetElement = document.findElementById('my-image-element'); * targetElement.src = window.URL.createObjectURL(blob); * }); * (end code) */ getFile: function (path, maxAge) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.getFile must be a string'); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { return { data: r.body, contentType: r.contentType, revision: r.revision // (this is new) }; }); }, /** * Method: storeFile * * Store raw data at a given path. * * Parameters: * mimeType - MIME media type of the data being stored * path - path relative to the module root. MAY NOT end in a forward slash. * data - string, ArrayBuffer or ArrayBufferView of raw data to store * * The given mimeType will later be returned, when retrieving the data * using <getFile>. * * Example (UTF-8 data): * (start code) * client.storeFile('text/html', 'index.html', '<h1>Hello World!</h1>'); * (end code) * * Example (Binary data): * (start code) * // MARKUP: * <input type="file" id="file-input"> * // CODE: * var input = document.getElementById('file-input'); * var file = input.files[0]; * var fileReader = new FileReader(); * * fileReader.onload = function () { * client.storeFile(file.type, file.name, fileReader.result); * }; * * fileReader.readAsArrayBuffer(file); * (end code) * */ storeFile: function (mimeType, path, body) { if (typeof(mimeType) !== 'string') { return Promise.reject('Argument \'mimeType\' of baseClient.storeFile must be a string'); } if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.storeFile must be a string'); } if (typeof(body) !== 'string' && typeof(body) !== 'object') { return Promise.reject('Argument \'body\' of baseClient.storeFile must be a string, ArrayBuffer, or ArrayBufferView'); } if (!this.storage.access.checkPathPermission(this.makePath(path), 'rw')) { console.warn('WARNING: Editing a document to which only read access (\'r\') was claimed'); } return this.storage.put(this.makePath(path), body, mimeType).then(function (r) { if (r.statusCode === 200 || r.statusCode === 201) { return r.revision; } else { return Promise.reject("Request (PUT " + this.makePath(path) + ") failed with status: " + r.statusCode); } }.bind(this)); }, // object operations /** * Method: getObject * * Get a JSON object from given path. * * Parameters: * path - Relative path from the module root (without leading slash). * maxAge - Either false or the maximum age of cached object in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for the object. If the maxAge requirement cannot be met * because of network problems, this promise will be rejected. If the * maxAge requirement is set to false, the promise will always be * fulfilled with data from the local store. * * Example: * (start code) * client.getObject('/path/to/object', false). * then(function (object) { * // object is either an object or null * }); * (end code) */ getObject: function (path, maxAge) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.getObject must be a string'); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { if (typeof(r.body) === 'object') { // will be the case for documents stored with rs.js <= 0.10.0-beta2 return r.body; } else if (typeof(r.body) === 'string') { try { return JSON.parse(r.body); } catch (e) { throw "Not valid JSON: " + this.makePath(path); } } else if (typeof(r.body) !== 'undefined' && r.statusCode === 200) { return Promise.reject("Not an object: " + this.makePath(path)); } }.bind(this)); }, /** * Method: storeObject * * Store object at given path. Triggers synchronization. * * Parameters: * * type - unique type of this object within this module. See description below. * path - path relative to the module root. * object - an object to be saved to the given node. It must be serializable as JSON. * * Returns: * A promise to store the object. The promise fails with a ValidationError, when validations fail. * * * What about the type?: * * A great thing about having data on the web, is to be able to link to * it and rearrange it to fit the current circumstances. To facilitate * that, eventually you need to know how the data at hand is structured. * For documents on the web, this is usually done via a MIME type. The * MIME type of JSON objects however, is always application/json. * To add that extra layer of "knowing what this object is", remoteStorage * aims to use <JSON-LD at http://json-ld.org/>. * A first step in that direction, is to add a *@context attribute* to all * JSON data put into remoteStorage. * Now that is what the *type* is for. * * Within remoteStorage.js, @context values are built using three components: * http://remotestorage.io/spec/modules/ - A prefix to guarantee uniqueness * the module name - module names should be unique as well * the type given here - naming this particular kind of object within this module * * In retrospect that means, that whenever you introduce a new "type" in calls to * storeObject, you should make sure that once your code is in the wild, future * versions of the code are compatible with the same JSON structure. * * How to define types?: * * See <declareType> for examples. */ storeObject: function (typeAlias, path, object) { if (typeof(typeAlias) !== 'string') { return Promise.reject('Argument \'typeAlias\' of baseClient.storeObject must be a string'); } if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.storeObject must be a string'); } if (typeof(object) !== 'object') { return Promise.reject('Argument \'object\' of baseClient.storeObject must be an object'); } this._attachType(object, typeAlias); try { var validationResult = this.validate(object); if (! validationResult.valid) { return Promise.reject(validationResult); } } catch(exc) { return Promise.reject(exc); } return this.storage.put(this.makePath(path), JSON.stringify(object), 'application/json; charset=UTF-8').then(function (r) { if (r.statusCode === 200 || r.statusCode === 201) { return r.revision; } else { return Promise.reject("Request (PUT " + this.makePath(path) + ") failed with status: " + r.statusCode); } }.bind(this)); }, // generic operations /** * Method: remove * * Remove node at given path from storage. Triggers synchronization. * * Parameters: * path - Path relative to the module root. */ remove: function (path) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.remove must be a string'); } if (!this.storage.access.checkPathPermission(this.makePath(path), 'rw')) { console.warn('WARNING: Removing a document to which only read access (\'r\') was claimed'); } return this.storage.delete(this.makePath(path)); }, cache: function (path, strategy) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.cache must be a string'; } if (strategy === false) { deprecate('caching strategy <false>', '<"FLUSH">'); strategy = 'FLUSH'; } else if (strategy === undefined) { strategy = 'ALL'; } else if (typeof(strategy) !== 'string') { deprecate('that caching strategy', '<"ALL">'); strategy = 'ALL'; } if (strategy !== 'FLUSH' && strategy !== 'SEEN' && strategy !== 'ALL') { throw 'Argument \'strategy\' of baseclient.cache must be one of ' + '["FLUSH", "SEEN", "ALL"]'; } this.storage.caching.set(this.makePath(path), strategy); return this; }, flush: function (path) { return this.storage.local.flush(path); }, makePath: function (path) { return this.base + (path || ''); }, _fireChange: function (event) { if (RemoteStorage.config.changeEvents[event.origin]) { ['new', 'old', 'lastCommon'].forEach(function (fieldNamePrefix) { if ((!event[fieldNamePrefix+'ContentType']) || (/^application\/(.*)json(.*)/.exec(event[fieldNamePrefix+'ContentType']))) { if (typeof(event[fieldNamePrefix+'Value']) === 'string') { try { event[fieldNamePrefix+'Value'] = JSON.parse(event[fieldNamePrefix+'Value']); } catch(e) { } } } }); this._emit('change', event); } }, _cleanPath: RemoteStorage.util.cleanPath, /** * Method: getItemURL * * Retrieve full URL of item * * Parameters: * path - Path relative to the module root. */ getItemURL: function (path) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.getItemURL must be a string'; } if (this.storage.connected) { path = this._cleanPath( this.makePath(path) ); return this.storage.remote.href + path; } else { return undefined; } }, uuid: function () { return Math.uuid(); } }; /** * Method: RS#scope * * Returns a new <RS.BaseClient> scoped to the given path. * * Parameters: * path - Root path of new BaseClient. * * * Example: * (start code) * * var foo = remoteStorage.scope('/foo/'); * * // PUTs data "baz" to path /foo/bar * foo.storeFile('text/plain', 'bar', 'baz'); * * var something = foo.scope('something/'); * * // GETs listing from path /foo/something/bla/ * something.getListing('bla/'); * * (end code) * */ RS.BaseClient._rs_init = function () { RS.prototype.scope = function (path) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.scope must be a string'; } if (!this.access.checkPathPermission(path, 'r')) { var escapedPath = path.replace(/(['\\])/g, '\\$1'); console.warn('WARNING: please call remoteStorage.access.claim(\'' + escapedPath + '\', \'r\') (read only) or remoteStorage.access.claim(\'' + escapedPath + '\', \'rw\') (read/write) first'); } return new RS.BaseClient(this, path); }; }; /* e.g.: remoteStorage.defineModule('locations', function (priv, pub) { return { exports: { features: priv.scope('features/').defaultType('feature'), collections: priv.scope('collections/').defaultType('feature-collection'); } }; }); */ // Defined in baseclient/types.js /** * Method: declareType * * Declare a remoteStorage object type using a JSON schema. See * <RemoteStorage.BaseClient.Types> **/ })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/baseclient/types.js **/ (function(global) { /** * Class: RemoteStorage.BaseClient.Types * * - Manages and validates types of remoteStorage objects, using JSON-LD and * JSON Schema * - Adds schema declaration/validation methods to BaseClient instances. **/ RemoteStorage.BaseClient.Types = { // <alias> -> <uri> uris: {}, // <uri> -> <schema> schemas: {}, // <uri> -> <alias> aliases: {}, declare: function(moduleName, alias, uri, schema) { var fullAlias = moduleName + '/' + alias; if (schema.extends) { var extendedAlias; var parts = schema.extends.split('/'); if (parts.length === 1) { extendedAlias = moduleName + '/' + parts.shift(); } else { extendedAlias = parts.join('/'); } var extendedUri = this.uris[extendedAlias]; if (! extendedUri) { throw "Type '" + fullAlias + "' tries to extend unknown schema '" + extendedAlias + "'"; } schema.extends = this.schemas[extendedUri]; } this.uris[fullAlias] = uri; this.aliases[uri] = fullAlias; this.schemas[uri] = schema; }, resolveAlias: function(alias) { return this.uris[alias]; }, getSchema: function(uri) { return this.schemas[uri]; }, inScope: function(moduleName) { var ml = moduleName.length; var schemas = {}; for (var alias in this.uris) { if (alias.substr(0, ml + 1) === moduleName + '/') { var uri = this.uris[alias]; schemas[uri] = this.schemas[uri]; } } return schemas; } }; var SchemaNotFound = function(uri) { var error = new Error("Schema not found: " + uri); error.name = "SchemaNotFound"; return error; }; SchemaNotFound.prototype = Error.prototype; RemoteStorage.BaseClient.Types.SchemaNotFound = SchemaNotFound; /** * Class: RemoteStorage.BaseClient **/ RemoteStorage.BaseClient.prototype.extend({ /** * Method: declareType * * Declare a remoteStorage object type using a JSON schema. * * Parameters: * alias - A type alias/shortname * uri - (optional) JSON-LD URI of the schema. Automatically generated if none given * schema - A JSON Schema object describing the object type * * Example: * * (start code) * client.declareType('todo-item', { * "type": "object", * "properties": { * "id": { * "type": "string" * }, * "title": { * "type": "string" * }, * "finished": { * "type": "boolean" * "default": false * }, * "createdAt": { * "type": "date" * } * }, * "required": ["id", "title"] * }) * (end code) * * Visit <http://json-schema.org> for details on how to use JSON Schema. **/ declareType: function(alias, uri, schema) { if (! schema) { schema = uri; uri = this._defaultTypeURI(alias); } RemoteStorage.BaseClient.Types.declare(this.moduleName, alias, uri, schema); }, /** * Method: validate * * Validate an object against the associated schema. * * Parameters: * object - Object to validate. Must have a @context property. * * Returns: * An object containing information about validation errors **/ validate: function(object) { var schema = RemoteStorage.BaseClient.Types.getSchema(object['@context']); if (schema) { return tv4.validateResult(object, schema); } else { throw new SchemaNotFound(object['@context']); } }, _defaultTypeURI: function(alias) { return 'http://remotestorage.io/spec/modules/' + encodeURIComponent(this.moduleName) + '/' + encodeURIComponent(alias); }, _attachType: function(object, alias) { object['@context'] = RemoteStorage.BaseClient.Types.resolveAlias(this.moduleName + '/' + alias) || this._defaultTypeURI(alias); } }); // Documented in baseclient.js Object.defineProperty(RemoteStorage.BaseClient.prototype, 'schemas', { configurable: true, get: function() { return RemoteStorage.BaseClient.Types.inScope(this.moduleName); } }); })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/caching.js **/ /** * Class: RemoteStorage.Caching * * Holds/manages caching configuration. * * Caching strategies: * * For each subtree, you can set the caching strategy to 'ALL', * 'SEEN' (default), and 'FLUSH'. * * - 'ALL' means that once all outgoing changes have been pushed, sync * will start retrieving nodes to cache pro-actively. If a local * copy exists of everything, it will check on each sync whether * the ETag of the root folder changed, and retrieve remote changes * if they exist. * - 'SEEN' does this only for documents and folders that have been either * read from or written to at least once since connecting to the current * remote backend, plus their parent/ancestor folders up to the root * (to make tree-based sync possible). * - 'FLUSH' will only cache outgoing changes, and forget them as soon as * they have been saved to remote successfully. * **/ (function (global) { var SETTINGS_KEY = "remotestorage:caching"; var containingFolder = RemoteStorage.util.containingFolder; RemoteStorage.Caching = function () { this.reset(); }; RemoteStorage.Caching.prototype = { pendingActivations: [], /** * Method: set * * Configure caching for a given path explicitly. * * Not needed when using <enable>/<disable>. * * Parameters: * path - Path to cache * strategy - Caching strategy. One of 'ALL', 'SEEN', or 'FLUSH'. * * Example: * (start code) * remoteStorage.caching.set('/bookmarks/archive') */ set: function (path, strategy) { if (typeof path !== 'string') { throw new Error('path should be a string'); } if (!RemoteStorage.util.isFolder(path)) { throw new Error('path should be a folder'); } if (this._remoteStorage && this._remoteStorage.access && !this._remoteStorage.access.checkPathPermission(path, 'r')) { throw new Error('No access to path "'+path+'". You have to claim access to it first.'); } if (!strategy.match(/^(FLUSH|SEEN|ALL)$/)) { throw new Error("strategy should be 'FLUSH', 'SEEN', or 'ALL'"); } this._rootPaths[path] = strategy; if (strategy === 'ALL') { if (this.activateHandler) { this.activateHandler(path); } else { this.pendingActivations.push(path); } } }, /** * Method: enable * * Enable caching for a given path. * * Uses caching strategy 'ALL'. * * Parameters: * path - Path to enable caching for */ enable: function (path) { this.set(path, 'ALL'); }, /** * Method: disable * * Disable caching for a given path. * * Uses caching strategy 'FLUSH' (meaning items are only cached until * successfully pushed to the remote). * * Parameters: * path - Path to disable caching for */ disable: function (path) { this.set(path, 'FLUSH'); }, /** * Method: onActivate * * Set a callback for when caching is activated for a path. * * Parameters: * callback - Callback function */ onActivate: function (cb) { var i; RemoteStorage.log('[Caching] Setting activate handler', cb, this.pendingActivations); this.activateHandler = cb; for (i=0; i<this.pendingActivations.length; i++) { cb(this.pendingActivations[i]); } delete this.pendingActivations; }, /** * Method: checkPath * * Retrieve caching setting for a given path, or its next parent * with a caching strategy set. * * Parameters: * path - Path to retrieve setting for **/ checkPath: function (path) { if (this._rootPaths[path] !== undefined) { return this._rootPaths[path]; } else if (path === '/') { return 'SEEN'; } else { return this.checkPath(containingFolder(path)); } }, /** * Method: reset * * Reset the state of caching by deleting all caching information. **/ reset: function () { this._rootPaths = {}; this._remoteStorage = null; } }; // TODO clean up/harmonize how modules are loaded and/or document this architecture properly // // At this point the global remoteStorage object has not been created yet. // Only its prototype exists so far, so we define a self-constructing // property on there: Object.defineProperty(RemoteStorage.prototype, 'caching', { configurable: true, get: function () { var caching = new RemoteStorage.Caching(); Object.defineProperty(this, 'caching', { value: caching }); return caching; } }); RemoteStorage.Caching._rs_init = function (remoteStorage) { this._remoteStorage = remoteStorage; }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/sync.js **/ (function (global) { var syncInterval = 10000, backgroundSyncInterval = 60000, isBackground = false; var isFolder = RemoteStorage.util.isFolder; var isDocument = RemoteStorage.util.isDocument; var equal = RemoteStorage.util.equal; var deepClone = RemoteStorage.util.deepClone; var pathsFromRoot = RemoteStorage.util.pathsFromRoot; function taskFor(action, path, promise) { return { action: action, path: path, promise: promise }; } function isStaleChild(node) { return node.remote && node.remote.revision && !node.remote.itemsMap && !node.remote.body; } function hasCommonRevision(node) { return node.common && node.common.revision; } function handleVisibility() { var hidden, visibilityChange, rs = this; function handleVisibilityChange(fg) { var oldValue, newValue; oldValue = rs.getCurrentSyncInterval(); isBackground = !fg; newValue = rs.getCurrentSyncInterval(); rs._emit('sync-interval-change', {oldValue: oldValue, newValue: newValue}); } RemoteStorage.Env.on("background", function () { handleVisibilityChange(false); }); RemoteStorage.Env.on("foreground", function () { handleVisibilityChange(true); }); } /** * Check if interval is valid: numeric and between 1000ms and 3600000ms * */ function isValidInterval(interval) { return (typeof interval === 'number' && interval > 1000 && interval < 3600000); } /** * Class: RemoteStorage.Sync * * What this class does is basically six things: * - retrieving the remote version of relevant documents and folders * - add all local and remote documents together into one tree * - push local documents out if they don't exist remotely * - push local changes out to remote documents (conditionally, to * avoid race conditions where both have changed) * - adopt the local version of a document to its remote version if * both exist and they differ * - delete the local version of a document if it was deleted remotely * - if any get requests were waiting for remote data, resolve them once * this data comes in. * * It does this using requests to documents, and to folders. Whenever a * folder GET comes in, it gives information about all the documents it * contains (this is the `markChildren` function). **/ RemoteStorage.Sync = function (setLocal, setRemote, setAccess, setCaching) { this.local = setLocal; this.local.onDiff(function (path) { this.addTask(path); this.doTasks(); }.bind(this)); this.remote = setRemote; this.access = setAccess; this.caching = setCaching; this._tasks = {}; this._running = {}; this._timeStarted = {}; RemoteStorage.eventHandling(this, 'done', 'req-done'); this.caching.onActivate(function (path) { this.addTask(path); this.doTasks(); }.bind(this)); }; RemoteStorage.Sync.prototype = { now: function () { return new Date().getTime(); }, queueGetRequest: function (path) { var pending = Promise.defer(); if (!this.remote.connected) { pending.reject('cannot fulfill maxAge requirement - remote is not connected'); } else if (!this.remote.online) { pending.reject('cannot fulfill maxAge requirement - remote is not online'); } else { this.addTask(path, function () { this.local.get(path).then(function (r) { return pending.resolve(r); }); }.bind(this)); this.doTasks(); } return pending.promise; }, corruptServerItemsMap: function (itemsMap, force02) { if ((typeof(itemsMap) !== 'object') || (Array.isArray(itemsMap))) { return true; } for (var itemName in itemsMap) { var item = itemsMap[itemName]; if (typeof(item) !== 'object') { return true; } if (typeof(item.ETag) !== 'string') { return true; } if (isFolder(itemName)) { if (itemName.substring(0, itemName.length-1).indexOf('/') !== -1) { return true; } } else { if (itemName.indexOf('/') !== -1) { return true; } if (force02) { if (typeof(item['Content-Type']) !== 'string') { return true; } if (typeof(item['Content-Length']) !== 'number') { return true; } } } } return false; }, corruptItemsMap: function (itemsMap) { if ((typeof(itemsMap) !== 'object') || (Array.isArray(itemsMap))) { return true; } for (var itemName in itemsMap) { if (typeof(itemsMap[itemName]) !== 'boolean') { return true; } } return false; }, corruptRevision: function (rev) { return ((typeof(rev) !== 'object') || (Array.isArray(rev)) || (rev.revision && typeof(rev.revision) !== 'string') || (rev.body && typeof(rev.body) !== 'string' && typeof(rev.body) !== 'object') || (rev.contentType && typeof(rev.contentType) !== 'string') || (rev.contentLength && typeof(rev.contentLength) !== 'number') || (rev.timestamp && typeof(rev.timestamp) !== 'number') || (rev.itemsMap && this.corruptItemsMap(rev.itemsMap))); }, isCorrupt: function (node) { return ((typeof(node) !== 'object') || (Array.isArray(node)) || (typeof(node.path) !== 'string') || (this.corruptRevision(node.common)) || (node.local && this.corruptRevision(node.local)) || (node.remote && this.corruptRevision(node.remote)) || (node.push && this.corruptRevision(node.push))); }, hasTasks: function () { return Object.getOwnPropertyNames(this._tasks).length > 0; }, collectDiffTasks: function () { var num = 0; return this.local.forAllNodes(function (node) { if (num > 100) { return; } if (this.isCorrupt(node)) { RemoteStorage.log('[Sync] WARNING: corrupt node in local cache', node); if (typeof(node) === 'object' && node.path) { this.addTask(node.path); num++; } } else if (this.needsFetch(node) && this.access.checkPathPermission(node.path, 'r')) { this.addTask(node.path); num++; } else if (isDocument(node.path) && this.needsPush(node) && this.access.checkPathPermission(node.path, 'rw')) { this.addTask(node.path); num++; } }.bind(this)).then(function () { return num; }, function (err) { throw err; }); }, inConflict: function (node) { return (node.local && node.remote && (node.remote.body !== undefined || node.remote.itemsMap)); }, needsRefresh: function (node) { if (node.common) { if (!node.common.timestamp) { return true; } return (this.now() - node.common.timestamp > syncInterval); } return false; }, needsFetch: function (node) { if (this.inConflict(node)) { return true; } if (node.common && node.common.itemsMap === undefined && node.common.body === undefined) { return true; } if (node.remote && node.remote.itemsMap === undefined && node.remote.body === undefined) { return true; } return false; }, needsPush: function (node) { if (this.inConflict(node)) { return false; } if (node.local && !node.push) { return true; } }, needsRemotePut: function (node) { return node.local && node.local.body; }, needsRemoteDelete: function (node) { return node.local && node.local.body === false; }, getParentPath: function (path) { var parts = path.match(/^(.*\/)([^\/]+\/?)$/); if (parts) { return parts[1]; } else { throw new Error('Not a valid path: "'+path+'"'); } }, deleteChildPathsFromTasks: function () { for (var path in this._tasks) { var paths = pathsFromRoot(path); for (var i=1; i<paths.length; i++) { if (this._tasks[paths[i]]) { delete this._tasks[path]; } } } }, collectRefreshTasks: function () { return this.local.forAllNodes(function (node) { var parentPath; if (this.needsRefresh(node)) { try { parentPath = this.getParentPath(node.path); } catch(e) { // node.path is already '/', can't take parentPath } if (parentPath && this.access.checkPathPermission(parentPath, 'r')) { this.addTask(parentPath); } else if (this.access.checkPathPermission(node.path, 'r')) { this.addTask(node.path); } } }.bind(this)).then(function () { this.deleteChildPathsFromTasks(); }.bind(this), function (err) { throw err; }); }, flush: function (nodes) { for (var path in nodes) { // Strategy is 'FLUSH' and no local changes exist if (this.caching.checkPath(path) === 'FLUSH' && nodes[path] && !nodes[path].local) { RemoteStorage.log('[Sync] Flushing', path); nodes[path] = undefined; // Cause node to be flushed from cache } } return nodes; }, doTask: function (path) { return this.local.getNodes([path]).then(function (nodes) { var node = nodes[path]; // First fetch: if (typeof(node) === 'undefined') { return taskFor('get', path, this.remote.get(path)); } // Fetch known-stale child: else if (isStaleChild(node)) { return taskFor('get', path, this.remote.get(path)); } // Push PUT: else if (this.needsRemotePut(node)) { node.push = deepClone(node.local); node.push.timestamp = this.now(); return this.local.setNodes(this.flush(nodes)).then(function () { var options; if (hasCommonRevision(node)) { options = { ifMatch: node.common.revision }; } else { // Initial PUT (fail if something is already there) options = { ifNoneMatch: '*' }; } return taskFor('put', path, this.remote.put(path, node.push.body, node.push.contentType, options) ); }.bind(this)); } // Push DELETE: else if (this.needsRemoteDelete(node)) { node.push = { body: false, timestamp: this.now() }; return this.local.setNodes(this.flush(nodes)).then(function () { if (hasCommonRevision(node)) { return taskFor('delete', path, this.remote.delete(path, { ifMatch: node.common.revision }) ); } else { // Ascertain current common or remote revision first return taskFor('get', path, this.remote.get(path)); } }.bind(this)); } // Conditional refresh: else if (hasCommonRevision(node)) { return taskFor('get', path, this.remote.get(path, { ifNoneMatch: node.common.revision }) ); } else { return taskFor('get', path, this.remote.get(path)); } }.bind(this)); }, autoMergeFolder: function (node) { if (node.remote.itemsMap) { node.common = node.remote; delete node.remote; if (node.common.itemsMap) { for (var itemName in node.common.itemsMap) { if (!node.local.itemsMap[itemName]) { // Indicates the node is either newly being fetched // has been deleted locally (whether or not leading to conflict); // before listing it in local listings, check if a local deletion // exists. node.local.itemsMap[itemName] = false; } } if (equal(node.local.itemsMap, node.common.itemsMap)) { delete node.local; } } } return node; }, autoMergeDocument: function (node) { hasNoRemoteChanges = function (node) { if (node.remote && node.remote.revision && node.remote.revision !== node.common.revision) { return false; } return (node.common.body === undefined && node.remote.body === false) || (node.remote.body === node.common.body && node.remote.contentType === node.common.contentType); }; mergeMutualDeletion = function (node) { if (node.remote && node.remote.body === false && node.local && node.local.body === false) { delete node.local; } return node; }; if (hasNoRemoteChanges(node)) { node = mergeMutualDeletion(node); delete node.remote; } else if (node.remote.body !== undefined) { // keep/revert: RemoteStorage.log('[Sync] Emitting keep/revert'); this.local._emitChange({ origin: 'conflict', path: node.path, oldValue: node.local.body, newValue: node.remote.body, lastCommonValue: node.common.body, oldContentType: node.local.contentType, newContentType: node.remote.contentType, lastCommonContentType: node.common.contentType }); if (node.remote.body) { node.common = node.remote; } else { node.common = {}; } delete node.remote; delete node.local; } return node; }, autoMerge: function (node) { if (node.remote) { if (node.local) { if (isFolder(node.path)) { return this.autoMergeFolder(node); } else { return this.autoMergeDocument(node); } } else { // no local changes if (isFolder(node.path)) { if (node.remote.itemsMap !== undefined) { node.common = node.remote; delete node.remote; } } else { if (node.remote.body !== undefined) { var change = { origin: 'remote', path: node.path, oldValue: (node.common.body === false ? undefined : node.common.body), newValue: (node.remote.body === false ? undefined : node.remote.body), oldContentType: node.common.contentType, newContentType: node.remote.contentType }; if (change.oldValue || change.newValue) { this.local._emitChange(change); } if (!node.remote.body) { // no remote, so delete/don't create return; } node.common = node.remote; delete node.remote; } } } } else { if (node.common.body) { this.local._emitChange({ origin: 'remote', path: node.path, oldValue: node.common.body, newValue: undefined, oldContentType: node.common.contentType, newContentType: undefined }); } return undefined; } return node; }, updateCommonTimestamp: function (path, revision) { return this.local.getNodes([path]).then(function (nodes) { if (nodes[path] && nodes[path].common && nodes[path].common.revision === revision) { nodes[path].common.timestamp = this.now(); } return this.local.setNodes(this.flush(nodes)); }.bind(this)); }, markChildren: function (path, itemsMap, changedNodes, missingChildren) { var paths = []; var meta = {}; var recurse = {}; for (var item in itemsMap) { paths.push(path+item); meta[path+item] = itemsMap[item]; } for (var childName in missingChildren) { paths.push(path+childName); } return this.local.getNodes(paths).then(function (nodes) { var cachingStrategy; var node; var nodeChanged = function (node, etag) { return node.common.revision !== etag && (!node.remote || node.remote.revision !== etag); }; for (var nodePath in nodes) { node = nodes[nodePath]; if (meta[nodePath]) { if (node && node.common) { if (nodeChanged(node, meta[nodePath].ETag)) { changedNodes[nodePath] = deepClone(node); changedNodes[nodePath].remote = { revision: meta[nodePath].ETag, timestamp: this.now() }; changedNodes[nodePath] = this.autoMerge(changedNodes[nodePath]); } } else { cachingStrategy = this.caching.checkPath(nodePath); if (cachingStrategy === 'ALL') { changedNodes[nodePath] = { path: nodePath, common: { timestamp: this.now() }, remote: { revision: meta[nodePath].ETag, timestamp: this.now() } }; } } if (changedNodes[nodePath] && meta[nodePath]['Content-Type']) { changedNodes[nodePath].remote.contentType = meta[nodePath]['Content-Type']; } if (changedNodes[nodePath] && meta[nodePath]['Content-Length']) { changedNodes[nodePath].remote.contentLength = meta[nodePath]['Content-Length']; } } else if (missingChildren[nodePath.substring(path.length)] && node && node.common) { if (node.common.itemsMap) { for (var commonItem in node.common.itemsMap) { recurse[nodePath+commonItem] = true; } } if (node.local && node.local.itemsMap) { for (var localItem in node.local.itemsMap) { recurse[nodePath+localItem] = true; } } if (node.remote || isFolder(nodePath)) { changedNodes[nodePath] = undefined; } else { changedNodes[nodePath] = this.autoMerge(node); if (typeof changedNodes[nodePath] === 'undefined') { var parentPath = this.getParentPath(nodePath); var parentNode = changedNodes[parentPath]; var itemName = nodePath.substring(path.length); if (parentNode && parentNode.local) { delete parentNode.local.itemsMap[itemName]; if (equal(parentNode.local.itemsMap, parentNode.common.itemsMap)) { delete parentNode.local; } } } } } } return this.deleteRemoteTrees(Object.keys(recurse), changedNodes).then(function (changedObjs2) { return this.local.setNodes(this.flush(changedObjs2)); }.bind(this)); }.bind(this)); }, deleteRemoteTrees: function (paths, changedNodes) { if (paths.length === 0) { return Promise.resolve(changedNodes); } return this.local.getNodes(paths).then(function (nodes) { var subPaths = {}; collectSubPaths = function (folder, path) { if (folder && folder.itemsMap) { for (var itemName in folder.itemsMap) { subPaths[path+itemName] = true; } } }; for (var path in nodes) { var node = nodes[path]; // TODO Why check for the node here? I don't think this check ever applies if (!node) { continue; } if (isFolder(path)) { collectSubPaths(node.common, path); collectSubPaths(node.local, path); } else { if (node.common && typeof(node.common.body) !== undefined) { changedNodes[path] = deepClone(node); changedNodes[path].remote = { body: false, timestamp: this.now() }; changedNodes[path] = this.autoMerge(changedNodes[path]); } } } // Recurse whole tree depth levels at once: return this.deleteRemoteTrees(Object.keys(subPaths), changedNodes).then(function (changedNodes2) { return this.local.setNodes(this.flush(changedNodes2)); }.bind(this)); }.bind(this)); }, completeFetch: function (path, bodyOrItemsMap, contentType, revision) { var paths; var parentPath; var pathsFromRootArr = pathsFromRoot(path); if (isFolder(path)) { paths = [path]; } else { parentPath = pathsFromRootArr[1]; paths = [path, parentPath]; } return this.local.getNodes(paths).then(function (nodes) { var itemName; var missingChildren = {}; var node = nodes[path]; var parentNode; var collectMissingChildren = function (folder) { if (folder && folder.itemsMap) { for (var itemName in folder.itemsMap) { if (!bodyOrItemsMap[itemName]) { missingChildren[itemName] = true; } } } }; if (typeof(node) !== 'object' || node.path !== path || typeof(node.common) !== 'object') { node = { path: path, common: {} }; nodes[path] = node; } node.remote = { revision: revision, timestamp: this.now() }; if (isFolder(path)) { collectMissingChildren(node.common); collectMissingChildren(node.remote); node.remote.itemsMap = {}; for (itemName in bodyOrItemsMap) { node.remote.itemsMap[itemName] = true; } } else { node.remote.body = bodyOrItemsMap; node.remote.contentType = contentType; parentNode = nodes[parentPath]; if (parentNode && parentNode.local && parentNode.local.itemsMap) { itemName = path.substring(parentPath.length); parentNode.local.itemsMap[itemName] = true; if (equal(parentNode.local.itemsMap, parentNode.common.itemsMap)) { delete parentNode.local; } } } nodes[path] = this.autoMerge(node); return { toBeSaved: nodes, missingChildren: missingChildren }; }.bind(this)); }, completePush: function (path, action, conflict, revision) { return this.local.getNodes([path]).then(function (nodes) { var node = nodes[path]; if (!node.push) { this.stopped = true; throw new Error('completePush called but no push version!'); } if (conflict) { RemoteStorage.log('[Sync] We have a conflict'); if (!node.remote || node.remote.revision !== revision) { node.remote = { revision: revision || 'conflict', timestamp: this.now() }; delete node.push; } nodes[path] = this.autoMerge(node); } else { node.common = { revision: revision, timestamp: this.now() }; if (action === 'put') { node.common.body = node.push.body; node.common.contentType = node.push.contentType; if (equal(node.local.body, node.push.body) && node.local.contentType === node.push.contentType) { delete node.local; } delete node.push; } else if (action === 'delete') { if (node.local.body === false) { // No new local changes since push; flush it. nodes[path] = undefined; } else { delete node.push; } } } return this.local.setNodes(this.flush(nodes)); }.bind(this)); }, dealWithFailure: function (path, action, statusMeaning) { return this.local.getNodes([path]).then(function (nodes) { if (nodes[path]) { delete nodes[path].push; return this.local.setNodes(this.flush(nodes)); } }.bind(this)); }, interpretStatus: function (statusCode) { // if (typeof statusCode.length === 'number') { // statusCode = statusCode[0]; // } if (statusCode === 'offline' || statusCode === 'timeout') { return { successful: false, networkProblems: true, statusCode: statusCode }; } var series = Math.floor(statusCode / 100); return { successful: (series === 2 || statusCode === 304 || statusCode === 412 || statusCode === 404), conflict: (statusCode === 412), unAuth: ((statusCode === 401 && this.remote.token !== RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN) || statusCode === 402 || statusCode === 403), notFound: (statusCode === 404), changed: (statusCode !== 304), statusCode: statusCode }; }, handleGetResponse: function (path, status, bodyOrItemsMap, contentType, revision) { if (status.notFound) { if (isFolder(path)) { bodyOrItemsMap = {}; } else { bodyOrItemsMap = false; } } if (status.changed) { return this.completeFetch(path, bodyOrItemsMap, contentType, revision).then(function (dataFromFetch) { if (isFolder(path)) { if (this.corruptServerItemsMap(bodyOrItemsMap)) { RemoteStorage.log('[Sync] WARNING: Discarding corrupt folder description from server for ' + path); return false; } else { return this.markChildren(path, bodyOrItemsMap, dataFromFetch.toBeSaved, dataFromFetch.missingChildren).then(function () { return true; }); } } else { return this.local.setNodes(this.flush(dataFromFetch.toBeSaved)).then(function () { return true; }); } }.bind(this)); } else { return this.updateCommonTimestamp(path, revision).then(function () { return true; }); } }, handleResponse: function (path, action, r) { var status = this.interpretStatus(r.statusCode); if (status.successful) { if (action === 'get') { return this.handleGetResponse(path, status, r.body, r.contentType, r.revision); } else if (action === 'put' || action === 'delete') { return this.completePush(path, action, status.conflict, r.revision).then(function () { return true; }); } else { throw new Error('cannot handle response for unknown action', action); } } else { // Unsuccessful var error; if (status.unAuth) { error = new RemoteStorage.Unauthorized(); } else if (status.networkProblems) { error = new RemoteStorage.SyncError('Network request failed.'); this.remote.online = false; } else { error = new Error('HTTP response code ' + status.statusCode + ' received.'); } return this.dealWithFailure(path, action, status).then(function () { remoteStorage._emit('error', error); throw error; }); } }, numThreads: 10, finishTask: function (task) { if (task.action === undefined) { delete this._running[task.path]; return; } var self = this; return task.promise.then(function (r) { return self.handleResponse(task.path, task.action, r); }, function (err) { RemoteStorage.log('[Sync] wireclient rejects its promise!', task.path, task.action, err); return self.handleResponse(task.path, task.action, {statusCode: 'offline'}); }) .then(function (completed) { delete self._timeStarted[task.path]; delete self._running[task.path]; self.remote.online = true; if (completed) { if (self._tasks[task.path]) { for (var i=0; i<self._tasks[task.path].length; i++) { self._tasks[task.path][i](); } delete self._tasks[task.path]; } } self._emit('req-done'); self.collectTasks(false).then(function () { // See if there are any more tasks that are not refresh tasks if (!self.hasTasks() || self.stopped) { RemoteStorage.log('[Sync] Sync is done! Reschedule?', Object.getOwnPropertyNames(self._tasks).length, self.stopped); if (!self.done) { self.done = true; self._emit('done'); } } else { // Use a 10ms timeout to let the JavaScript runtime catch its breath // (and hopefully force an IndexedDB auto-commit?), and also to cause // the threads to get staggered and get a good spread over time: setTimeout(function () { self.doTasks(); }, 10); } }); }, function (err) { console.error('[Sync] Error', err); delete self._timeStarted[task.path]; delete self._running[task.path]; self._emit('req-done'); if (!self.done) { self.done = true; self._emit('done'); } }); }, doTasks: function () { var numToHave, numAdded = 0, numToAdd, path; if (this.remote.connected) { if (this.remote.online) { numToHave = this.numThreads; } else { numToHave = 1; } } else { numToHave = 0; } numToAdd = numToHave - Object.getOwnPropertyNames(this._running).length; if (numToAdd <= 0) { return true; } for (path in this._tasks) { if (!this._running[path]) { this._timeStarted = this.now(); this._running[path] = this.doTask(path); this._running[path].then(this.finishTask.bind(this)); numAdded++; if (numAdded >= numToAdd) { return true; } } } return (numAdded >= numToAdd); }, collectTasks: function (alsoCheckRefresh) { if (this.hasTasks() || this.stopped) { return Promise.resolve(); } return this.collectDiffTasks().then(function (numDiffs) { if (numDiffs || alsoCheckRefresh === false) { return Promise.resolve(); } else { return this.collectRefreshTasks(); } }.bind(this), function (err) { throw err; }); }, addTask: function (path, cb) { if (!this._tasks[path]) { this._tasks[path] = []; } if (typeof(cb) === 'function') { this._tasks[path].push(cb); } }, /** * Method: sync **/ sync: function () { this.done = false; if (!this.doTasks()) { return this.collectTasks().then(function () { try { this.doTasks(); } catch(e) { console.error('[Sync] doTasks error', e); } }.bind(this), function (e) { console.error('[Sync] Sync error', e); throw new Error('Local cache unavailable'); }); } else { return Promise.resolve(); } }, }; /** * Method: getSyncInterval * * Get the value of the sync interval when application is in the foreground * * Returns a number of milliseconds * */ RemoteStorage.prototype.getSyncInterval = function () { return syncInterval; }; /** * Method: setSyncInterval * * Set the value of the sync interval when application is in the foreground * * Parameters: * interval - sync interval in milliseconds * */ RemoteStorage.prototype.setSyncInterval = function (interval) { if (!isValidInterval(interval)) { throw interval + " is not a valid sync interval"; } var oldValue = syncInterval; syncInterval = parseInt(interval, 10); this._emit('sync-interval-change', {oldValue: oldValue, newValue: interval}); }; /** * Method: getBackgroundSyncInterval * * Get the value of the sync interval when application is in the background * * Returns a number of milliseconds * */ RemoteStorage.prototype.getBackgroundSyncInterval = function () { return backgroundSyncInterval; }; /** * Method: setBackgroundSyncInterval * * Set the value of the sync interval when the application is in the background * * Parameters: * interval - sync interval in milliseconds * */ RemoteStorage.prototype.setBackgroundSyncInterval = function (interval) { if(!isValidInterval(interval)) { throw interval + " is not a valid sync interval"; } var oldValue = backgroundSyncInterval; backgroundSyncInterval = parseInt(interval, 10); this._emit('sync-interval-change', {oldValue: oldValue, newValue: interval}); }; /** * Method: getCurrentSyncInterval * * Get the value of the current sync interval * * Returns a number of milliseconds * */ RemoteStorage.prototype.getCurrentSyncInterval = function () { return isBackground ? backgroundSyncInterval : syncInterval; }; var SyncError = function (originalError) { var msg = 'Sync failed: '; if (typeof(originalError) === 'object' && 'message' in originalError) { msg += originalError.message; } else { msg += originalError; } this.originalError = originalError; this.message = msg; }; SyncError.prototype = new Error(); SyncError.prototype.constructor = SyncError; RemoteStorage.SyncError = SyncError; RemoteStorage.prototype.syncCycle = function () { if (this.sync.stopped) { return; } this.sync.on('done', function () { RemoteStorage.log('[Sync] Sync done. Setting timer to', this.getCurrentSyncInterval()); if (!this.sync.stopped) { if (this._syncTimer) { clearTimeout(this._syncTimer); } this._syncTimer = setTimeout(this.sync.sync.bind(this.sync), this.getCurrentSyncInterval()); } }.bind(this)); this.sync.sync(); }; RemoteStorage.prototype.stopSync = function () { if (this.sync) { RemoteStorage.log('[Sync] Stopping sync'); this.sync.stopped = true; } else { // TODO When is this ever the case and what is syncStopped for then? RemoteStorage.log('[Sync] Will instantiate sync stopped'); this.syncStopped = true; } }; RemoteStorage.prototype.startSync = function () { this.sync.stopped = false; this.syncStopped = false; this.sync.sync(); }; var syncCycleCb; RemoteStorage.Sync._rs_init = function (remoteStorage) { syncCycleCb = function () { RemoteStorage.log('[Sync] syncCycleCb calling syncCycle'); if (RemoteStorage.Env.isBrowser()) { handleVisibility.bind(remoteStorage)(); } if (!remoteStorage.sync) { // Call this now that all other modules are also ready: remoteStorage.sync = new RemoteStorage.Sync( remoteStorage.local, remoteStorage.remote, remoteStorage.access, remoteStorage.caching); if (remoteStorage.syncStopped) { RemoteStorage.log('[Sync] Instantiating sync stopped'); remoteStorage.sync.stopped = true; delete remoteStorage.syncStopped; } } RemoteStorage.log('[Sync] syncCycleCb calling syncCycle'); remoteStorage.syncCycle(); }; remoteStorage.on('ready', syncCycleCb); }; RemoteStorage.Sync._rs_cleanup = function (remoteStorage) { remoteStorage.stopSync(); remoteStorage.removeEventListener('ready', syncCycleCb); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/cachinglayer.js **/ (function () { /** * Interface: cachinglayer * * This module defines functions that are mixed into remoteStorage.local when * it is instantiated (currently one of indexeddb.js, localstorage.js, or * inmemorystorage.js). * * All remoteStorage.local implementations should therefore implement * this.getNodes, this.setNodes, and this.forAllNodes. The rest is blended in * here to create a GPD (get/put/delete) interface which the BaseClient can * talk to. */ var isFolder = RemoteStorage.util.isFolder; var isDocument = RemoteStorage.util.isDocument; var deepClone = RemoteStorage.util.deepClone; var equal = RemoteStorage.util.equal; function getLatest(node) { if (typeof(node) !== 'object' || typeof(node.path) !== 'string') { return; } if (isFolder(node.path)) { if (node.local && node.local.itemsMap) { return node.local; } if (node.common && node.common.itemsMap) { return node.common; } } else { if (node.local && node.local.body && node.local.contentType) { return node.local; } if (node.common && node.common.body && node.common.contentType) { return node.common; } // Migration code! Once all apps use at least this version of the lib, we // can publish clean-up code that migrates over any old-format data, and // stop supporting it. For now, new apps will support data in both // formats, thanks to this: if (node.body && node.contentType) { return { body: node.body, contentType: node.contentType }; } } } function isOutdated(nodes, maxAge) { var path, node; for (path in nodes) { if (nodes[path] && nodes[path].remote) { return true; } var nodeVersion = getLatest(nodes[path]); if (nodeVersion && nodeVersion.timestamp && (new Date().getTime()) - nodeVersion.timestamp <= maxAge) { return false; } else if (!nodeVersion) { return true; } } return true; } var pathsFromRoot = RemoteStorage.util.pathsFromRoot; function makeNode(path) { var node = { path: path, common: { } }; if (isFolder(path)) { node.common.itemsMap = {}; } return node; } function updateFolderNodeWithItemName(node, itemName) { if (!node.common) { node.common = { itemsMap: {} }; } if (!node.common.itemsMap) { node.common.itemsMap = {}; } if (!node.local) { node.local = deepClone(node.common); } if (!node.local.itemsMap) { node.local.itemsMap = node.common.itemsMap; } node.local.itemsMap[itemName] = true; return node; } var methods = { // TODO: improve our code structure so that this function // could call sync.queueGetRequest directly instead of needing // this hacky third parameter as a callback get: function (path, maxAge, queueGetRequest) { var self = this; if (typeof(maxAge) === 'number') { return self.getNodes(pathsFromRoot(path)) .then(function (objs) { var node = getLatest(objs[path]); if (isOutdated(objs, maxAge)) { return queueGetRequest(path); } else if (node) { return {statusCode: 200, body: node.body || node.itemsMap, contentType: node.contentType}; } else { return {statusCode: 404}; } }); } else { return self.getNodes([path]) .then(function (objs) { var node = getLatest(objs[path]); if (node) { if (isFolder(path)) { for (var i in node.itemsMap) { // the hasOwnProperty check here is only because our jshint settings require it: if (node.itemsMap.hasOwnProperty(i) && node.itemsMap[i] === false) { delete node.itemsMap[i]; } } } return {statusCode: 200, body: node.body || node.itemsMap, contentType: node.contentType}; } else { return {statusCode: 404}; } }); } }, put: function (path, body, contentType) { var paths = pathsFromRoot(path); var self = this; function _processNodes(paths, nodes) { try { for (var i = 0, len = paths.length; i < len; i++) { var path = paths[i]; var node = nodes[path]; var previous; if (!node) { nodes[path] = node = makeNode(path); } // Document if (i === 0) { previous = getLatest(node); node.local = { body: body, contentType: contentType, previousBody: (previous ? previous.body : undefined), previousContentType: (previous ? previous.contentType : undefined), }; } // Folder else { var itemName = paths[i-1].substring(path.length); node = updateFolderNodeWithItemName(node, itemName); } } return nodes; } catch (e) { RemoteStorage.log('[Cachinglayer] Error during PUT', nodes, i, e); throw e; } } return this._updateNodes(paths, _processNodes); }, delete: function (path) { var paths = pathsFromRoot(path); return this._updateNodes(paths, function (paths, nodes) { for (var i = 0, len = paths.length; i < len; i++) { var path = paths[i]; var node = nodes[path]; if (!node) { throw new Error('Cannot delete non-existing node '+path); } if (i === 0) { // Document previous = getLatest(node); node.local = { body: false, previousBody: (previous ? previous.body : undefined), previousContentType: (previous ? previous.contentType : undefined), }; } else { // Folder if (!node.local) { node.local = deepClone(node.common); } var itemName = paths[i-1].substring(path.length); delete node.local.itemsMap[itemName]; if (Object.getOwnPropertyNames(node.local.itemsMap).length > 0) { // This folder still contains other items, don't remove any further ancestors break; } } } return nodes; }); }, flush: function (path) { var self = this; return self._getAllDescendentPaths(path).then(function (paths) { return self.getNodes(paths); }).then(function (nodes) { for (var path in nodes) { var node = nodes[path]; if (node && node.common && node.local) { self._emitChange({ path: node.path, origin: 'local', oldValue: (node.local.body === false ? undefined : node.local.body), newValue: (node.common.body === false ? undefined : node.common.body) }); } nodes[path] = undefined; } return self.setNodes(nodes); }); }, _emitChange: function (obj) { if (RemoteStorage.config.changeEvents[obj.origin]) { this._emit('change', obj); } }, fireInitial: function () { if (!RemoteStorage.config.changeEvents.local) { return; } var self = this; self.forAllNodes(function (node) { var latest; if (isDocument(node.path)) { latest = getLatest(node); if (latest) { self._emitChange({ path: node.path, origin: 'local', oldValue: undefined, oldContentType: undefined, newValue: latest.body, newContentType: latest.contentType }); } } }).then(function () { self._emit('local-events-done'); }); }, onDiff: function (diffHandler) { this.diffHandler = diffHandler; }, migrate: function (node) { if (typeof(node) === 'object' && !node.common) { node.common = {}; if (typeof(node.path) === 'string') { if (node.path.substr(-1) === '/' && typeof(node.body) === 'object') { node.common.itemsMap = node.body; } } else { //save legacy content of document node as local version if (!node.local) { node.local = {}; } node.local.body = node.body; node.local.contentType = node.contentType; } } return node; }, // FIXME // this process of updating nodes needs to be heavily documented first, then // refactored. Right now it's almost impossible to refactor as there's no // explanation of why things are implemented certain ways or what the goal(s) // of the behavior are. -slvrbckt _updateNodesRunning: false, _updateNodesQueued: [], _updateNodes: function (paths, _processNodes) { var pending = Promise.defer(); this._doUpdateNodes(paths, _processNodes, pending); return pending.promise; }, _doUpdateNodes: function (paths, _processNodes, promise) { var self = this; if (self._updateNodesRunning) { self._updateNodesQueued.push({ paths: paths, cb: _processNodes, promise: promise }); return; } else { self._updateNodesRunning = true; } self.getNodes(paths).then(function (nodes) { var existingNodes = deepClone(nodes); var changeEvents = []; var node; nodes = _processNodes(paths, nodes); for (var path in nodes) { node = nodes[path]; if (equal(node, existingNodes[path])) { delete nodes[path]; } else if (isDocument(path)) { changeEvents.push({ path: path, origin: 'window', oldValue: node.local.previousBody, newValue: node.local.body === false ? undefined : node.local.body, oldContentType: node.local.previousContentType, newContentType: node.local.contentType }); delete node.local.previousBody; delete node.local.previousContentType; } } self.setNodes(nodes).then(function () { self._emitChangeEvents(changeEvents); promise.resolve({statusCode: 200}); }); }).then(function () { return Promise.resolve(); }, function (err) { promise.reject(err); }).then(function () { self._updateNodesRunning = false; var nextJob = self._updateNodesQueued.shift(); if (nextJob) { self._doUpdateNodes(nextJob.paths, nextJob.cb, nextJob.promise); } }); }, _emitChangeEvents: function (events) { for (var i = 0, len = events.length; i < len; i++) { this._emitChange(events[i]); if (this.diffHandler) { this.diffHandler(events[i].path); } } }, _getAllDescendentPaths: function (path) { var self = this; if (isFolder(path)) { return self.getNodes([path]).then(function (nodes) { var allPaths = [path]; var latest = getLatest(nodes[path]); var itemNames = Object.keys(latest.itemsMap); var calls = itemNames.map(function (itemName) { return self._getAllDescendentPaths(path+itemName).then(function (paths) { for (var i = 0, len = paths.length; i < len; i++) { allPaths.push(paths[i]); } }); }); return Promise.all(calls).then(function () { return allPaths; }); }); } else { return Promise.resolve([path]); } }, _getInternals: function () { return { getLatest: getLatest, makeNode: makeNode, isOutdated: isOutdated }; } }; /** * Function: cachingLayer * * Mixes common caching layer functionality into an object. * * The first parameter is always the object to be extended. * * Example: * (start code) * var MyConstructor = function () { * cachingLayer(this); * }; * (end code) */ RemoteStorage.cachingLayer = function (object) { for (var key in methods) { object[key] = methods[key]; } }; })(); /** FILE: src/indexeddb.js **/ (function (global) { /** * Class: RemoteStorage.IndexedDB * * * IndexedDB Interface * ------------------- * * TODO rewrite, doesn't expose GPD anymore, it's in cachinglayer now * * This file exposes a get/put/delete interface, accessing data in an IndexedDB. * * There are multiple parts to this interface: * * The RemoteStorage integration: * - RemoteStorage.IndexedDB._rs_supported() determines if IndexedDB support * is available. If it isn't, RemoteStorage won't initialize the feature. * - RemoteStorage.IndexedDB._rs_init() initializes the feature. It returns * a promise that is fulfilled as soon as the database has been opened and * migrated. * * The storage interface (RemoteStorage.IndexedDB object): * - Usually this is accessible via "remoteStorage.local" * - #get() takes a path and returns a promise. * - #put() takes a path, body and contentType and also returns a promise. * - #delete() takes a path and also returns a promise. * - #on('change', ...) events, being fired whenever something changes in * the storage. Change events roughly follow the StorageEvent pattern. * They have "oldValue" and "newValue" properties, which can be used to * distinguish create/update/delete operations and analyze changes in * change handlers. In addition they carry a "origin" property, which * is either "window", "local", or "remote". "remote" events are fired * whenever a change comes in from RemoteStorage.Sync. * * The sync interface (also on RemoteStorage.IndexedDB object): * - #getNodes([paths]) returns the requested nodes in a promise. * - #setNodes(map) stores all the nodes given in the (path -> node) map. * */ var RS = RemoteStorage; var DB_VERSION = 2; var DEFAULT_DB_NAME = 'remotestorage'; var DEFAULT_DB; RS.IndexedDB = function (database) { this.db = database || DEFAULT_DB; if (!this.db) { RemoteStorage.log("[IndexedDB] Failed to open DB"); return undefined; } RS.cachingLayer(this); RS.eventHandling(this, 'change', 'local-events-done'); this.getsRunning = 0; this.putsRunning = 0; /** * Property: changesQueued * * Given a node for which uncommitted changes exist, this cache * stores either the entire uncommitted node, or false for a deletion. * The node's path is used as the key. * * changesQueued stores changes for which no IndexedDB transaction has * been started yet. */ this.changesQueued = {}; /** * Property: changesRunning * * Given a node for which uncommitted changes exist, this cache * stores either the entire uncommitted node, or false for a deletion. * The node's path is used as the key. * * At any time there is at most one IndexedDB transaction running. * changesRunning stores the changes that are included in that currently * running IndexedDB transaction, or if none is running, of the last one * that ran. */ this.changesRunning = {}; }; RS.IndexedDB.prototype = { getNodes: function (paths) { var misses = [], fromCache = {}; for (var i = 0, len = paths.length; i < len; i++) { if (this.changesQueued[paths[i]] !== undefined) { fromCache[paths[i]] = RemoteStorage.util.deepClone(this.changesQueued[paths[i]] || undefined); } else if(this.changesRunning[paths[i]] !== undefined) { fromCache[paths[i]] = RemoteStorage.util.deepClone(this.changesRunning[paths[i]] || undefined); } else { misses.push(paths[i]); } } if (misses.length > 0) { return this.getNodesFromDb(misses).then(function (nodes) { for (var i in fromCache) { nodes[i] = fromCache[i]; } return nodes; }); } else { return Promise.resolve(fromCache); } }, setNodes: function (nodes) { for (var i in nodes) { this.changesQueued[i] = nodes[i] || false; } this.maybeFlush(); return Promise.resolve(); }, maybeFlush: function () { if (this.putsRunning === 0) { this.flushChangesQueued(); } else { if (!this.commitSlownessWarning) { this.commitSlownessWarning = setInterval(function () { console.log('WARNING: waited more than 10 seconds for previous commit to finish'); }, 10000); } } }, flushChangesQueued: function () { if (this.commitSlownessWarning) { clearInterval(this.commitSlownessWarning); this.commitSlownessWarning = null; } if (Object.keys(this.changesQueued).length > 0) { this.changesRunning = this.changesQueued; this.changesQueued = {}; this.setNodesInDb(this.changesRunning).then(this.flushChangesQueued.bind(this)); } }, getNodesFromDb: function (paths) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readonly'); var nodes = transaction.objectStore('nodes'); var retrievedNodes = {}; var startTime = new Date().getTime(); this.getsRunning++; paths.map(function (path, i) { nodes.get(path).onsuccess = function (evt) { retrievedNodes[path] = evt.target.result; }; }); transaction.oncomplete = function () { pending.resolve(retrievedNodes); this.getsRunning--; }.bind(this); transaction.onerror = transaction.onabort = function () { pending.reject('get transaction error/abort'); this.getsRunning--; }.bind(this); return pending.promise; }, setNodesInDb: function (nodes) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readwrite'); var nodesStore = transaction.objectStore('nodes'); var startTime = new Date().getTime(); this.putsRunning++; RemoteStorage.log('[IndexedDB] Starting put', nodes, this.putsRunning); for (var path in nodes) { var node = nodes[path]; if(typeof(node) === 'object') { try { nodesStore.put(node); } catch(e) { RemoteStorage.log('[IndexedDB] Error while putting', node, e); throw e; } } else { try { nodesStore.delete(path); } catch(e) { RemoteStorage.log('[IndexedDB] Error while removing', nodesStore, node, e); throw e; } } } transaction.oncomplete = function () { this.putsRunning--; RemoteStorage.log('[IndexedDB] Finished put', nodes, this.putsRunning, (new Date().getTime() - startTime)+'ms'); pending.resolve(); }.bind(this); transaction.onerror = function () { this.putsRunning--; pending.reject('transaction error'); }.bind(this); transaction.onabort = function () { pending.reject('transaction abort'); this.putsRunning--; }.bind(this); return pending.promise; }, reset: function (callback) { var dbName = this.db.name; var self = this; this.db.close(); RS.IndexedDB.clean(this.db.name, function() { RS.IndexedDB.open(dbName, function (err, other) { if (err) { RemoteStorage.log('[IndexedDB] Error while resetting local storage', err); } else { // hacky! self.db = other; } if (typeof callback === 'function') { callback(self); } }); }); }, forAllNodes: function (cb) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readonly'); var cursorReq = transaction.objectStore('nodes').openCursor(); cursorReq.onsuccess = function (evt) { var cursor = evt.target.result; if (cursor) { cb(this.migrate(cursor.value)); cursor.continue(); } else { pending.resolve(); } }.bind(this); return pending.promise; }, closeDB: function () { this.db.close(); } }; RS.IndexedDB.open = function (name, callback) { var timer = setTimeout(function () { callback("timeout trying to open db"); }, 10000); try { var req = indexedDB.open(name, DB_VERSION); req.onerror = function () { RemoteStorage.log('[IndexedDB] Opening DB failed', req); clearTimeout(timer); callback(req.error); }; req.onupgradeneeded = function (event) { var db = req.result; RemoteStorage.log("[IndexedDB] Upgrade: from ", event.oldVersion, " to ", event.newVersion); if (event.oldVersion !== 1) { RemoteStorage.log("[IndexedDB] Creating object store: nodes"); db.createObjectStore('nodes', { keyPath: 'path' }); } RemoteStorage.log("[IndexedDB] Creating object store: changes"); db.createObjectStore('changes', { keyPath: 'path' }); }; req.onsuccess = function () { clearTimeout(timer); // check if all object stores exist var db = req.result; if(!db.objectStoreNames.contains('nodes') || !db.objectStoreNames.contains('changes')) { RemoteStorage.log("[IndexedDB] Missing object store. Resetting the database."); RS.IndexedDB.clean(name, function() { RS.IndexedDB.open(name, callback); }); return; } callback(null, req.result); }; } catch(error) { RemoteStorage.log("[IndexedDB] Failed to open database: " + error); RemoteStorage.log("[IndexedDB] Resetting database and trying again."); clearTimeout(timer); RS.IndexedDB.clean(name, function() { RS.IndexedDB.open(name, callback); }); }; }; RS.IndexedDB.clean = function (databaseName, callback) { var req = indexedDB.deleteDatabase(databaseName); req.onsuccess = function () { RemoteStorage.log('[IndexedDB] Done removing DB'); callback(); }; req.onerror = req.onabort = function (evt) { console.error('Failed to remove database "' + databaseName + '"', evt); }; }; RS.IndexedDB._rs_init = function (remoteStorage) { var pending = Promise.defer(); RS.IndexedDB.open(DEFAULT_DB_NAME, function (err, db) { if (err) { pending.reject(err); } else { DEFAULT_DB = db; db.onerror = function () { remoteStorage._emit('error', err); }; pending.resolve(); } }); return pending.promise; }; RS.IndexedDB._rs_supported = function () { var pending = Promise.defer(); global.indexedDB = global.indexedDB || global.webkitIndexedDB || global.mozIndexedDB || global.oIndexedDB || global.msIndexedDB; // Detect browsers with known IndexedDb issues (e.g. Android pre-4.4) var poorIndexedDbSupport = false; if (typeof global.navigator !== 'undefined' && global.navigator.userAgent.match(/Android (2|3|4\.[0-3])/)) { // Chrome and Firefox support IndexedDB if (!navigator.userAgent.match(/Chrome|Firefox/)) { poorIndexedDbSupport = true; } } if ('indexedDB' in global && !poorIndexedDbSupport) { try { var check = indexedDB.open("rs-check"); check.onerror = function (event) { pending.reject(); }; check.onsuccess = function (event) { indexedDB.deleteDatabase("rs-check"); pending.resolve(); }; } catch(e) { pending.reject(); } } else { pending.reject(); } return pending.promise; }; RS.IndexedDB._rs_cleanup = function (remoteStorage) { var pending = Promise.defer(); if (remoteStorage.local) { remoteStorage.local.closeDB(); } RS.IndexedDB.clean(DEFAULT_DB_NAME, function () { pending.resolve(); }); return pending.promise; }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/localstorage.js **/ (function (global) { /** * Class: RemoteStorage.LocalStorage * * localStorage caching adapter. Used when no IndexedDB available. **/ var NODES_PREFIX = "remotestorage:cache:nodes:"; var CHANGES_PREFIX = "remotestorage:cache:changes:"; RemoteStorage.LocalStorage = function () { RemoteStorage.cachingLayer(this); RemoteStorage.log('[LocalStorage] Registering events'); RemoteStorage.eventHandling(this, 'change', 'local-events-done'); }; function b64ToUint6(nChr) { return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0; } function isBinary(node) { return node.match(/charset=binary/); } function isRemoteStorageKey(key) { return key.substr(0, NODES_PREFIX.length) === NODES_PREFIX || key.substr(0, CHANGES_PREFIX.length) === CHANGES_PREFIX; } function isNodeKey(key) { return key.substr(0, NODES_PREFIX.length) === NODES_PREFIX; } RemoteStorage.LocalStorage.prototype = { getNodes: function (paths) { var nodes = {}; for(var i = 0, len = paths.length; i < len; i++) { try { nodes[paths[i]] = JSON.parse(localStorage[NODES_PREFIX+paths[i]]); } catch(e) { nodes[paths[i]] = undefined; } } return Promise.resolve(nodes); }, setNodes: function (nodes) { for (var path in nodes) { // TODO shouldn't we use getItem/setItem? localStorage[NODES_PREFIX+path] = JSON.stringify(nodes[path]); } return Promise.resolve(); }, forAllNodes: function (cb) { var node; for(var i = 0, len = localStorage.length; i < len; i++) { if (isNodeKey(localStorage.key(i))) { try { node = this.migrate(JSON.parse(localStorage[localStorage.key(i)])); } catch(e) { node = undefined; } if (node) { cb(node); } } } return Promise.resolve(); } }; RemoteStorage.LocalStorage._rs_init = function () {}; RemoteStorage.LocalStorage._rs_supported = function () { return 'localStorage' in global; }; // TODO tests missing! RemoteStorage.LocalStorage._rs_cleanup = function () { var keys = []; for (var i = 0, len = localStorage.length; i < len; i++) { var key = localStorage.key(i); if (isRemoteStorageKey(key)) { keys.push(key); } } keys.forEach(function (key) { RemoteStorage.log('[LocalStorage] Removing', key); delete localStorage[key]; }); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/inmemorystorage.js **/ (function (global) { /** * Class: RemoteStorage.InMemoryStorage * * In-memory caching adapter. Used when no IndexedDB or localStorage * available. **/ RemoteStorage.InMemoryStorage = function () { RemoteStorage.cachingLayer(this); RemoteStorage.log('[InMemoryStorage] Registering events'); RemoteStorage.eventHandling(this, 'change', 'local-events-done'); this._storage = {}; }; RemoteStorage.InMemoryStorage.prototype = { getNodes: function (paths) { var nodes = {}; for(var i = 0, len = paths.length; i < len; i++) { nodes[paths[i]] = this._storage[paths[i]]; } return Promise.resolve(nodes); }, setNodes: function (nodes) { for (var path in nodes) { if (nodes[path] === undefined) { delete this._storage[path]; } else { this._storage[path] = nodes[path]; } } return Promise.resolve(); }, forAllNodes: function (cb) { for (var path in this._storage) { cb(this.migrate(this._storage[path])); } return Promise.resolve(); } }; RemoteStorage.InMemoryStorage._rs_init = function () {}; RemoteStorage.InMemoryStorage._rs_supported = function () { // In-memory storage is always supported return true; }; RemoteStorage.InMemoryStorage._rs_cleanup = function () {}; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/modules.js **/ (function () { RemoteStorage.MODULES = {}; /* * Method: RemoteStorage.defineModule * * Method for defining a new remoteStorage data module * * Parameters: * moduleName - Name of the module * builder - Builder function defining the module * * The module builder function should return an object containing another * object called exports, which will be exported to any <RemoteStorage> * instance under the module's name. So when defining a locations module, * like in the example below, it would be accessible via * `remoteStorage.locations`, which would in turn have a `features` and a * `collections` property. * * The function receives a private and a public client, which are both * instances of <RemoteStorage.BaseClient>. In the following example, the * scope of privateClient is `/locations` and the scope of publicClient is * `/public/locations`. * * Example: * (start code) * RemoteStorage.defineModule('locations', function (privateClient, publicClient) { * return { * exports: { * features: privateClient.scope('features/').defaultType('feature'), * collections: privateClient.scope('collections/').defaultType('feature-collection') * } * }; * }); * (end code) */ RemoteStorage.defineModule = function (moduleName, builder) { RemoteStorage.MODULES[moduleName] = builder; Object.defineProperty(RemoteStorage.prototype, moduleName, { configurable: true, get: function () { var instance = this._loadModule(moduleName); Object.defineProperty(this, moduleName, { value: instance }); return instance; } }); if (moduleName.indexOf('-') !== -1) { var camelizedName = moduleName.replace(/\-[a-z]/g, function (s) { return s[1].toUpperCase(); }); Object.defineProperty(RemoteStorage.prototype, camelizedName, { get: function () { return this[moduleName]; } }); } }; RemoteStorage.prototype._loadModule = function (moduleName) { var builder = RemoteStorage.MODULES[moduleName]; if (builder) { var module = builder(new RemoteStorage.BaseClient(this, '/' + moduleName + '/'), new RemoteStorage.BaseClient(this, '/public/' + moduleName + '/')); return module.exports; } else { throw "Unknown module: " + moduleName; } }; RemoteStorage.prototype.defineModule = function (moduleName) { console.log("remoteStorage.defineModule is deprecated, use RemoteStorage.defineModule instead!"); RemoteStorage.defineModule.apply(RemoteStorage, arguments); }; })(); /** FILE: src/debug/inspect.js **/ (function() { function loadTable(table, storage, paths) { table.setAttribute('border', '1'); table.style.margin = '8px'; table.style.color = 'white'; table.innerHTML = ''; var thead = document.createElement('thead'); table.appendChild(thead); var titleRow = document.createElement('tr'); thead.appendChild(titleRow); ['Path', 'Content-Type', 'Revision'].forEach(function(label) { var th = document.createElement('th'); th.textContent = label; thead.appendChild(th); }); var tbody = document.createElement('tbody'); table.appendChild(tbody); function renderRow(tr, path, contentType, revision) { [path, contentType, revision].forEach(function(value) { var td = document.createElement('td'); td.textContent = value || ''; tr.appendChild(td); }); } function loadRow(path) { if (storage.connected === false) { return; } function processRow(status, body, contentType, revision) { if (status === 200) { var tr = document.createElement('tr'); tbody.appendChild(tr); renderRow(tr, path, contentType, revision); if (path[path.length - 1] === '/') { for (var key in body) { loadRow(path + key); } } } } storage.get(path).then(processRow); } paths.forEach(loadRow); } function renderWrapper(title, table, storage, paths) { var wrapper = document.createElement('div'); //wrapper.style.display = 'inline-block'; var heading = document.createElement('h2'); heading.textContent = title; wrapper.appendChild(heading); var updateButton = document.createElement('button'); updateButton.textContent = "Refresh"; updateButton.onclick = function() { loadTable(table, storage, paths); }; wrapper.appendChild(updateButton); if (storage.reset) { var resetButton = document.createElement('button'); resetButton.textContent = "Reset"; resetButton.onclick = function() { storage.reset(function(newStorage) { storage = newStorage; loadTable(table, storage, paths); }); }; wrapper.appendChild(resetButton); } wrapper.appendChild(table); loadTable(table, storage, paths); return wrapper; } function renderLocalChanges(local) { var wrapper = document.createElement('div'); //wrapper.style.display = 'inline-block'; var heading = document.createElement('h2'); heading.textContent = "Outgoing changes"; wrapper.appendChild(heading); var updateButton = document.createElement('button'); updateButton.textContent = "Refresh"; wrapper.appendChild(updateButton); var list = document.createElement('ul'); list.style.fontFamily = 'courier'; wrapper.appendChild(list); function updateList() { list.innerHTML = ''; local.forAllNodes(function(node) { if (node.local && node.local.body) { var el = document.createElement('li'); el.textContent = JSON.stringify(node.local); list.appendChild(el); } }); } updateButton.onclick = updateList; updateList(); return wrapper; } RemoteStorage.prototype.inspect = function() { var widget = document.createElement('div'); widget.id = 'remotestorage-inspect'; widget.style.position = 'absolute'; widget.style.top = 0; widget.style.left = 0; widget.style.background = 'black'; widget.style.color = 'white'; widget.style.border = 'groove 5px #ccc'; var controls = document.createElement('div'); controls.style.position = 'absolute'; controls.style.top = 0; controls.style.left = 0; var heading = document.createElement('strong'); heading.textContent = " remotestorage.js inspector "; controls.appendChild(heading); var syncButton; if (this.local) { syncButton = document.createElement('button'); syncButton.textContent = "Synchronize"; controls.appendChild(syncButton); } var closeButton = document.createElement('button'); closeButton.textContent = "Close"; closeButton.onclick = function() { document.body.removeChild(widget); }; controls.appendChild(closeButton); widget.appendChild(controls); var remoteRootPaths = []; for (var path in this.caching._rootPaths) { if (this.caching._rootPaths.hasOwnProperty(path)) { remoteRootPaths.push(path); } } var remoteTable = document.createElement('table'); var localTable = document.createElement('table'); widget.appendChild(renderWrapper("Remote", remoteTable, this.remote, remoteRootPaths)); if (this.local) { widget.appendChild(renderWrapper("Local", localTable, this.local, ['/'])); widget.appendChild(renderLocalChanges(this.local)); syncButton.onclick = function() { this.log('sync clicked'); this.sync.sync().then(function() { this.log('SYNC FINISHED'); loadTable(localTable, this.local, ['/']); }.bind(this), function(err) { console.error("SYNC FAILED", err, err.stack); }); }.bind(this); } document.body.appendChild(widget); }; })(); /** FILE: src/googledrive.js **/ (function (global) { /** * Class: RemoteStorage.GoogleDrive * * WORK IN PROGRESS, NOT RECOMMENDED FOR PRODUCTION USE * * To use this backend, you need to specify the app's client ID like so: * * (start code) * * remoteStorage.setApiKeys('googledrive', { * clientId: 'your-client-id' * }); * * (end code) * * An client ID can be obtained by registering your app in the Google * Developers Console: https://developers.google.com/drive/web/auth/web-client * * Docs: https://developers.google.com/drive/web/auth/web-client#create_a_client_id_and_client_secret **/ var RS = RemoteStorage; var BASE_URL = 'https://www.googleapis.com'; var AUTH_URL = 'https://accounts.google.com/o/oauth2/auth'; var AUTH_SCOPE = 'https://www.googleapis.com/auth/drive'; var GD_DIR_MIME_TYPE = 'application/vnd.google-apps.folder'; var RS_DIR_MIME_TYPE = 'application/json; charset=UTF-8'; function buildQueryString(params) { return Object.keys(params).map(function (key) { return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]); }).join('&'); } function fileNameFromMeta(meta) { return encodeURIComponent(meta.title) + (meta.mimeType === GD_DIR_MIME_TYPE ? '/' : ''); } function metaTitleFromFileName(filename) { if (filename.substr(-1) === '/') { filename = filename.substr(0, filename.length - 1); } return decodeURIComponent(filename); } function parentPath(path) { return path.replace(/[^\/]+\/?$/, ''); } function baseName(path) { var parts = path.split('/'); if (path.substr(-1) === '/') { return parts[parts.length-2]+'/'; } else { return parts[parts.length-1]; } } var Cache = function (maxAge) { this.maxAge = maxAge; this._items = {}; }; Cache.prototype = { get: function (key) { var item = this._items[key]; var now = new Date().getTime(); return (item && item.t >= (now - this.maxAge)) ? item.v : undefined; }, set: function (key, value) { this._items[key] = { v: value, t: new Date().getTime() }; } }; RS.GoogleDrive = function (remoteStorage, clientId) { RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); this.rs = remoteStorage; this.clientId = clientId; this._fileIdCache = new Cache(60 * 5); // ids expire after 5 minutes (is this a good idea?) }; RS.GoogleDrive.prototype = { connected: false, online: true, configure: function (settings) { // Settings parameter compatible with WireClient if (settings.token) { localStorage['remotestorage:googledrive:token'] = settings.token; this.token = settings.token; this.connected = true; this._emit('connected'); } else { this.connected = false; delete this.token; delete localStorage['remotestorage:googledrive:token']; } }, connect: function () { this.rs.setBackend('googledrive'); RS.Authorize(AUTH_URL, AUTH_SCOPE, String(RS.Authorize.getLocation()), this.clientId); }, stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, get: function (path, options) { if (path.substr(-1) === '/') { return this._getFolder(path, options); } else { return this._getFile(path, options); } }, put: function (path, body, contentType, options) { var self = this; function putDone(response) { if (response.status >= 200 && response.status < 300) { var meta = JSON.parse(response.responseText); var etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); return Promise.resolve({statusCode: 200, contentType: meta.mimeType, revision: etagWithoutQuotes}); } else if (response.status === 412) { return Promise.resolve({statusCode: 412, revision: 'conflict'}); } else { return Promise.reject("PUT failed with status " + response.status + " (" + response.responseText + ")"); } } return self._getFileId(path).then(function (id) { if (id) { if (options && (options.ifNoneMatch === '*')) { return putDone({ status: 412 }); } return self._updateFile(id, path, body, contentType, options).then(putDone); } else { return self._createFile(path, body, contentType, options).then(putDone); } }); }, 'delete': function (path, options) { var self = this; return self._getFileId(path).then(function (id) { if (!id) { // File doesn't exist. Ignore. return Promise.resolve({statusCode: 200}); } return self._getMeta(id).then(function (meta) { var etagWithoutQuotes; if ((typeof meta === 'object') && (typeof meta.etag === 'string')) { etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); } if (options && options.ifMatch && (options.ifMatch !== etagWithoutQuotes)) { return {statusCode: 412, revision: etagWithoutQuotes}; } return self._request('DELETE', BASE_URL + '/drive/v2/files/' + id, {}).then(function (response) { if (response.status === 200 || response.status === 204) { return {statusCode: 200}; } else { return Promise.reject("Delete failed: " + response.status + " (" + response.responseText + ")"); } }); }); }); }, _updateFile: function (id, path, body, contentType, options) { var self = this; var metadata = { mimeType: contentType }; var headers = { 'Content-Type': 'application/json; charset=UTF-8' }; if (options && options.ifMatch) { headers['If-Match'] = '"' + options.ifMatch + '"'; } return self._request('PUT', BASE_URL + '/upload/drive/v2/files/' + id + '?uploadType=resumable', { body: JSON.stringify(metadata), headers: headers }).then(function (response) { if (response.status === 412) { return (response); } else { return self._request('PUT', response.getResponseHeader('Location'), { body: contentType.match(/^application\/json/) ? JSON.stringify(body) : body }); } }); }, _createFile: function (path, body, contentType, options) { var self = this; return self._getParentId(path).then(function (parentId) { var fileName = baseName(path); var metadata = { title: metaTitleFromFileName(fileName), mimeType: contentType, parents: [{ kind: "drive#fileLink", id: parentId }] }; return self._request('POST', BASE_URL + '/upload/drive/v2/files?uploadType=resumable', { body: JSON.stringify(metadata), headers: { 'Content-Type': 'application/json; charset=UTF-8' } }).then(function (response) { return self._request('POST', response.getResponseHeader('Location'), { body: contentType.match(/^application\/json/) ? JSON.stringify(body) : body }); }); }); }, _getFile: function (path, options) { var self = this; return self._getFileId(path).then(function (id) { return self._getMeta(id).then(function (meta) { var etagWithoutQuotes; if (typeof(meta) === 'object' && typeof(meta.etag) === 'string') { etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); } if (options && options.ifNoneMatch && (etagWithoutQuotes === options.ifNoneMatch)) { return Promise.resolve({statusCode: 304}); } var options2 = {}; if (!meta.downloadUrl) { if (meta.exportLinks && meta.exportLinks['text/html']) { // Documents that were generated inside GoogleDocs have no // downloadUrl, but you can export them to text/html instead: meta.mimeType += ';export=text/html'; meta.downloadUrl = meta.exportLinks['text/html']; } else { // empty file return Promise.resolve({statusCode: 200, body: '', contentType: meta.mimeType, revision: etagWithoutQuotes}); } } if (meta.mimeType.match(/charset=binary/)) { options2.responseType = 'blob'; } return self._request('GET', meta.downloadUrl, options2).then(function (response) { var body = response.response; if (meta.mimeType.match(/^application\/json/)) { try { body = JSON.parse(body); } catch(e) {} } return Promise.resolve({statusCode: 200, body: body, contentType: meta.mimeType, revision: etagWithoutQuotes}); }); }); }); }, _getFolder: function (path, options) { var self = this; return self._getFileId(path).then(function (id) { var query, fields, data, i, etagWithoutQuotes, itemsMap; if (! id) { return Promise.resolve({statusCode: 404}); } query = '\'' + id + '\' in parents'; fields = 'items(downloadUrl,etag,fileSize,id,mimeType,title)'; return self._request('GET', BASE_URL + '/drive/v2/files?' + 'q=' + encodeURIComponent(query) + '&fields=' + encodeURIComponent(fields) + '&maxResults=1000', {}) .then(function (response) { if (response.status !== 200) { return Promise.reject('request failed or something: ' + response.status); } try { data = JSON.parse(response.responseText); } catch(e) { return Promise.reject('non-JSON response from GoogleDrive'); } itemsMap = {}; for (var i = 0, len = data.items.length; i < len; i++) { etagWithoutQuotes = data.items[i].etag.substring(1, data.items[i].etag.length-1); if (data.items[i].mimeType === GD_DIR_MIME_TYPE) { self._fileIdCache.set(path + data.items[i].title + '/', data.items[i].id); itemsMap[data.items[i].title + '/'] = { ETag: etagWithoutQuotes }; } else { self._fileIdCache.set(path + data.items[i].title, data.items[i].id); itemsMap[data.items[i].title] = { ETag: etagWithoutQuotes, 'Content-Type': data.items[i].mimeType, 'Content-Length': data.items[i].fileSize }; } } // FIXME: add revision of folder! return Promise.resolve({statusCode: 200, body: itemsMap, contentType: RS_DIR_MIME_TYPE, revision: undefined}); }); }); }, _getParentId: function (path) { var foldername = parentPath(path); var self = this; return self._getFileId(foldername).then(function (parentId) { if (parentId) { return Promise.resolve(parentId); } else { return self._createFolder(foldername); } }); }, _createFolder: function (path) { var self = this; return self._getParentId(path).then(function (parentId) { return self._request('POST', BASE_URL + '/drive/v2/files', { body: JSON.stringify({ title: metaTitleFromFileName(baseName(path)), mimeType: GD_DIR_MIME_TYPE, parents: [{ id: parentId }] }), headers: { 'Content-Type': 'application/json; charset=UTF-8' } }).then(function (response) { var meta = JSON.parse(response.responseText); return Promise.resolve(meta.id); }); }); }, _getFileId: function (path) { var self = this; var id; if (path === '/') { // "root" is a special alias for the fileId of the root folder return Promise.resolve('root'); } else if ((id = this._fileIdCache.get(path))) { // id is cached. return Promise.resolve(id); } // id is not cached (or file doesn't exist). // load parent folder listing to propagate / update id cache. return self._getFolder(parentPath(path)).then(function () { id = self._fileIdCache.get(path); if (!id) { if (path.substr(-1) === '/') { return self._createFolder(path).then(function () { return self._getFileId(path); }); } else { return Promise.resolve(); } return; } return Promise.resolve(id); }); }, _getMeta: function (id) { return this._request('GET', BASE_URL + '/drive/v2/files/' + id, {}).then(function (response) { if (response.status === 200) { return Promise.resolve(JSON.parse(response.responseText)); } else { return Promise.reject("request (getting metadata for " + id + ") failed with status: " + response.status); } }); }, _request: function (method, url, options) { var self = this; if (! options.headers) { options.headers = {}; } options.headers['Authorization'] = 'Bearer ' + self.token; return RS.WireClient.request(method, url, options).then(function (xhr) { // google tokens expire from time to time... if (xhr && xhr.status === 401) { self.connect(); return; } return xhr; }); } }; RS.GoogleDrive._rs_init = function (remoteStorage) { var config = remoteStorage.apiKeys.googledrive; if (config) { remoteStorage.googledrive = new RS.GoogleDrive(remoteStorage, config.clientId); if (remoteStorage.backend === 'googledrive') { remoteStorage._origRemote = remoteStorage.remote; remoteStorage.remote = remoteStorage.googledrive; } } }; RS.GoogleDrive._rs_supported = function (rs) { return true; }; RS.GoogleDrive._rs_cleanup = function (remoteStorage) { remoteStorage.setBackend(undefined); if (remoteStorage._origRemote) { remoteStorage.remote = remoteStorage._origRemote; delete remoteStorage._origRemote; } }; })(this); /** FILE: src/dropbox.js **/ (function (global) { var RS = RemoteStorage; /** * File: Dropbox * * WORK IN PROGRESS, NOT RECOMMENDED FOR PRODUCTION USE * * Dropbox backend for RemoteStorage.js * This file exposes a get/put/delete interface which is compatible with * <RemoteStorage.WireClient>. * * When remoteStorage.backend is set to 'dropbox', this backend will * initialize and replace remoteStorage.remote with remoteStorage.dropbox. * * In order to ensure compatibility with the public folder, <BaseClient.getItemURL> * gets hijacked to return the Dropbox public share URL. * * To use this backend, you need to specify the Dropbox app key like so: * * (start code) * * remoteStorage.setApiKeys('dropbox', { * appKey: 'your-app-key' * }); * * (end code) * * An app key can be obtained by registering your app at https://www.dropbox.com/developers/apps * * Known issues: * * - Storing files larger than 150MB is not yet supported * - Listing and deleting folders with more than 10'000 files will cause problems * - Content-Type is not fully supported due to limitations of the Dropbox API * - Dropbox preserves cases but is not case-sensitive * - getItemURL is asynchronous which means getIetmURL returns useful values * after the syncCycle */ var hasLocalStorage; var AUTH_URL = 'https://www.dropbox.com/1/oauth2/authorize'; var SETTINGS_KEY = 'remotestorage:dropbox'; var cleanPath = RS.WireClient.cleanPath; /** * class: LowerCaseCache * * A cache which automatically converts all keys to lower case and can * propagate changes up to parent folders. * * By default the set and delete methods are aliased to justSet and justDelete. * * Parameters: * * defaultValue - the value that is returned for all keys that don't exist * in the cache */ function LowerCaseCache(defaultValue){ this.defaultValue = defaultValue; this._storage = { }; this.set = this.justSet; this.delete = this.justDelete; } LowerCaseCache.prototype = { /** * Method: get * * Get a value from the cache or defaultValue, if the key is not in the * cache. */ get : function (key) { key = key.toLowerCase(); var stored = this._storage[key]; if (typeof stored === 'undefined'){ stored = this.defaultValue; this._storage[key] = stored; } return stored; }, /** * Method: propagateSet * * Set a value and also update the parent folders with that value. */ propagateSet : function (key, value) { key = key.toLowerCase(); if (this._storage[key] === value) { return value; } this._propagate(key, value); this._storage[key] = value; return value; }, /** * Method: propagateDelete * * Delete a value and propagate the changes to the parent folders. */ propagateDelete : function (key) { key = key.toLowerCase(); this._propagate(key, this._storage[key]); return delete this._storage[key]; }, _activatePropagation: function (){ this.set = this.propagateSet; this.delete = this.propagateDelete; return true; }, /** * Method: justSet * * Set a value without propagating. */ justSet : function (key, value) { key = key.toLowerCase(); this._storage[key] = value; return value; }, /** * Method: justDelete * * Delete a value without propagating. */ justDelete : function (key, value) { key = key.toLowerCase(); return delete this._storage[key]; }, _propagate: function (key, rev){ var folders = key.split('/').slice(0,-1); var path = ''; for (var i = 0, len = folders.length; i < len; i++){ path += folders[i]+'/'; if (!rev) { rev = this._storage[path]+1; } this._storage[path] = rev; } } }; var onErrorCb; /** * Class: RemoteStorage.Dropbox */ RS.Dropbox = function (rs) { this.rs = rs; this.connected = false; this.rs = rs; var self = this; onErrorCb = function (error){ if (error instanceof RemoteStorage.Unauthorized) { // Delete all the settings - see the documentation of wireclient.configure self.configure({ userAddress: null, href: null, storageApi: null, token: null, options: null }); } }; RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); rs.on('error', onErrorCb); this.clientId = rs.apiKeys.dropbox.appKey; this._revCache = new LowerCaseCache('rev'); this._itemRefs = {}; this._metadataCache = {}; if (hasLocalStorage){ var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e){} if (settings) { this.configure(settings); } try { this._itemRefs = JSON.parse(localStorage[ SETTINGS_KEY+':shares' ]); } catch(e) { } } if (this.connected) { setTimeout(this._emit.bind(this), 0, 'connected'); } }; RS.Dropbox.prototype = { online: true, /** * Method: connect * * Set the backed to 'dropbox' and start the authentication flow in order * to obtain an API token from Dropbox. */ connect: function () { // TODO handling when token is already present this.rs.setBackend('dropbox'); if (this.token){ hookIt(this.rs); } else { RS.Authorize(AUTH_URL, '', String(RS.Authorize.getLocation()), this.clientId); } }, /** * Method : configure(settings) * Accepts its parameters according to the <RemoteStorage.WireClient>. * Sets the connected flag **/ configure: function (settings) { // We only update this.userAddress if settings.userAddress is set to a string or to null: if (typeof settings.userAddress !== 'undefined') { this.userAddress = settings.userAddress; } // Same for this.token. If only one of these two is set, we leave the other one at its existing value: if (typeof settings.token !== 'undefined') { this.token = settings.token; } if (this.token) { this.connected = true; if ( !this.userAddress ){ this.info().then(function (info){ this.userAddress = info.display_name; this.rs.widget.view.setUserAddress(this.userAddress); this._emit('connected'); }.bind(this)); } } else { this.connected = false; } if (hasLocalStorage){ localStorage[SETTINGS_KEY] = JSON.stringify({ userAddress: this.userAddress, token: this.token }); } }, /** * Method: stopWaitingForToken * * Stop waiting for the token and emit not-connected */ stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, /** * Method: _getFolder * * Get all items in a folder. * * Parameters: * * path - path of the folder to get, with leading slash * options - not used * * Returns: * * statusCode - HTTP status code * body - array of the items found * contentType - 'application/json; charset=UTF-8' * revision - revision of the folder */ _getFolder: function (path, options) { // FIXME simplify promise handling var url = 'https://api.dropbox.com/1/metadata/auto' + cleanPath(path); var revCache = this._revCache; var self = this; return this._request('GET', url, {}).then(function (resp) { var status = resp.status; if (status === 304) { return Promise.resolve({statusCode: status}); } var listing, body, mime, rev; try{ body = JSON.parse(resp.responseText); } catch (e) { return Promise.reject(e); } rev = self._revCache.get(path); mime = 'application/json; charset=UTF-8'; if (body.contents) { listing = body.contents.reduce(function (m, item) { var itemName = item.path.split('/').slice(-1)[0] + ( item.is_dir ? '/' : '' ); if (item.is_dir){ m[itemName] = { ETag: revCache.get(path+itemName) }; } else { m[itemName] = { ETag: item.rev }; } return m; }, {}); } return Promise.resolve({statusCode: status, body: listing, contentType: mime, revision: rev}); }); }, /** * Method: get * * Compatible with <RemoteStorage.WireClient.get> * * Checks for the path in _revCache and decides based on that if file has * changed. Calls _getFolder is the path points to a folder. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ get: function (path, options) { if (! this.connected) { return Promise.reject("not connected (path: " + path + ")"); } var url = 'https://api-content.dropbox.com/1/files/auto' + cleanPath(path); var self = this; var savedRev = this._revCache.get(path); if (savedRev === null) { // file was deleted server side return Promise.resolve({statusCode: 404}); } if (options && options.ifNoneMatch && savedRev && (savedRev === options.ifNoneMatch)) { // nothing changed. return Promise.resolve({statusCode: 304}); } //use _getFolder for folders if (path.substr(-1) === '/') { return this._getFolder(path, options); } return this._request('GET', url, {}).then(function (resp) { var status = resp.status; var meta, body, mime, rev; if (status !== 200) { return Promise.resolve({statusCode: status}); } body = resp.responseText; try { meta = JSON.parse( resp.getResponseHeader('x-dropbox-metadata') ); } catch(e) { return Promise.reject(e); } mime = meta.mime_type; //resp.getResponseHeader('Content-Type'); rev = meta.rev; self._revCache.set(path, rev); self._shareIfNeeded(path); // The shared link expires every 4 hours // handling binary if (!resp.getResponseHeader('Content-Type') || resp.getResponseHeader('Content-Type').match(/charset=binary/)) { var pending = Promise.defer(); RS.WireClient.readBinaryData(resp.response, mime, function (result) { pending.resolve({ statusCode: status, body: result, contentType: mime, revision: rev }); }); return pending.promise; } // handling json (always try) if (mime && mime.search('application/json') >= 0 || true) { try { body = JSON.parse(body); mime = 'application/json; charset=UTF-8'; } catch(e) { //Failed parsing Json, assume it is something else then } } return Promise.resolve({statusCode: status, body: body, contentType: mime, revision: rev}); }); }, /** * Method: put * * Compatible with <RemoteStorage.WireClient> * * Checks for the path in _revCache and decides based on that if file has * changed. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ put: function (path, body, contentType, options) { var self = this; if (!this.connected) { throw new Error("not connected (path: " + path + ")"); } //check if file has changed and return 412 var savedRev = this._revCache.get(path); if (options && options.ifMatch && savedRev && (savedRev !== options.ifMatch)) { return Promise.resolve({statusCode: 412, revision: savedRev}); } if (options && (options.ifNoneMatch === '*') && savedRev && (savedRev !== 'rev')) { return Promise.resolve({statusCode: 412, revision: savedRev}); } if ((!contentType.match(/charset=/)) && (body instanceof ArrayBuffer || RS.WireClient.isArrayBufferView(body))) { contentType += '; charset=binary'; } if (body.length > 150 * 1024 * 1024) { //https://www.dropbox.com/developers/core/docs#chunked-upload return Promise.reject(new Error("Cannot upload file larger than 150MB")); } var result; var needsMetadata = options && (options.ifMatch || (options.ifNoneMatch === '*')); var uploadParams = { body: body, contentType: contentType, path: path }; if (needsMetadata) { result = this._getMetadata(path).then(function (metadata) { if (options && (options.ifNoneMatch === '*') && metadata) { // if !!metadata === true, the file exists return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } if (options && options.ifMatch && metadata && (metadata.rev !== options.ifMatch)) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } return self._uploadSimple(uploadParams); }); } else { result = self._uploadSimple(uploadParams); } return result.then(function (ret) { self._shareIfNeeded(path); return ret; }); }, /** * Method: delete * * Compatible with <RemoteStorage.WireClient.delete> * * Checks for the path in _revCache and decides based on that if file has * changed. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ 'delete': function (path, options) { var self = this; if (!this.connected) { throw new Error("not connected (path: " + path + ")"); } //check if file has changed and return 412 var savedRev = this._revCache.get(path); if (options && options.ifMatch && savedRev && (options.ifMatch !== savedRev)) { return Promise.resolve({ statusCode: 412, revision: savedRev }); } if (options && options.ifMatch) { return this._getMetadata(path).then(function (metadata) { if (options && options.ifMatch && metadata && (metadata.rev !== options.ifMatch)) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } return self._deleteSimple(path); }); } return self._deleteSimple(path); }, /** * Method: _shareIfNeeded * * Calls share, if the provided path resides in a public folder. */ _shareIfNeeded: function (path) { if (path.match(/^\/public\/.*[^\/]$/) && this._itemRefs[path] === undefined) { this.share(path); } }, /** * Method: share * * Gets a publicly-accessible URL for the path from Dropbox and stores it * in _itemRefs. * * Returns: * * A promise for the URL */ share: function (path) { var self = this; var url = 'https://api.dropbox.com/1/media/auto/' + cleanPath(path); return this._request('POST', url, {}).then(function (response) { if (response.status !== 200) { return Promise.reject(new Error('Invalid Dropbox API response status when sharing "' + path + '":' + response.status)); } try { response = JSON.parse(response.responseText); } catch (e) { return Promise.reject(new Error('Invalid Dropbox API response when sharing "' + path + '": ' + response.responseText)); } self._itemRefs[path] = response.url; if (hasLocalStorage) { localStorage[SETTINGS_KEY + ':shares'] = JSON.stringify(self._itemRefs); } return Promise.resolve(url); }, function (error) { err.message = 'Sharing dropbox file or folder ("' + path + '") failed.' + err.message; return Promise.reject(error); }); }, /** * Method: info * * Fetches the user's info from dropbox and returns a promise for it. * * Returns: * * A promise to the user's info */ info: function () { var url = 'https://api.dropbox.com/1/account/info'; // requesting user info(mainly for userAdress) return this._request('GET', url, {}).then(function (resp){ try { var info = JSON.parse(resp.responseText); return Promise.resolve(info); } catch (e) { return Promise.reject(e); } }); }, /** * Method: _request * * Make a HTTP request. * * Options: * * headers - an object containing the request headers * * Parameters: * * method - the method to use * url - the URL to make the request to * options - see above */ _request: function (method, url, options) { var self = this; if (! options.headers) { options.headers = {}; } options.headers['Authorization'] = 'Bearer ' + this.token; return RS.WireClient.request.call(this, method, url, options).then(function (xhr) { //503 means retry this later if (xhr && xhr.status === 503) { return global.setTimeout(self._request(method, url, options), 3210); } else { return Promise.resolve(xhr); } }); }, /** * Method: fetchDelta * * Fetches the revision of all the files from dropbox API and puts them * into _revCache. These values can then be used to determine if something * has changed. */ fetchDelta: function () { // TODO: Handle `has_more` var args = Array.prototype.slice.call(arguments); var self = this; return self._request('POST', 'https://api.dropbox.com/1/delta', { body: self._deltaCursor ? ('cursor=' + encodeURIComponent(self._deltaCursor)) : '', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).then(function (response) { // break if status != 200 if (response.status !== 200 ) { if (response.status === 400) { self.rs._emit('error', new RemoteStorage.Unauthorized()); return Promise.resolve(args); } else { return Promise.reject("dropbox.fetchDelta returned "+response.status+response.responseText); } return; } var delta; try { delta = JSON.parse(response.responseText); } catch(error) { RS.log('fetchDeltas can not parse response',error); return Promise.reject("can not parse response of fetchDelta : "+error.message); } // break if no entries found if (!delta.entries) { return Promise.reject('dropbox.fetchDeltas failed, no entries found'); } // Dropbox sends the complete state if (delta.reset) { self._revCache = new LowerCaseCache('rev'); } //saving the cursor for requesting further deltas in relation to the cursor position if (delta.cursor) { self._deltaCursor = delta.cursor; } //updating revCache RemoteStorage.log("Delta : ", delta.entries); delta.entries.forEach(function (entry) { var path = entry[0]; var rev; if (!entry[1]){ rev = null; } else { if (entry[1].is_dir) { return; } rev = entry[1].rev; } self._revCache.set(path, rev); }); return Promise.resolve(args); }, function (err) { this.rs.log('fetchDeltas', err); this.rs._emit('error', new RemoteStorage.SyncError('fetchDeltas failed.' + err)); promise.reject(err); }).then(function () { if (self._revCache) { var args = Array.prototype.slice.call(arguments); self._revCache._activatePropagation(); return Promise.resolve(args); } }); }, /** * Method: _getMetadata * * Gets metadata for a path (can point to either a file or a folder). * * Options: * * list - if path points to a folder, specifies whether to list the * metadata of the folder's children. False by default. * * Parameters: * * path - the path to get metadata for * options - see above * * Returns: * * A promise for the metadata */ _getMetadata: function (path, options) { var self = this; var cached = this._metadataCache[path]; var url = 'https://api.dropbox.com/1/metadata/auto' + cleanPath(path); url += '?list=' + ((options && options.list) ? 'true' : 'false'); if (cached && cached.hash) { url += '&hash=' + encodeURIComponent(cached.hash); } return this._request('GET', url, {}).then(function (resp) { if (resp.status === 304) { return Promise.resolve(cached); } else if (resp.status === 200) { var response = JSON.parse(resp.responseText); self._metadataCache[path] = response; return Promise.resolve(response); } else { // The file doesn't exist return Promise.resolve(); } }); }, /** * Method: _uploadSimple * * Upload a simple file (the size is no more than 150MB). * * Parameters: * * ifMatch - same as for get * path - path of the file * body - contents of the file to upload * contentType - mime type of the file * * Returns: * * statusCode - HTTP status code * revision - revision of the newly-created file, if any */ _uploadSimple: function (params) { var self = this; var url = 'https://api-content.dropbox.com/1/files_put/auto' + cleanPath(params.path) + '?'; if (params && params.ifMatch) { url += "parent_rev=" + encodeURIComponent(params.ifMatch); } return self._request('PUT', url, { body: params.body, headers: { 'Content-Type': params.contentType } }).then(function (resp) { if (resp.status !== 200) { return Promise.resolve({ statusCode: resp.status }); } var response; try { response = JSON.parse(resp.responseText); } catch (e) { return Promise.reject(e); } // Conflict happened. Delete the copy created by dropbox if (response.path !== params.path) { var deleteUrl = 'https://api.dropbox.com/1/fileops/delete?root=auto&path=' + encodeURIComponent(response.path); self._request('POST', deleteUrl, {}); return self._getMetadata(params.path).then(function (metadata) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); }); } self._revCache.propagateSet(params.path, response.rev); return Promise.resolve({ statusCode: resp.status }); }); }, /** * Method: _deleteSimple * * Deletes a file or a folder. If the folder contains more than 10'000 items * (recursively) then the operation may not complete successfully. If that * is the case, an Error gets thrown. * * Parameters: * * path - the path to delete * * Returns: * * statusCode - HTTP status code */ _deleteSimple: function (path) { var self = this; var url = 'https://api.dropbox.com/1/fileops/delete?root=auto&path=' + encodeURIComponent(path); return self._request('POST', url, {}).then(function (resp) { if (resp.status === 406) { // Too many files would be involved in the operation for it to // complete successfully. // TODO: Handle this somehow return Promise.reject(new Error("Cannot delete '" + path + "': too many files involved")); } if (resp.status === 200) { self._revCache.delete(path); delete self._itemRefs[path]; } return Promise.resolve({ statusCode: resp.status }); }); } }; //hooking and unhooking the sync function hookSync(rs) { if (rs._dropboxOrigSync) { return; } // already hooked rs._dropboxOrigSync = rs.sync.bind(rs); rs.sync = function () { return this.dropbox.fetchDelta.apply(this.dropbox, arguments). then(rs._dropboxOrigSync, function (err) { rs._emit('error', new rs.SyncError(err)); }); }; } function unHookSync(rs) { if (! rs._dropboxOrigSync) { return; } // not hooked rs.sync = rs._dropboxOrigSync; delete rs._dropboxOrigSync; } // hooking and unhooking getItemURL function hookGetItemURL(rs) { if (rs._origBaseClientGetItemURL) { return; } rs._origBaseClientGetItemURL = RS.BaseClient.prototype.getItemURL; RS.BaseClient.prototype.getItemURL = function (path){ var ret = rs.dropbox._itemRefs[path]; return ret ? ret : ''; }; } function unHookGetItemURL(rs){ if (! rs._origBaseClientGetItemURL) { return; } RS.BaseClient.prototype.getItemURL = rs._origBaseClientGetItemURL; delete rs._origBaseClientGetItemURL; } function hookRemote(rs){ if (rs._origRemote) { return; } rs._origRemote = rs.remote; rs.remote = rs.dropbox; } function unHookRemote(rs){ if (rs._origRemote) { rs.remote = rs._origRemote; delete rs._origRemote; } } function hookIt(rs){ hookRemote(rs); if (rs.sync) { hookSync(rs); } hookGetItemURL(rs); } function unHookIt(rs){ unHookRemote(rs); unHookSync(rs); unHookGetItemURL(rs); } RS.Dropbox._rs_init = function (rs) { hasLocalStorage = rs.localStorageAvailable(); if ( rs.apiKeys.dropbox ) { rs.dropbox = new RS.Dropbox(rs); } if (rs.backend === 'dropbox') { hookIt(rs); } }; RS.Dropbox._rs_supported = function () { return true; }; RS.Dropbox._rs_cleanup = function (rs) { unHookIt(rs); if (hasLocalStorage){ delete localStorage[SETTINGS_KEY]; } rs.removeEventListener('error', onErrorCb); rs.setBackend(undefined); }; })(this); remoteStorage = new RemoteStorage();
ajax/libs/react-native-web/0.16.5/exports/createElement/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import AccessibilityUtil from '../../modules/AccessibilityUtil'; import createDOMProps from '../../modules/createDOMProps'; import React from 'react'; var createElement = function createElement(component, props) { // Use equivalent platform elements where possible. var accessibilityComponent; if (component && component.constructor === String) { accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props); } var Component = accessibilityComponent || component; var domProps = createDOMProps(Component, props); for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { children[_key - 2] = arguments[_key]; } return /*#__PURE__*/React.createElement.apply(React, [Component, domProps].concat(children)); }; export default createElement;
src/components/video_detail.js
framirez224/youtube-search
import React from 'react'; const VideoDetail = ({video}) => { if (!video) { return <div>Loading...</div>; } const videoId = video.id.videoId; const url = `https://www.youtube.com/embed/${videoId}`; return ( <div className="video-detail col-md-8"> <div className="embed-responsive embed-responsive-16by9"> <iframe className="embed-responsive-item" src={url}></iframe> </div> <div className="details"> <div>{video.snippet.title}</div> <div>{video.snippet.description}</div> </div> </div> ) }; export default VideoDetail;
springboot/GReact/node_modules/react-bootstrap/lib/Accordion.js
ezsimple/java
'use strict'; exports.__esModule = true; var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _PanelGroup = require('./PanelGroup'); var _PanelGroup2 = _interopRequireDefault(_PanelGroup); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Accordion = function (_React$Component) { (0, _inherits3['default'])(Accordion, _React$Component); function Accordion() { (0, _classCallCheck3['default'])(this, Accordion); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); } Accordion.prototype.render = function render() { return _react2['default'].createElement( _PanelGroup2['default'], (0, _extends3['default'])({}, this.props, { accordion: true }), this.props.children ); }; return Accordion; }(_react2['default'].Component); exports['default'] = Accordion; module.exports = exports['default'];
ajax/libs/primeui/2.2.0-rc1/primeui-min.js
kiwi89/cdnjs
/* * PrimeUI v2.2.0-rc.1 * * Copyright 2009-2015 PrimeTek. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var PUI={zindex:1000,gridColumns:{"1":"pui-grid-col-12","2":"pui-grid-col-6","3":"pui-grid-col-4","4":"pui-grid-col-3","6":"pui-grid-col-2","12":"pui-grid-col-11"},scrollInView:function(b,e){var h=parseFloat(b.css("borderTopWidth"))||0,d=parseFloat(b.css("paddingTop"))||0,f=e.offset().top-b.offset().top-h-d,a=b.scrollTop(),c=b.height(),g=e.outerHeight(true); if(f<0){b.scrollTop(a+f) }else{if((f+g)>c){b.scrollTop(a+f-c+g) }}},isIE:function(a){return(this.browser.msie&&parseInt(this.browser.version,10)===a) },escapeRegExp:function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1") },escapeHTML:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;") },clearSelection:function(){if(window.getSelection){if(window.getSelection().empty){window.getSelection().empty() }else{if(window.getSelection().removeAllRanges){window.getSelection().removeAllRanges() }}}else{if(document.selection&&document.selection.empty){document.selection.empty() }}},inArray:function(a,c){for(var b=0; b<a.length; b++){if(a[b]===c){return true }}return false },calculateScrollbarWidth:function(){if(!this.scrollbarWidth){if(this.browser.msie){var c=$('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body"),b=$('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body"); this.scrollbarWidth=c.width()-b.width(); c.add(b).remove() }else{var a=$("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}); this.scrollbarWidth=100-a.width(); a.parent().remove() }}return this.scrollbarWidth },resolveUserAgent:function(){var a,d; jQuery.uaMatch=function(h){h=h.toLowerCase(); var g=/(opr)[\/]([\w.]+)/.exec(h)||/(chrome)[ \/]([\w.]+)/.exec(h)||/(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(h)||/(webkit)[ \/]([\w.]+)/.exec(h)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(h)||/(msie) ([\w.]+)/.exec(h)||h.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(h)||h.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(h)||[]; var f=/(ipad)/.exec(h)||/(iphone)/.exec(h)||/(android)/.exec(h)||/(windows phone)/.exec(h)||/(win)/.exec(h)||/(mac)/.exec(h)||/(linux)/.exec(h)||/(cros)/i.exec(h)||[]; return{browser:g[3]||g[1]||"",version:g[2]||"0",platform:f[0]||""} }; a=jQuery.uaMatch(window.navigator.userAgent); d={}; if(a.browser){d[a.browser]=true; d.version=a.version; d.versionNumber=parseInt(a.version) }if(a.platform){d[a.platform]=true }if(d.android||d.ipad||d.iphone||d["windows phone"]){d.mobile=true }if(d.cros||d.mac||d.linux||d.win){d.desktop=true }if(d.chrome||d.opr||d.safari){d.webkit=true }if(d.rv){var e="msie"; a.browser=e; d[e]=true }if(d.opr){var c="opera"; a.browser=c; d[c]=true }if(d.safari&&d.android){var b="android"; a.browser=b; d[b]=true }d.name=a.browser; d.platform=a.platform; this.browser=d; $.browser=d },getGridColumn:function(a){return this.gridColumns[a+""] }}; PUI.resolveUserAgent();(function(){$.widget("primeui.puiaccordion",{options:{activeIndex:0,multiple:false},_create:function(){if(this.options.multiple){this.options.activeIndex=[] }var a=this; this.element.addClass("pui-accordion ui-widget ui-helper-reset"); this.element.children("h3").addClass("pui-accordion-header ui-helper-reset ui-state-default").each(function(c){var f=$(this),e=f.html(),d=(c==a.options.activeIndex)?"ui-state-active ui-corner-top":"ui-corner-all",b=(c==a.options.activeIndex)?"pui-icon fa fa-fw fa-caret-down":"pui-icon fa fa-fw fa-caret-right"; f.addClass(d).html('<span class="'+b+'"></span><a href="#">'+e+"</a>") }); this.element.children("div").each(function(b){var c=$(this); c.addClass("pui-accordion-content ui-helper-reset ui-widget-content"); if(b!=a.options.activeIndex){c.addClass("ui-helper-hidden") }}); this.headers=this.element.children(".pui-accordion-header"); this.panels=this.element.children(".pui-accordion-content"); this.headers.children("a").disableSelection(); this._bindEvents() },_bindEvents:function(){var a=this; this.headers.mouseover(function(){var b=$(this); if(!b.hasClass("ui-state-active")&&!b.hasClass("ui-state-disabled")){b.addClass("ui-state-hover") }}).mouseout(function(){var b=$(this); if(!b.hasClass("ui-state-active")&&!b.hasClass("ui-state-disabled")){b.removeClass("ui-state-hover") }}).click(function(d){var c=$(this); if(!c.hasClass("ui-state-disabled")){var b=c.index()/2; if(c.hasClass("ui-state-active")){a.unselect(b) }else{a.select(b) }}d.preventDefault() }) },select:function(b){var a=this.panels.eq(b); this._trigger("change",a); if(this.options.multiple){this._addToSelection(b) }else{this.options.activeIndex=b }this._show(a) },unselect:function(b){var a=this.panels.eq(b),c=a.prev(); c.attr("aria-expanded",false).children(".pui-icon").removeClass("fa-caret-down").addClass("fa-caret-right"); c.removeClass("ui-state-active ui-corner-top").addClass("ui-corner-all"); a.attr("aria-hidden",true).slideUp(); this._removeFromSelection(b) },_show:function(b){if(!this.options.multiple){var c=this.headers.filter(".ui-state-active"); c.children(".pui-icon").removeClass("fa-caret-down").addClass("fa-caret-right"); c.attr("aria-expanded",false).removeClass("ui-state-active ui-corner-top").addClass("ui-corner-all").next().attr("aria-hidden",true).slideUp() }var a=b.prev(); a.attr("aria-expanded",true).addClass("ui-state-active ui-corner-top").removeClass("ui-state-hover ui-corner-all").children(".pui-icon").removeClass("fa-caret-right").addClass("fa-caret-down"); b.attr("aria-hidden",false).slideDown("normal") },_addToSelection:function(a){this.options.activeIndex.push(a) },_removeFromSelection:function(a){this.options.activeIndex=$.grep(this.options.activeIndex,function(b){return b!=a }) }}) })();(function(){$.widget("primeui.puiautocomplete",{options:{delay:300,minQueryLength:1,multiple:false,dropdown:false,scrollHeight:200,forceSelection:false,effect:null,effectOptions:{},effectSpeed:"normal",content:null,caseSensitive:false},_create:function(){this.element.wrap('<span class="pui-autocomplete ui-widget" />'); this.element.puiinputtext(); this.panel=$('<div class="pui-autocomplete-panel ui-widget-content ui-corner-all ui-helper-hidden pui-shadow"></div>').appendTo("body"); if(this.options.multiple){this.element.wrap('<ul class="pui-autocomplete-multiple ui-widget pui-inputtext ui-state-default ui-corner-all"><li class="pui-autocomplete-input-token"></li></ul>'); this.inputContainer=this.element.parent(); this.multiContainer=this.inputContainer.parent() }else{if(this.options.dropdown){this.dropdown=$('<button type="button" class="pui-autocomplete-dropdown pui-button ui-widget ui-state-default ui-corner-right pui-button-icon-only"><span class="pui-icon fa fa-fw fa-caret-down"></span><span class="pui-button-text">&nbsp;</span></button>').insertAfter(this.element); this.element.removeClass("ui-corner-all").addClass("ui-corner-left") }}this._bindEvents() },_bindEvents:function(){var a=this; this._bindKeyEvents(); if(this.options.dropdown){this.dropdown.on("mouseenter.puiautocomplete",function(){if(!a.element.prop("disabled")){a.dropdown.addClass("ui-state-hover") }}).on("mouseleave.puiautocomplete",function(){a.dropdown.removeClass("ui-state-hover") }).on("mousedown.puiautocomplete",function(){if(!a.element.prop("disabled")){a.dropdown.addClass("ui-state-active") }}).on("mouseup.puiautocomplete",function(){if(!a.element.prop("disabled")){a.dropdown.removeClass("ui-state-active"); a.search(""); a.element.focus() }}).on("focus.puiautocomplete",function(){a.dropdown.addClass("ui-state-focus") }).on("blur.puiautocomplete",function(){a.dropdown.removeClass("ui-state-focus") }).on("keydown.puiautocomplete",function(c){var b=$.ui.keyCode; if(c.which==b.ENTER||c.which==b.NUMPAD_ENTER){a.search(""); a.input.focus(); c.preventDefault() }}) }if(this.options.multiple){this.multiContainer.on("hover.puiautocomplete",function(){$(this).toggleClass("ui-state-hover") }).on("click.puiautocomplete",function(){a.element.trigger("focus") }); this.element.on("focus.pui-autocomplete",function(){a.multiContainer.addClass("ui-state-focus") }).on("blur.pui-autocomplete",function(b){a.multiContainer.removeClass("ui-state-focus") }) }if(this.options.forceSelection){this.currentItems=[this.element.val()]; this.element.on("blur.puiautocomplete",function(){var d=$(this).val(),c=false; for(var b=0; b<a.currentItems.length; b++){if(a.currentItems[b]===d){c=true; break }}if(!c){a.element.val("") }}) }$(document.body).bind("mousedown.puiautocomplete",function(b){if(a.panel.is(":hidden")){return }if(b.target===a.element.get(0)){return }var c=a.panel.offset(); if(b.pageX<c.left||b.pageX>c.left+a.panel.width()||b.pageY<c.top||b.pageY>c.top+a.panel.height()){a.hide() }}); $(window).bind("resize."+this.element.id,function(){if(a.panel.is(":visible")){a._alignPanel() }}) },_bindKeyEvents:function(){var a=this; this.element.on("keyup.puiautocomplete",function(g){var f=$.ui.keyCode,b=g.which,d=true; if(b==f.UP||b==f.LEFT||b==f.DOWN||b==f.RIGHT||b==f.TAB||b==f.SHIFT||b==f.ENTER||b==f.NUMPAD_ENTER){d=false }if(d){var c=a.element.val(); if(!c.length){a.hide() }if(c.length>=a.options.minQueryLength){if(a.timeout){window.clearTimeout(a.timeout) }a.timeout=window.setTimeout(function(){a.search(c) },a.options.delay) }}}).on("keydown.puiautocomplete",function(g){if(a.panel.is(":visible")){var f=$.ui.keyCode,d=a.items.filter(".ui-state-highlight"); switch(g.which){case f.UP:case f.LEFT:var c=d.prev(); if(c.length==1){d.removeClass("ui-state-highlight"); c.addClass("ui-state-highlight"); if(a.options.scrollHeight){PUI.scrollInView(a.panel,c) }}g.preventDefault(); break; case f.DOWN:case f.RIGHT:var b=d.next(); if(b.length==1){d.removeClass("ui-state-highlight"); b.addClass("ui-state-highlight"); if(a.options.scrollHeight){PUI.scrollInView(a.panel,b) }}g.preventDefault(); break; case f.ENTER:case f.NUMPAD_ENTER:d.trigger("click"); g.preventDefault(); break; case f.ALT:case 224:break; case f.TAB:d.trigger("click"); a.hide(); break }}}) },_bindDynamicEvents:function(){var a=this; this.items.on("mouseover.puiautocomplete",function(){var b=$(this); if(!b.hasClass("ui-state-highlight")){a.items.filter(".ui-state-highlight").removeClass("ui-state-highlight"); b.addClass("ui-state-highlight") }}).on("click.puiautocomplete",function(d){var c=$(this); if(a.options.multiple){var b='<li class="pui-autocomplete-token ui-state-active ui-corner-all ui-helper-hidden">'; b+='<span class="pui-autocomplete-token-icon fa fa-fw fa-close" />'; b+='<span class="pui-autocomplete-token-label">'+c.data("label")+"</span></li>"; $(b).data(c.data()).insertBefore(a.inputContainer).fadeIn().children(".pui-autocomplete-token-icon").on("click.pui-autocomplete",function(g){var f=$(this).parent(); a._removeItem(f); a._trigger("unselect",g,f) }); a.element.val("").trigger("focus") }else{a.element.val(c.data("label")).focus() }a._trigger("select",d,c); a.hide() }) },search:function(h){this.query=this.options.caseSensitive?h:h.toLowerCase(); var f={query:this.query}; if(this.options.completeSource){if($.isArray(this.options.completeSource)){var b=this.options.completeSource,g=[],a=($.trim(h)===""); for(var c=0; c<b.length; c++){var e=b[c],d=e.label||e; if(!this.options.caseSensitive){d=d.toLowerCase() }if(a||d.indexOf(this.query)===0){g.push({label:b[c],value:e}) }}this._handleData(g) }else{this.options.completeSource.call(this,f,this._handleData) }}},_handleData:function(e){var g=this; this.panel.html(""); this.listContainer=$('<ul class="pui-autocomplete-items pui-autocomplete-list ui-widget-content ui-widget ui-corner-all ui-helper-reset"></ul>').appendTo(this.panel); for(var b=0; b<e.length; b++){var c=$('<li class="pui-autocomplete-item pui-autocomplete-list-item ui-corner-all"></li>'); c.data(e[b]); if(this.options.content){c.html(this.options.content.call(this,e[b])) }else{c.text(e[b].label) }this.listContainer.append(c) }this.items=this.listContainer.children(".pui-autocomplete-item"); this._bindDynamicEvents(); if(this.items.length>0){var f=g.items.eq(0),d=this.panel.is(":hidden"); f.addClass("ui-state-highlight"); if(g.query.length>0&&!g.options.content){g.items.each(function(){var i=$(this),k=i.html(),h=new RegExp(PUI.escapeRegExp(g.query),"gi"),j=k.replace(h,'<span class="pui-autocomplete-query">$&</span>'); i.html(j) }) }if(this.options.forceSelection){this.currentItems=[]; $.each(e,function(h,j){g.currentItems.push(j.label) }) }if(g.options.scrollHeight){var a=d?g.panel.height():g.panel.children().height(); if(a>g.options.scrollHeight){g.panel.height(g.options.scrollHeight) }else{g.panel.css("height","auto") }}if(d){g.show() }else{g._alignPanel() }}else{this.panel.hide() }},show:function(){this._alignPanel(); if(this.options.effect){this.panel.show(this.options.effect,{},this.options.effectSpeed) }else{this.panel.show() }},hide:function(){this.panel.hide(); this.panel.css("height","auto") },_removeItem:function(a){a.fadeOut("fast",function(){var b=$(this); b.remove() }) },_alignPanel:function(){var b=null; if(this.options.multiple){b=this.multiContainer.innerWidth()-(this.element.position().left-this.multiContainer.position().left) }else{if(this.panel.is(":visible")){b=this.panel.children(".pui-autocomplete-items").outerWidth() }else{this.panel.css({visibility:"hidden",display:"block"}); b=this.panel.children(".pui-autocomplete-items").outerWidth(); this.panel.css({visibility:"visible",display:"none"}) }var a=this.element.outerWidth(); if(b<a){b=a }}this.panel.css({left:"",top:"",width:b,"z-index":++PUI.zindex}).position({my:"left top",at:"left bottom",of:this.element}) }}) })();(function(){$.widget("primeui.puibutton",{options:{value:null,icon:null,iconPos:"left",click:null},_create:function(){var b=this.element,d=b.text(),e=this.options.value||(d===""?"pui-button":d),c=b.prop("disabled"),a=null; if(this.options.icon){a=(e==="pui-button")?"pui-button-icon-only":"pui-button-text-icon-"+this.options.iconPos }else{a="pui-button-text-only" }if(c){a+=" ui-state-disabled" }this.element.addClass("pui-button ui-widget ui-state-default ui-corner-all "+a).text(""); if(this.options.icon){this.element.append('<span class="pui-button-icon-'+this.options.iconPos+" pui-icon pui-c fa fa-fw "+this.options.icon+'" />') }this.element.append('<span class="pui-button-text pui-c">'+e+"</span>"); b.attr("role","button").attr("aria-disabled",c); if(!c){this._bindEvents() }},_bindEvents:function(){var a=this.element,b=this; a.on("mouseover.puibutton",function(){if(!a.prop("disabled")){a.addClass("ui-state-hover") }}).on("mouseout.puibutton",function(){$(this).removeClass("ui-state-active ui-state-hover") }).on("mousedown.puibutton",function(){if(!a.hasClass("ui-state-disabled")){a.addClass("ui-state-active").removeClass("ui-state-hover") }}).on("mouseup.puibutton",function(c){a.removeClass("ui-state-active").addClass("ui-state-hover"); b._trigger("click",c) }).on("focus.puibutton",function(){a.addClass("ui-state-focus") }).on("blur.puibutton",function(){a.removeClass("ui-state-focus") }).on("keydown.puibutton",function(c){if(c.keyCode==$.ui.keyCode.SPACE||c.keyCode==$.ui.keyCode.ENTER||c.keyCode==$.ui.keyCode.NUMPAD_ENTER){a.addClass("ui-state-active") }}).on("keyup.puibutton",function(){a.removeClass("ui-state-active") }); return this },_unbindEvents:function(){this.element.off("mouseover.puibutton mouseout.puibutton mousedown.puibutton mouseup.puibutton focus.puibutton blur.puibutton keydown.puibutton keyup.puibutton") },disable:function(){this._unbindEvents(); this.element.attr({disabled:"disabled","aria-disabled":true}).addClass("ui-state-disabled") },enable:function(){if(this.element.prop("disabled")){this._bindEvents(); this.element.removeAttr("disabled").attr("aria-disabled",false).removeClass("ui-state-disabled") }}}) })();(function(){$.widget("primeui.puicarousel",{options:{datasource:null,numVisible:3,firstVisible:0,headerText:null,effectDuration:500,circular:false,breakpoint:560,itemContent:null,responsive:true,autoplayInterval:0,easing:"easeInOutCirc",pageLinks:3,styleClass:null},_create:function(){this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.wrap('<div class="pui-carousel ui-widget ui-widget-content ui-corner-all"><div class="pui-carousel-viewport"></div></div>'); this.container=this.element.parent().parent(); this.element.addClass("pui-carousel-items"); this.container.prepend('<div class="pui-carousel-header ui-widget-header"><div class="pui-carousel-header-title"></div></div>'); this.viewport=this.element.parent(); this.header=this.container.children(".pui-carousel-header"); this.header.append('<span class="pui-carousel-button pui-carousel-next-button fa fa-arrow-circle-right"></span><span class="pui-carousel-button pui-carousel-prev-button fa fa-arrow-circle-left"></span>'); if(this.options.headerText){this.header.children(".pui-carousel-header-title").html(this.options.headerText) }if(this.options.styleClass){this.container.addClass(this.options.styleClass) }if(this.options.datasource){this._loadData() }else{this._render() }},_loadData:function(){if($.isArray(this.options.datasource)){this._render(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){this.options.datasource.call(this,this._render) }}},_updateDatasource:function(a){this.options.datasource=a; this.element.children().remove(); this.header.children(".pui-carousel-page-links").remove(); this.header.children("select").remove(); this._loadData() },_render:function(b){this.data=b; if(this.data){for(var a=0; a<b.length; a++){var c=this.options.itemContent.call(this,b[a]); if($.type(c)==="string"){this.element.append("<li>"+c+"</li>") }else{this.element.append($("<li></li>").wrapInner(c)) }}}this.items=this.element.children("li"); this.items.addClass("pui-carousel-item ui-widget-content ui-corner-all"); this.itemsCount=this.items.length; this.columns=this.options.numVisible; this.first=this.options.firstVisible; this.page=parseInt(this.first/this.columns); this.totalPages=Math.ceil(this.itemsCount/this.options.numVisible); this._renderPageLinks(); this.prevNav=this.header.children(".pui-carousel-prev-button"); this.nextNav=this.header.children(".pui-carousel-next-button"); this.pageLinks=this.header.find("> .pui-carousel-page-links > .pui-carousel-page-link"); this.dropdown=this.header.children(".pui-carousel-dropdown"); this.mobileDropdown=this.header.children(".pui-carousel-mobiledropdown"); this._bindEvents(); if(this.options.responsive){this.refreshDimensions() }else{this.calculateItemWidths(); this.container.width(this.container.width()); this.updateNavigators() }},_renderPageLinks:function(){if(this.totalPages<=this.options.pageLinks){this.pageLinksContainer=$('<div class="pui-carousel-page-links"></div>'); for(var b=0; b<this.totalPages; b++){this.pageLinksContainer.append('<a href="#" class="pui-carousel-page-link fa fa-circle-o"></a>') }this.header.append(this.pageLinksContainer) }else{this.dropdown=$('<select class="pui-carousel-dropdown ui-widget ui-state-default ui-corner-left"></select>'); for(var b=0; b<this.totalPages; b++){var a=(b+1); this.dropdown.append('<option value="'+a+'">'+a+"</option>") }this.header.append(this.dropdown) }if(this.options.responsive){this.mobileDropdown=$('<select class="pui-carousel-mobiledropdown ui-widget ui-state-default ui-corner-left"></select>'); for(var b=0; b<this.itemsCount; b++){var a=(b+1); this.mobileDropdown.append('<option value="'+a+'">'+a+"</option>") }this.header.append(this.mobileDropdown) }},calculateItemWidths:function(){var b=this.items.eq(0); if(b.length){var a=b.outerWidth(true)-b.width(); this.items.width((this.viewport.innerWidth()-a*this.columns)/this.columns) }},refreshDimensions:function(){var a=$(window); if(a.width()<=this.options.breakpoint){this.columns=1; this.calculateItemWidths(this.columns); this.totalPages=this.itemsCount; this.mobileDropdown.show(); this.pageLinks.hide() }else{this.columns=this.options.numVisible; this.calculateItemWidths(); this.totalPages=Math.ceil(this.itemsCount/this.options.numVisible); this.mobileDropdown.hide(); this.pageLinks.show() }this.page=parseInt(this.first/this.columns); this.updateNavigators(); this.element.css("left",(-1*(this.viewport.innerWidth()*this.page))) },_bindEvents:function(){var b=this; if(this.eventsBound){return }this.prevNav.on("click.puicarousel",function(){if(b.page!==0){b.setPage(b.page-1) }else{if(b.options.circular){b.setPage(b.totalPages-1) }}}); this.nextNav.on("click.puicarousel",function(){var c=(b.page===(b.totalPages-1)); if(!c){b.setPage(b.page+1) }else{if(b.options.circular){b.setPage(0) }}}); this.element.swipe({swipe:function(c,d){if(d==="left"){if(b.page===(b.totalPages-1)){if(b.options.circular){b.setPage(0) }}else{b.setPage(b.page+1) }}else{if(d==="right"){if(b.page===0){if(b.options.circular){b.setPage(b.totalPages-1) }}else{b.setPage(b.page-1) }}}}}); if(this.pageLinks.length){this.pageLinks.on("click",function(c){b.setPage($(this).index()); c.preventDefault() }) }this.header.children("select").on("change",function(){b.setPage(parseInt($(this).val())-1) }); if(this.options.autoplayInterval){this.options.circular=true; this.startAutoplay() }if(this.options.responsive){var a="resize."+this.id; $(window).off(a).on(a,function(){b.refreshDimensions() }) }this.eventsBound=true },updateNavigators:function(){if(!this.options.circular){if(this.page===0){this.prevNav.addClass("ui-state-disabled"); this.nextNav.removeClass("ui-state-disabled") }else{if(this.page===(this.totalPages-1)){this.prevNav.removeClass("ui-state-disabled"); this.nextNav.addClass("ui-state-disabled") }else{this.prevNav.removeClass("ui-state-disabled"); this.nextNav.removeClass("ui-state-disabled") }}}if(this.pageLinks.length){this.pageLinks.filter(".fa-dot-circle-o").removeClass("fa-dot-circle-o"); this.pageLinks.eq(this.page).addClass("fa-dot-circle-o") }if(this.dropdown.length){this.dropdown.val(this.page+1) }if(this.mobileDropdown.length){this.mobileDropdown.val(this.page+1) }},setPage:function(b){if(b!==this.page&&!this.element.is(":animated")){var a=this; this.element.animate({left:-1*(this.viewport.innerWidth()*b),easing:this.options.easing},{duration:this.options.effectDuration,easing:this.options.easing,complete:function(){a.page=b; a.first=a.page*a.columns; a.updateNavigators(); a._trigger("pageChange",null,{page:b}) }}) }},startAutoplay:function(){var a=this; this.interval=setInterval(function(){if(a.page===(a.totalPages-1)){a.setPage(0) }else{a.setPage(a.page+1) }},this.options.autoplayInterval) },stopAutoplay:function(){clearInterval(this.interval) },_setOption:function(a,b){if(a==="datasource"){this._updateDatasource(b) }else{$.Widget.prototype._setOption.apply(this,arguments) }},_destroy:function(){}}) })();(function(){$.widget("primeui.puicheckbox",{_create:function(){this.element.wrap('<div class="pui-chkbox ui-widget"><div class="ui-helper-hidden-accessible"></div></div>'); this.container=this.element.parent().parent(); this.box=$('<div class="pui-chkbox-box ui-widget ui-corner-all ui-state-default">').appendTo(this.container); this.icon=$('<span class="pui-chkbox-icon pui-c"></span>').appendTo(this.box); this.disabled=this.element.prop("disabled"); this.label=$('label[for="'+this.element.attr("id")+'"]'); if(this.isChecked()){this.box.addClass("ui-state-active"); this.icon.addClass("fa fa-fw fa-check") }if(this.disabled){this.box.addClass("ui-state-disabled") }else{this._bindEvents() }},_bindEvents:function(){var a=this; this.box.on("mouseover.puicheckbox",function(){if(!a.isChecked()){a.box.addClass("ui-state-hover") }}).on("mouseout.puicheckbox",function(){a.box.removeClass("ui-state-hover") }).on("click.puicheckbox",function(){a.toggle() }); this.element.focus(function(){if(a.isChecked()){a.box.removeClass("ui-state-active") }a.box.addClass("ui-state-focus") }).blur(function(){if(a.isChecked()){a.box.addClass("ui-state-active") }a.box.removeClass("ui-state-focus") }).keydown(function(c){var b=$.ui.keyCode; if(c.which==b.SPACE){c.preventDefault() }}).keyup(function(c){var b=$.ui.keyCode; if(c.which==b.SPACE){a.toggle(true); c.preventDefault() }}); this.label.on("click.puicheckbox",function(b){a.toggle(); b.preventDefault() }) },toggle:function(a){if(this.isChecked()){this.uncheck(a) }else{this.check(a) }this._trigger("change",null,this.isChecked()) },isChecked:function(){return this.element.prop("checked") },check:function(b,a){if(!this.isChecked()){this.element.prop("checked",true); this.icon.addClass("fa fa-fw fa-check"); if(!b){this.box.addClass("ui-state-active") }if(!a){this.element.trigger("change") }}},uncheck:function(){if(this.isChecked()){this.element.prop("checked",false); this.box.removeClass("ui-state-active"); this.icon.removeClass("fa fa-fw fa-check"); this.element.trigger("change") }},_unbindEvents:function(){this.box.off(); this.element.off("focus blur keydown keyup"); this.label.off() },disable:function(){this.box.prop("disabled",true); this.box.attr("aria-disabled",true); this.box.addClass("ui-state-disabled").removeClass("ui-state-hover"); this._unbindEvents() },enable:function(){this.box.prop("disabled",false); this.box.attr("aria-disabled",false); this.box.removeClass("ui-state-disabled"); this._bindEvents() }}) })();(function(){$.widget("primeui.puidatatable",{options:{columns:null,datasource:null,paginator:null,selectionMode:null,rowSelect:null,rowUnselect:null,caption:null,footer:null,sortField:null,sortOrder:null,keepSelectionInLazyMode:false,scrollable:false,scrollHeight:null,scrollWidth:null,responsive:false,expandableRows:false,expandedRowContent:null,rowExpandMode:"multiple",draggableColumns:false,resizableColumns:false,columnResizeMode:"fit",draggableRows:false,filterDelay:300,stickyHeader:false,editMode:null,tabindex:0},_create:function(){this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.addClass("pui-datatable ui-widget"); if(this.options.responsive){this.element.addClass("pui-datatable-reflow") }if(this.options.scrollable){this._createScrollableDatatable() }else{this._createRegularDatatable() }if(this.options.datasource){if($.isArray(this.options.datasource)){this._onDataInit(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){if(this.options.lazy){this.options.datasource.call(this,this._onDataInit,{first:0,sortField:this.options.sortField,sortOrder:this.options.sortOrder}) }else{this.options.datasource.call(this,this._onDataInit) }}}}},_createRegularDatatable:function(){this.tableWrapper=$('<div class="pui-datatable-tablewrapper" />').appendTo(this.element); this.table=$("<table><thead></thead><tbody></tbody></table>").appendTo(this.tableWrapper); this.thead=this.table.children("thead"); this.tbody=this.table.children("tbody").addClass("pui-datatable-data"); if(this.containsFooter()){this.tfoot=this.thead.after("<tfoot></tfoot>").next() }},_createScrollableDatatable:function(){this.element.append('<div class="ui-widget-header pui-datatable-scrollable-header"><div class="pui-datatable-scrollable-header-box"><table><thead></thead></table></div></div>').append('<div class="pui-datatable-scrollable-body"><table><tbody></tbody></table></div>'); this.thead=this.element.find("> .pui-datatable-scrollable-header > .pui-datatable-scrollable-header-box > table > thead"); this.tbody=this.element.find("> .pui-datatable-scrollable-body > table > tbody"); if(this.containsFooter()){this.element.append('<div class="ui-widget-header pui-datatable-scrollable-footer"><div class="pui-datatable-scrollable-footer-box"><table><tfoot></tfoot></table></div></div>'); this.tfoot=this.element.find("> .pui-datatable-scrollable-footer > .pui-datatable-scrollable-footer-box > table > tfoot") }},_initialize:function(){var a=this; this._initHeader(); this._initFooter(); if(this.options.caption){this.element.prepend('<div class="pui-datatable-caption ui-widget-header">'+this.options.caption+"</div>") }if(this.options.paginator){this.options.paginator.paginate=function(b,c){a.paginate() }; this.options.paginator.totalRecords=this.options.lazy?this.options.paginator.totalRecords:this.data.length; this.paginator=$("<div></div>").insertAfter(this.tableWrapper).puipaginator(this.options.paginator) }if(this.options.footer){this.element.append('<div class="pui-datatable-footer ui-widget-header">'+this.options.footer+"</div>") }if(this._isSortingEnabled()){this._initSorting() }if(this.hasFiltering){this._initFiltering() }if(this.options.selectionMode){this._initSelection() }if(this.options.expandableRows){this._initExpandableRows() }if(this.options.draggableColumns){this._initDraggableColumns() }if(this.options.stickyHeader){this._initStickyHeader() }if(this.options.sortField&&this.options.sortOrder){this._indicateInitialSortColumn(); this.sort(this.options.sortField,this.options.sortOrder) }else{this._renderData() }if(this.options.scrollable){this._initScrolling() }if(this.options.resizableColumns){this._initResizableColumns() }if(this.options.draggableRows){this._initDraggableRows() }if(this.options.editMode){this._initEditing() }},_initHeader:function(){if(this.options.headerRows){for(var a=0; a<this.options.headerRows.length; a++){this._initHeaderColumns(this.options.headerRows[a].columns) }}else{if(this.options.columns){this._initHeaderColumns(this.options.columns) }}},_initFooter:function(){if(this.containsFooter()){if(this.options.footerRows){for(var a=0; a<this.options.footerRows.length; a++){this._initFooterColumns(this.options.footerRows[a].columns) }}else{if(this.options.columns){this._initFooterColumns(this.options.columns) }}}},_initHeaderColumns:function(a){var b=$("<tr></tr>").appendTo(this.thead),c=this; $.each(a,function(f,e){var d=$('<th class="ui-state-default"><span class="pui-column-title"></span></th>').data("field",e.field).uniqueId().appendTo(b); if(e.headerClass){d.addClass(e.headerClass) }if(e.headerStyle){d.attr("style",e.headerStyle) }if(e.headerText){d.children(".pui-column-title").text(e.headerText) }else{if(e.headerContent){d.children(".pui-column-title").append(e.headerContent.call(this,e)) }}if(e.rowspan){d.attr("rowspan",e.rowspan) }if(e.colspan){d.attr("colspan",e.colspan) }if(e.sortable){d.addClass("pui-sortable-column").data("order",0).append('<span class="pui-sortable-column-icon fa fa-fw fa-sort"></span>') }if(e.filter){c.hasFiltering=true; var g=$('<input type="text" class="pui-column-filter" />').puiinputtext().data({field:e.field,filtermatchmode:e.filterMatchMode||"startsWith"}).appendTo(d); if(e.filterFunction){g.on("filter",function(h,i,j){return e.filterFunction.call(c,i,j) }) }}}) },_initFooterColumns:function(a){var b=$("<tr></tr>").appendTo(this.tfoot); $.each(a,function(e,d){var c=$('<td class="ui-state-default"></td>'); if(d.footerText){c.text(d.footerText) }if(d.rowspan){c.attr("rowspan",d.rowspan) }if(d.colspan){c.attr("colspan",d.colspan) }c.appendTo(b) }) },_indicateInitialSortColumn:function(){this.sortableColumns=this.thead.find("> tr > th.pui-sortable-column"); var a=this; $.each(this.sortableColumns,function(b,c){var e=$(c),d=e.data(); if(a.options.sortField===d.field){var f=e.children(".pui-sortable-column-icon"); e.data("order",a.options.sortOrder).removeClass("ui-state-hover").addClass("ui-state-active"); if(a.options.sortOrder===-1){f.removeClass("fa-sort fa-sort-asc").addClass("fa-sort-desc") }else{if(a.options.sortOrder===1){f.removeClass("fa-sort fa-sort-desc").addClass("fa-sort-asc") }}}}) },_onDataInit:function(a){this.data=a; if(!this.data){this.data=[] }this._initialize() },_onDataUpdate:function(a){this.data=a; if(!this.data){this.data=[] }this.reset(); this._renderData() },_onLazyLoad:function(a){this.data=a; if(!this.data){this.data=[] }this._renderData() },reset:function(){if(this.options.selectionMode){this.selection=[] }if(this.paginator){this.paginator.puipaginator("setState",{page:0,totalRecords:this.options.lazy?this.options.paginator.totalRecords:this.data.length}) }this.thead.children("th.pui-sortable-column").data("order",0).filter(".ui-state-active").removeClass("ui-state-active").children("span.pui-sortable-column-icon").removeClass("fa-sort-asc fa-sort-desc").addClass("fa-sort") },_initSorting:function(){var b=this,a=this.thead.find("> tr > th.pui-sortable-column"); a.on("mouseover.puidatatable",function(){var c=$(this); if(!c.hasClass("ui-state-active")){c.addClass("ui-state-hover") }}).on("mouseout.puidatatable",function(){var c=$(this); if(!c.hasClass("ui-state-active")){c.removeClass("ui-state-hover") }}).on("click.puidatatable",function(g){var f=$(this),d=f.data("field"),c=f.data("order"),e=(c===0)?1:(c*-1),h=f.children(".pui-sortable-column-icon"); f.siblings().filter(".ui-state-active").data("order",0).removeClass("ui-state-active").children("span.pui-sortable-column-icon").removeClass("fa-sort-asc fa-sort-desc").addClass("fa-sort"); b.options.sortField=d; b.options.sortOrder=e; b.sort(d,e); f.data("order",e).removeClass("ui-state-hover").addClass("ui-state-active"); if(e===-1){h.removeClass("fa-sort fa-sort-asc").addClass("fa-sort-desc") }else{if(e===1){h.removeClass("fa-sort fa-sort-desc").addClass("fa-sort-asc") }}b._trigger("sort",g,{sortOrder:e,sortField:d}) }) },paginate:function(){if(this.options.lazy){if(this.options.selectionMode&&!this.options.keepSelectionInLazyMode){this.selection=[] }this.options.datasource.call(this,this._onLazyLoad,this._createStateMeta()) }else{this._renderData() }},sort:function(b,a){if(this.options.selectionMode){this.selection=[] }if(this.options.lazy){this.options.datasource.call(this,this._onLazyLoad,this._createStateMeta()) }else{this.data.sort(function(d,g){var f=d[b],e=g[b],c=null; if(typeof f=="string"||f instanceof String){if(f.localeCompare){return(a*f.localeCompare(e)) }else{if(f.toLowerCase){f=f.toLowerCase() }if(e.toLowerCase){e=e.toLowerCase() }c=(f<e)?-1:(f>e)?1:0 }}else{c=(f<e)?-1:(f>e)?1:0 }return(a*c) }); if(this.options.selectionMode){this.selection=[] }if(this.paginator){this.paginator.puipaginator("option","page",0) }this._renderData() }},sortByField:function(d,c){var f=d.name.toLowerCase(); var e=c.name.toLowerCase(); return((f<e)?-1:((f>e)?1:0)) },_renderData:function(){var a=this.filteredData||this.data; if(a){this.tbody.html(""); var m=this._getFirst(),f=this.options.lazy?0:m,o=this._getRows(); for(var e=f; e<(f+o); e++){var c=a[e]; if(c){var n=$('<tr class="ui-widget-content" />').appendTo(this.tbody),h=(e%2===0)?"pui-datatable-even":"pui-datatable-odd",k=e; n.addClass(h); if(this.options.lazy){k+=m }if(this.options.selectionMode&&PUI.inArray(this.selection,k)){n.addClass("ui-state-highlight") }for(var d=0; d<this.options.columns.length; d++){var b=$("<td />").appendTo(n),l=this.options.columns[d]; if(l.bodyClass){b.addClass(l.bodyClass) }if(l.bodyStyle){b.attr("style",l.bodyStyle) }if(l.editor){b.addClass("pui-editable-column").data({editor:l.editor,rowdata:c,field:l.field}) }if(l.field){b.text(c[l.field]) }else{if(l.content){var g=l.content.call(this,c); if($.type(g)==="string"){b.html(g) }else{b.append(g) }}else{if(l.rowToggler){b.append('<div class="pui-row-toggler fa fa-fw fa-chevron-circle-right"></div>') }}}if(this.options.responsive&&l.headerText){b.prepend('<span class="pui-column-title">'+l.headerText+"</span>") }}}}}},_getFirst:function(){if(this.paginator){var b=this.paginator.puipaginator("option","page"),a=this.paginator.puipaginator("option","rows"); return(b*a) }else{return 0 }},_getRows:function(){return this.paginator?this.paginator.puipaginator("option","rows"):this.data.length },_isSortingEnabled:function(){var b=this.options.columns; if(b){for(var a=0; a<b.length; a++){if(b[a].sortable){return true }}}return false },_initSelection:function(){var a=this; this.selection=[]; this.rowSelector="> tr.ui-widget-content:not(.ui-datatable-empty-message)"; if(this._isMultipleSelection()){this.originRowIndex=0; this.cursorIndex=null }this.tbody.off("mouseover.puidatatable mouseout.puidatatable mousedown.puidatatable click.puidatatable",this.rowSelector).on("mouseover.datatable",this.rowSelector,null,function(){var b=$(this); if(!b.hasClass("ui-state-highlight")){b.addClass("ui-state-hover") }}).on("mouseout.datatable",this.rowSelector,null,function(){var b=$(this); if(!b.hasClass("ui-state-highlight")){b.removeClass("ui-state-hover") }}).on("mousedown.datatable",this.rowSelector,null,function(){a.mousedownOnRow=true }).on("click.datatable",this.rowSelector,null,function(b){a._onRowClick(b,this); a.mousedownOnRow=false }); this._bindSelectionKeyEvents() },_onRowClick:function(f,e){if(!$(f.target).is(":input,:button,a,.pui-c")){var h=$(e),d=h.hasClass("ui-state-highlight"),g=f.metaKey||f.ctrlKey,b=f.shiftKey; this.focusedRow=h; if(d&&g){this.unselectRow(h) }else{if(this._isSingleSelection()||(this._isMultipleSelection()&&!g&&!b)){if(this._isMultipleSelection()){var c=this.getSelection(); for(var a=0; a<c.length; a++){this._trigger("rowUnselect",null,c[a]) }}this.unselectAllRows() }this.selectRow(h,false,f) }PUI.clearSelection() }},onRowRightClick:function(c,b){var e=$(b),f=this._getRowIndex(e),d=this.data[f],a=e.hasClass("ui-state-highlight"); if(this._isSingleSelection()||!a){this.unselectAllRows() }this.selectRow(e,true); this.dataSelectedByContextMenu=d; this._trigger("rowSelectContextMenu",c,d); PUI.clearSelection() },_bindSelectionKeyEvents:function(){var a=this; this.tbody.attr("tabindex",this.options.tabindex).on("focus",function(b){if(!a.mousedownOnRow){a.focusedRow=a.tbody.children("tr.ui-widget-content").eq(0); a.focusedRow.addClass("ui-state-hover") }}).on("blur",function(){if(a.focusedRow){a.focusedRow.removeClass("ui-state-hover"); a.focusedRow=null }}).on("keydown",function(f){var d=$.ui.keyCode,b=f.which; if(a.focusedRow){switch(b){case d.UP:var g=a.focusedRow.prev("tr.ui-widget-content"); if(g.length){a.focusedRow.removeClass("ui-state-hover"); a.focusedRow=g; a.focusedRow.addClass("ui-state-hover") }f.preventDefault(); break; case d.DOWN:var c=a.focusedRow.next("tr.ui-widget-content"); if(c.length){a.focusedRow.removeClass("ui-state-hover"); a.focusedRow=c; a.focusedRow.addClass("ui-state-hover") }f.preventDefault(); break; case d.ENTER:case d.NUMPAD_ENTER:case d.SPACE:f.target=a.focusedRow.children().eq(0).get(0); a._onRowClick(f,a.focusedRow.get(0)); f.preventDefault(); break; default:break }}}) },_isSingleSelection:function(){return this.options.selectionMode==="single" },_isMultipleSelection:function(){return this.options.selectionMode==="multiple" },unselectAllRows:function(){this.tbody.children("tr.ui-state-highlight").removeClass("ui-state-highlight").attr("aria-selected",false); this.selection=[] },unselectRow:function(b,a){var c=this._getRowIndex(b); b.removeClass("ui-state-highlight").attr("aria-selected",false); this._removeSelection(c); if(!a){this._trigger("rowUnselect",null,this.data[c]) }},selectRow:function(d,a,b){var e=this._getRowIndex(d),c=this.data[e]; d.removeClass("ui-state-hover").addClass("ui-state-highlight").attr("aria-selected",true); this._addSelection(e); if(!a){if(this.options.lazy){c=this.data[e-this._getFirst()] }this._trigger("rowSelect",b,c) }},getSelection:function(){var c=this.options.lazy?this._getFirst():0,b=[]; for(var a=0; a<this.selection.length; a++){if(this.data.length>this.selection[a]-c&&this.selection[a]-c>0){b.push(this.data[this.selection[a]-c]) }}return b },_removeSelection:function(a){this.selection=$.grep(this.selection,function(b){return b!==a }) },_addSelection:function(a){if(!this._isSelected(a)){this.selection.push(a) }},_isSelected:function(a){return PUI.inArray(this.selection,a) },_getRowIndex:function(b){var a=b.index(); return this.options.paginator?this._getFirst()+a:a },_initExpandableRows:function(){var b=this,a="> tr > td > div.pui-row-toggler"; this.tbody.off("click",a).on("click",a,null,function(){b.toggleExpansion($(this)) }).on("keydown",a,null,function(f){var c=f.which,d=$.ui.keyCode; if((c===d.ENTER||c===d.NUMPAD_ENTER)){b.toggleExpansion($(this)); f.preventDefault() }}) },toggleExpansion:function(b){var c=b.closest("tr"),a=b.hasClass("fa-chevron-circle-down"); if(a){b.addClass("fa-chevron-circle-right").removeClass("fa-chevron-circle-down").attr("aria-expanded",false); this.collapseRow(c); this._trigger("rowCollapse",null,this.data[this._getRowIndex(c)]) }else{if(this.options.rowExpandMode==="single"){this.collapseAllRows() }b.addClass("fa-chevron-circle-down").removeClass("fa-chevron-circle-right").attr("aria-expanded",true); this.loadExpandedRowContent(c) }},loadExpandedRowContent:function(b){var c=this._getRowIndex(b),a=$('<tr class="pui-expanded-row-content ui-widget-content"><td colspan="'+this.options.columns.length+'"></td></tr>'); a.children("td").append(this.options.expandedRowContent.call(this,this.data[c])); b.addClass("pui-expanded-row").after(a); this._trigger("rowExpand",null,this.data[this._getRowIndex(b)]) },collapseRow:function(a){a.removeClass("pui-expanded-row").next(".pui-expanded-row-content").remove() },collapseAllRows:function(){var a=this; this.getExpandedRows().each(function(){var f=$(this); a.collapseRow(f); var c=f.children("td"); for(var b=0; b<c.length; b++){var d=c.eq(b),e=d.children(".pui-row-toggler"); if(e.length){e.addClass("fa-chevron-circle-right").removeClass("fa-chevron-circle-down") }}}) },getExpandedRows:function(){return this.tbody.children(".pui-expanded-row") },_createStateMeta:function(){var a={first:this._getFirst(),rows:this._getRows(),sortField:this.options.sortField,sortOrder:this.options.sortOrder,filters:this.filterMetaMap}; return a },_updateDatasource:function(a){this.options.datasource=a; if($.isArray(this.options.datasource)){this._onDataUpdate(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){if(this.options.lazy){this.options.datasource.call(this,this._onDataUpdate,{first:0,sortField:this.options.sortField,sortorder:this.options.sortOrder}) }else{this.options.datasource.call(this,this._onDataUpdate) }}}},_setOption:function(a,b){if(a==="datasource"){this._updateDatasource(b) }else{$.Widget.prototype._setOption.apply(this,arguments) }},_initScrolling:function(){this.scrollHeader=this.element.children(".pui-datatable-scrollable-header"); this.scrollBody=this.element.children(".pui-datatable-scrollable-body"); this.scrollHeaderBox=this.scrollHeader.children(".pui-datatable-scrollable-header-box"); this.headerTable=this.scrollHeaderBox.children("table"); this.bodyTable=this.scrollBody.children("table"); this.percentageScrollHeight=this.options.scrollHeight&&(this.options.scrollHeight.indexOf("%")!==-1); this.percentageScrollWidth=this.options.scrollWidth&&(this.options.scrollWidth.indexOf("%")!==-1); var c=this,b=this.getScrollbarWidth()+"px"; if(this.options.scrollHeight){if(this.percentageScrollHeight){this.adjustScrollHeight() }else{this.scrollBody.css("max-height",this.options.scrollHeight+"px") }if(this.hasVerticalOverflow()){this.scrollHeaderBox.css("margin-right",b) }}this.fixColumnWidths(); if(this.options.scrollWidth){if(this.percentageScrollWidth){this.adjustScrollWidth() }else{this.setScrollWidth(parseInt(this.options.scrollWidth)) }}this.cloneHead(); this.scrollBody.on("scroll.dataTable",function(){var d=c.scrollBody.scrollLeft(); c.scrollHeaderBox.css("margin-left",-d) }); this.scrollHeader.on("scroll.dataTable",function(){c.scrollHeader.scrollLeft(0) }); var a="resize."+this.id; $(window).off(a).on(a,function(){if(c.element.is(":visible")){if(c.percentageScrollHeight){c.adjustScrollHeight() }if(c.percentageScrollWidth){c.adjustScrollWidth() }}}) },cloneHead:function(){this.theadClone=this.thead.clone(); this.theadClone.find("th").each(function(){var b=$(this); b.attr("id",b.attr("id")+"_clone"); $(this).children().not(".pui-column-title").remove() }); this.theadClone.removeAttr("id").addClass("pui-datatable-scrollable-theadclone").height(0).prependTo(this.bodyTable); if(this.options.scrollWidth){var a=this.theadClone.find("> tr > th.pui-sortable-column"); a.each(function(){$(this).data("original",$(this).attr("id").split("_clone")[0]) }); a.on("blur.dataTable",function(){$(PrimeFaces.escapeClientId($(this).data("original"))).removeClass("ui-state-focus") }).on("focus.dataTable",function(){$(PrimeFaces.escapeClientId($(this).data("original"))).addClass("ui-state-focus") }).on("keydown.dataTable",function(d){var b=d.which,c=$.ui.keyCode; if((b===c.ENTER||b===c.NUMPAD_ENTER)&&$(d.target).is(":not(:input)")){$(PrimeFaces.escapeClientId($(this).data("original"))).trigger("click.dataTable",(d.metaKey||d.ctrlKey)); d.preventDefault() }}) }},adjustScrollHeight:function(){var d=this.element.parent().innerHeight()*(parseInt(this.options.scrollHeight)/100),f=this.element.children(".pui-datatable-header").outerHeight(true),b=this.element.children(".pui-datatable-footer").outerHeight(true),c=(this.scrollHeader.outerHeight(true)+this.scrollFooter.outerHeight(true)),e=this.paginator?this.paginator.getContainerHeight(true):0,a=(d-(c+e+f+b)); this.scrollBody.css("max-height",a+"px") },adjustScrollWidth:function(){var a=parseInt((this.element.parent().innerWidth()*(parseInt(this.options.scrollWidth)/100))); this.setScrollWidth(a) },setOuterWidth:function(a,b){var c=a.outerWidth()-a.width(); a.width(b-c) },setScrollWidth:function(a){var b=this; this.element.children(".ui-widget-header").each(function(){b.setOuterWidth($(this),a) }); this.scrollHeader.width(a); this.scrollBody.css("margin-right",0).width(a) },alignScrollBody:function(){var a=this.hasVerticalOverflow()?this.getScrollbarWidth()+"px":"0px"; this.scrollHeaderBox.css("margin-right",a) },getScrollbarWidth:function(){if(!this.scrollbarWidth){this.scrollbarWidth=PUI.browser.webkit?"15":PUI.calculateScrollbarWidth() }return this.scrollbarWidth },hasVerticalOverflow:function(){return(this.options.scrollHeight&&this.bodyTable.outerHeight()>this.scrollBody.outerHeight()) },restoreScrollState:function(){var a=this.scrollStateHolder.val(),b=a.split(","); this.scrollBody.scrollLeft(b[0]); this.scrollBody.scrollTop(b[1]) },saveScrollState:function(){var a=this.scrollBody.scrollLeft()+","+this.scrollBody.scrollTop(); this.scrollStateHolder.val(a) },clearScrollState:function(){this.scrollStateHolder.val("0,0") },fixColumnWidths:function(){if(!this.columnWidthsFixed){if(this.options.scrollable){this.scrollHeaderBox.find("> table > thead > tr > th").each(function(){var b=$(this),a=b.width(); b.width(a) }) }else{this.element.find("> .pui-datatable-tablewrapper > table > thead > tr > th").each(function(){var a=$(this); a.width(a.width()) }) }this.columnWidthsFixed=true }},_initDraggableColumns:function(){var a=this; this.dragIndicatorTop=$('<span class="fa fa-arrow-down" style="position:absolute"/></span>').hide().appendTo(this.element); this.dragIndicatorBottom=$('<span class="fa fa-arrow-up" style="position:absolute"/></span>').hide().appendTo(this.element); this.thead.find("> tr > th").draggable({appendTo:"body",opacity:0.75,cursor:"move",scope:this.id,cancel:":input,.ui-column-resizer",drag:function(e,g){var i=g.helper.data("droppable-column"); if(i){var d=i.offset(),b=d.top-10,c=d.top+i.height()+8,f=null; if(e.originalEvent.pageX>=d.left+(i.width()/2)){var h=i.next(); if(h.length==1){f=h.offset().left-9 }else{f=i.offset().left+i.innerWidth()-9 }g.helper.data("drop-location",1) }else{f=d.left-9; g.helper.data("drop-location",-1) }a.dragIndicatorTop.offset({left:f,top:b-3}).show(); a.dragIndicatorBottom.offset({left:f,top:c-3}).show() }},stop:function(b,c){a.dragIndicatorTop.css({left:0,top:0}).hide(); a.dragIndicatorBottom.css({left:0,top:0}).hide() },helper:function(){var c=$(this),b=$('<div class="ui-widget ui-state-default" style="padding:4px 10px;text-align:center;"></div>'); b.width(c.width()); b.height(c.height()); b.html(c.html()); return b.get(0) }}).droppable({hoverClass:"ui-state-highlight",tolerance:"pointer",scope:this.id,over:function(b,c){c.helper.data("droppable-column",$(this)) },drop:function(c,i){var m=i.draggable,f=i.helper.data("drop-location"),g=$(this),e=null,k=null; var j=a.tbody.find("> tr:not(.ui-expanded-row-content) > td:nth-child("+(m.index()+1)+")"),l=a.tbody.find("> tr:not(.ui-expanded-row-content) > td:nth-child("+(g.index()+1)+")"); if(a.containsFooter()){var b=a.tfoot.find("> tr > td"),e=b.eq(m.index()),k=b.eq(g.index()) }if(f>0){m.insertAfter(g); j.each(function(n,o){$(this).insertAfter(l.eq(n)) }); if(e&&k){e.insertAfter(k) }if(a.options.scrollable){var h=$(document.getElementById(m.attr("id")+"_clone")),d=$(document.getElementById(g.attr("id")+"_clone")); h.insertAfter(d) }}else{m.insertBefore(g); j.each(function(n,o){$(this).insertBefore(l.eq(n)) }); if(e&&k){e.insertBefore(k) }if(a.options.scrollable){var h=$(document.getElementById(m.attr("id")+"_clone")),d=$(document.getElementById(g.attr("id")+"_clone")); h.insertBefore(d) }}a._trigger("colReorder",null,{dragIndex:m.index(),dropIndex:g.index()}) }}) },containsFooter:function(){if(this.hasFooter===undefined){this.hasFooter=this.options.footerRows!==undefined; if(!this.hasFooter){if(this.options.columns){for(var a=0; a<this.options.columns.length; a++){if(this.options.columns[a].footerText!==undefined){this.hasFooter=true; break }}}}}return this.hasFooter },_initResizableColumns:function(){this.element.addClass("pui-datatable-resizable"); this.thead.find("> tr > th").addClass("pui-resizable-column"); this.resizerHelper=$('<div class="pui-column-resizer-helper ui-state-highlight"></div>').appendTo(this.element); this.addResizers(); var a=this.thead.find("> tr > th > span.pui-column-resizer"),b=this; setTimeout(function(){b.fixColumnWidths() },5); a.draggable({axis:"x",start:function(d,e){e.helper.data("originalposition",e.helper.offset()); var c=b.options.scrollable?b.scrollBody.height():b.thead.parent().height()-b.thead.height()-1; b.resizerHelper.height(c); b.resizerHelper.show() },drag:function(c,d){b.resizerHelper.offset({left:d.helper.offset().left+d.helper.width()/2,top:b.thead.offset().top+b.thead.height()}) },stop:function(c,d){d.helper.css({left:"",top:"0px",right:"0px"}); b.resize(c,d); b.resizerHelper.hide(); if(b.options.columnResizeMode==="expand"){setTimeout(function(){b._trigger("colResize",null,{element:d.helper.parent()}) },5) }else{b._trigger("colResize",null,{element:d.helper.parent()}) }if(b.options.stickyHeader){b.thead.find(".pui-column-filter").prop("disabled",false); b.clone=b.thead.clone(true); b.cloneContainer.find("thead").remove(); b.cloneContainer.children("table").append(b.clone); b.thead.find(".ui-column-filter").prop("disabled",true) }},containment:this.element}) },resize:function(a,i){var b,d,h=null,c=null,e=null,k=(this.options.columnResizeMode==="expand"),l=this.thead.parent(),b=i.helper.parent(),d=b.next(); h=(i.position.left-i.originalPosition.left),c=(b.width()+h),e=(d.width()-h); if((c>15&&e>15)||(k&&c>15)){if(k){l.width(l.width()+h); setTimeout(function(){b.width(c) },1) }else{b.width(c); d.width(e) }if(this.options.scrollable){var g=this.theadClone.parent(),j=b.index(); if(k){var f=this; g.width(g.width()+h); this.footerTable.width(this.footerTable.width()+h); setTimeout(function(){if(f.hasColumnGroup){f.theadClone.find("> tr:first").children("th").eq(j).width(c); f.footerTable.find("> tfoot > tr:first").children("th").eq(j).width(c) }else{f.theadClone.find(PrimeFaces.escapeClientId(b.attr("id")+"_clone")).width(c); f.footerCols.eq(j).width(c) }},1) }else{this.theadClone.find(PrimeFaces.escapeClientId(b.attr("id")+"_clone")).width(c); this.theadClone.find(PrimeFaces.escapeClientId(d.attr("id")+"_clone")).width(e) }}}},addResizers:function(){var a=this.thead.find("> tr > th.pui-resizable-column"); a.prepend('<span class="pui-column-resizer">&nbsp;</span>'); if(this.options.columnResizeMode==="fit"){a.filter(":last-child").children("span.pui-column-resizer").hide() }},_initDraggableRows:function(){var a=this; this.tbody.sortable({placeholder:"pui-datatable-rowordering ui-state-active",cursor:"move",handle:"td,span:not(.ui-c)",appendTo:document.body,helper:function(g,h){var d=h.children(),f=$('<div class="pui-datatable ui-widget"><table><tbody></tbody></table></div>'),c=h.clone(),b=c.children(); for(var e=0; e<b.length; e++){b.eq(e).width(d.eq(e).width()) }c.appendTo(f.find("tbody")); return f },update:function(b,c){a.syncRowParity(); this._trigger("rowReorder",null,{fromIndex:c.item.data("ri"),toIndex:a._getFirst()+c.item.index()}) },change:function(b,c){if(a.cfg.scrollable){PUI.scrollInView(a.scrollBody,c.placeholder) }}}) },syncRowParity:function(){var b=this.tbody.children("tr.ui-widget-content"); for(var a=this._getFirst(); a<b.length; a++){var c=b.eq(a); c.data("ri",a).removeClass("pui-datatable-even pui-datatable-odd"); if(a%2===0){c.addClass("pui-datatable-even") }else{c.addClass("pui-datatable-odd") }}},getContextMenuSelection:function(a){return this.dataSelectedByContextMenu },_initFiltering:function(){var a=this; this.filterElements=this.thead.find(".pui-column-filter"); this.filterElements.on("keyup",function(){if(a.filterTimeout){clearTimeout(a.filterTimeout) }a.filterTimeout=setTimeout(function(){a.filter(); a.filterTimeout=null },a.options.filterDelay) }) },filter:function(){this.filterMetaMap=[]; for(var e=0; e<this.filterElements.length; e++){var g=this.filterElements.eq(e),f=g.val(); if(f&&$.trim(f)!==""){this.filterMetaMap.push({field:g.data("field"),filterMatchMode:g.data("filtermatchmode"),value:f.toLowerCase(),element:g}) }}if(this.options.lazy){this.options.datasource.call(this,this._onLazyLoad,this._createStateMeta()) }else{if(this.filterMetaMap.length){this.filteredData=[]; for(var e=0; e<this.data.length; e++){var h=true; for(var d=0; d<this.filterMetaMap.length; d++){var b=this.filterMetaMap[d],l=b.value,k=b.field,c=this.data[e][k]; if(b.filterMatchMode==="custom"){h=b.element.triggerHandler("filter",[c,l]) }else{var a=this.filterConstraints[b.filterMatchMode]; if(!a(c,l)){h=false }}if(!h){break }}if(h){this.filteredData.push(this.data[e]) }}}else{this.filteredData=null }if(this.paginator){this.paginator.puipaginator("option","totalRecords",this.filteredData?this.filteredData.length:this.data?this.data.length:0) }this._renderData() }},filterConstraints:{startsWith:function(b,a){if(a===undefined||a===null||$.trim(a)===""){return true }if(b===undefined||b===null){return false }return b.toString().toLowerCase().slice(0,a.length)===a },contains:function(b,a){if(a===undefined||a===null||$.trim(a)===""){return true }if(b===undefined||b===null){return false }return b.toString().toLowerCase().indexOf(a)!==-1 }},_initStickyHeader:function(){var b=this.thead.parent(),f=b.offset(),d=$(window),c=this,e="scroll."+this.id,a="resize.sticky-"+this.id; this.cloneContainer=$('<div class="pui-datatable pui-datatable-sticky ui-widget"><table></table></div>'); this.clone=this.thead.clone(true); this.cloneContainer.children("table").append(this.clone); this.cloneContainer.css({position:"absolute",width:b.outerWidth(),top:f.top,left:f.left,"z-index":++PUI.zindex}).appendTo(this.element); d.off(e).on(e,function(){var h=d.scrollTop(),g=b.offset(); if(h>g.top){c.cloneContainer.css({position:"fixed",top:"0px"}).addClass("pui-shadow pui-sticky"); if(h>=(g.top+c.tbody.height())){c.cloneContainer.hide() }else{c.cloneContainer.show() }}else{c.cloneContainer.css({position:"absolute",top:g.top}).removeClass("pui-shadow pui-sticky") }}).off(a).on(a,function(){c.cloneContainer.width(b.outerWidth()) }); this.thead.find(".pui-column-filter").prop("disabled",true) },_initEditing:function(){var a="> tr > td.pui-editable-column",b=this; this.tbody.off("click",a).on("click",a,null,function(d){var c=$(this); if(!c.hasClass("pui-cell-editing")){b._showCellEditor(c) }}) },_showCellEditor:function(a){var b=this.editors[a.data("editor")].call(),c=this; b.val(a.data("rowdata")[a.data("field")]); a.addClass("pui-cell-editing").html("").append(b); b.focus().on("change",function(){c._onCellEditorChange(a) }).on("blur",function(){c._onCellEditorBlur(a) }).on("keydown",function(i){var d=i.which,h=$.ui.keyCode; if((d===h.ENTER||d===h.NUMPAD_ENTER)){$(this).trigger("change").trigger("blur"); i.preventDefault() }else{if(d===h.TAB){if(i.shiftKey){var g=a.prevAll("td.pui-editable-column").eq(0); if(!g.length){g=a.parent().prev("tr").children("td.pui-editable-column:last") }if(g.length){c._showCellEditor(g) }}else{var f=a.nextAll("td.pui-editable-column").eq(0); if(!f.length){f=a.parent().next("tr").children("td.pui-editable-column").eq(0) }if(f.length){c._showCellEditor(f) }}i.preventDefault() }else{if(d===h.ESCAPE){c._onCellEditorBlur(a) }}}}) },_onCellEditorChange:function(a){var b=a.children(".pui-cell-editor").val(); var c=this._trigger("cellEdit",null,{oldValue:a.data("rowdata")[a.data("field")],newValue:b,data:a.data("rowdata"),field:a.data("field")}); if(c!==false){a.data("rowdata")[a.data("field")]=b }},_onCellEditorBlur:function(a){a.removeClass("pui-cell-editing").text(a.data("rowdata")[a.data("field")]).children(".pui-cell-editor").remove() },editors:{input:function(){return $('<input type="text" class="pui-cell-editor"/>') }}}) })();(function(){$.widget("primeui.puidatagrid",{options:{columns:3,datasource:null,paginator:null,header:null,footer:null,content:null,lazy:false},_create:function(){this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.addClass("pui-datagrid ui-widget"); if(this.options.header){this.element.append('<div class="pui-datagrid-header ui-widget-header ui-corner-top">'+this.options.header+"</div>") }this.content=$('<div class="pui-datagrid-content ui-widget-content pui-grid pui-grid-responsive"></div>').appendTo(this.element); if(this.options.footer){this.element.append('<div class="pui-datagrid-footer ui-widget-header ui-corner-top">'+this.options.footer+"</div>") }if(this.options.datasource){this._initDatasource() }},_onDataInit:function(a){this._onDataUpdate(a); this._initPaginator() },_onDataUpdate:function(a){this.data=a; if(!this.data){this.data=[] }this.reset(); this._renderData() },_onLazyLoad:function(a){this.data=a; if(!this.data){this.data=[] }this._renderData() },reset:function(){if(this.paginator){this.paginator.puipaginator("setState",{page:0,totalRecords:this.options.lazy?this.options.paginator.totalRecords:this.data.length}) }},paginate:function(){if(this.options.lazy){this.options.datasource.call(this,this._onLazyLoad,this._createStateMeta()) }else{this._renderData() }},_renderData:function(){if(this.data){this.content.html(""); var d=this._getFirst(),h=this.options.lazy?0:d,e=this._getRows(),g=null; for(var c=h; c<(h+e); c++){var f=this.data[c]; if(f){if(c%this.options.columns===0){g=$('<div class="pui-grid-row"></div>').appendTo(this.content) }var a=$('<div class="pui-datagrid-column '+PUI.getGridColumn(this.options.columns)+'"></div>').appendTo(g),b=this.options.content.call(this,f); a.append(b) }}}},_getFirst:function(){if(this.paginator){var b=this.paginator.puipaginator("option","page"),a=this.paginator.puipaginator("option","rows"); return(b*a) }else{return 0 }},_getRows:function(){if(this.options.paginator){return this.paginator?this.paginator.puipaginator("option","rows"):this.options.paginator.rows }else{return this.data?this.data.length:0 }},_createStateMeta:function(){var a={first:this._getFirst(),rows:this._getRows()}; return a },_initPaginator:function(){var a=this; if(this.options.paginator){this.options.paginator.paginate=function(b,c){a.paginate() }; this.options.paginator.totalRecords=this.options.lazy?this.options.paginator.totalRecords:this.data.length; this.paginator=$("<div></div>").insertAfter(this.content).puipaginator(this.options.paginator) }},_initDatasource:function(){if($.isArray(this.options.datasource)){this._onDataInit(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){if(this.options.lazy){this.options.datasource.call(this,this._onDataInit,{first:0,rows:this._getRows()}) }else{this.options.datasource.call(this,this._onDataInit) }}}},_updateDatasource:function(a){this.options.datasource=a; if($.isArray(this.options.datasource)){this._onDataUpdate(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){if(this.options.lazy){this.options.datasource.call(this,this._onDataUpdate,{first:0,rows:this._getRows()}) }else{this.options.datasource.call(this,this._onDataUpdate) }}}},_setOption:function(a,b){if(a==="datasource"){this._updateDatasource(b) }else{$.Widget.prototype._setOption.apply(this,arguments) }}}) })();(function(){$.widget("primeui.puidialog",{options:{draggable:true,resizable:true,location:"center",minWidth:150,minHeight:25,height:"auto",width:"300px",visible:false,modal:false,showEffect:null,hideEffect:null,effectOptions:{},effectSpeed:"normal",closeOnEscape:true,rtl:false,closable:true,minimizable:false,maximizable:false,appendTo:null,buttons:null,responsive:false},_create:function(){this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.addClass("pui-dialog ui-widget ui-widget-content ui-helper-hidden ui-corner-all pui-shadow").contents().wrapAll('<div class="pui-dialog-content ui-widget-content" />'); this.element.prepend('<div class="pui-dialog-titlebar ui-widget-header ui-helper-clearfix ui-corner-top"><span id="'+this.element.attr("id")+'_label" class="pui-dialog-title">'+this.element.attr("title")+"</span>").removeAttr("title"); if(this.options.buttons){this.footer=$('<div class="pui-dialog-buttonpane ui-widget-content ui-helper-clearfix"></div>').appendTo(this.element); for(var b=0; b<this.options.buttons.length; b++){var c=this.options.buttons[b],a=$('<button type="button"></button>').appendTo(this.footer); if(c.text){a.text(c.text) }a.puibutton(c) }}if(this.options.rtl){this.element.addClass("pui-dialog-rtl") }this.content=this.element.children(".pui-dialog-content"); this.titlebar=this.element.children(".pui-dialog-titlebar"); if(this.options.closable){this._renderHeaderIcon("pui-dialog-titlebar-close","fa-close") }if(this.options.maximizable){this._renderHeaderIcon("pui-dialog-titlebar-maximize","fa-sort") }if(this.options.minimizable){this._renderHeaderIcon("pui-dialog-titlebar-minimize","fa-minus") }this.icons=this.titlebar.children(".pui-dialog-titlebar-icon"); this.closeIcon=this.titlebar.children(".pui-dialog-titlebar-close"); this.minimizeIcon=this.titlebar.children(".pui-dialog-titlebar-minimize"); this.maximizeIcon=this.titlebar.children(".pui-dialog-titlebar-maximize"); this.blockEvents="focus.puidialog mousedown.puidialog mouseup.puidialog keydown.puidialog keyup.puidialog"; this.parent=this.element.parent(); this.element.css({width:this.options.width,height:"auto"}); this.content.height(this.options.height); this._bindEvents(); if(this.options.draggable){this._setupDraggable() }if(this.options.resizable){this._setupResizable() }if(this.options.appendTo){this.element.appendTo(this.options.appendTo) }if(this.options.responsive){this.resizeNS="resize."+this.id }if($(document.body).children(".pui-dialog-docking-zone").length===0){$(document.body).append('<div class="pui-dialog-docking-zone"></div>') }this._applyARIA(); if(this.options.visible){this.show() }},_renderHeaderIcon:function(a,b){this.titlebar.append('<a class="pui-dialog-titlebar-icon '+a+' ui-corner-all" href="#" role="button"><span class="pui-icon fa fa-fw '+b+'"></span></a>') },_enableModality:function(){var b=this,a=$(document); this.modality=$('<div id="'+this.element.attr("id")+'_modal" class="ui-widget-overlay pui-dialog-mask"></div>').appendTo(document.body).css("z-index",this.element.css("z-index")-1); a.bind("keydown.puidialog",function(e){if(e.keyCode==$.ui.keyCode.TAB){var d=b.content.find(":tabbable"),f=d.filter(":first"),c=d.filter(":last"); if(e.target===c[0]&&!e.shiftKey){f.focus(1); return false }else{if(e.target===f[0]&&e.shiftKey){c.focus(1); return false }}}}).bind(this.blockEvents,function(c){if($(c.target).zIndex()<b.element.zIndex()){return false }}) },_disableModality:function(){this.modality.remove(); this.modality=null; $(document).unbind(this.blockEvents).unbind("keydown.dialog") },show:function(){if(this.element.is(":visible")){return }if(!this.positionInitialized){this._initPosition() }this._trigger("beforeShow",null); if(this.options.showEffect){var a=this; this.element.show(this.options.showEffect,this.options.effectOptions,this.options.effectSpeed,function(){a._postShow() }) }else{this.element.show(); this._postShow() }this._moveToTop(); if(this.options.modal){this._enableModality() }},_postShow:function(){this._trigger("afterShow",null); this.element.attr({"aria-hidden":false,"aria-live":"polite"}); this._applyFocus(); if(this.options.responsive){this._bindResizeListener() }},hide:function(){if(this.element.is(":hidden")){return }this._trigger("beforeHide",null); if(this.options.hideEffect){var a=this; this.element.hide(this.options.hideEffect,this.options.effectOptions,this.options.effectSpeed,function(){a._postHide() }) }else{this.element.hide(); this._postHide() }if(this.options.modal){this._disableModality() }},_postHide:function(){this._trigger("afterHide",null); this.element.attr({"aria-hidden":true,"aria-live":"off"}); if(this.options.responsive){this._unbindResizeListener() }},_applyFocus:function(){this.element.find(":not(:submit):not(:button):input:visible:enabled:first").focus() },_bindEvents:function(){var a=this; this.element.mousedown(function(b){if(!$(b.target).data("ui-widget-overlay")){a._moveToTop() }}); this.icons.mouseover(function(){$(this).addClass("ui-state-hover") }).mouseout(function(){$(this).removeClass("ui-state-hover") }); this.closeIcon.on("click.puidialog",function(b){a.hide(); b.preventDefault() }); this.maximizeIcon.click(function(b){a.toggleMaximize(); b.preventDefault() }); this.minimizeIcon.click(function(b){a.toggleMinimize(); b.preventDefault() }); if(this.options.closeOnEscape){$(document).on("keydown.dialog_"+this.element.attr("id"),function(d){var c=$.ui.keyCode,b=parseInt(a.element.css("z-index"),10)===PUI.zindex; if(d.which===c.ESCAPE&&a.element.is(":visible")&&b){a.hide() }}) }},_setupDraggable:function(){this.element.draggable({cancel:".pui-dialog-content, .pui-dialog-titlebar-close",handle:".pui-dialog-titlebar",containment:"document"}) },_setupResizable:function(){var a=this; this.element.resizable({minWidth:this.options.minWidth,minHeight:this.options.minHeight,alsoResize:this.content,containment:"document",start:function(b,c){a.element.data("offset",a.element.offset()) },stop:function(b,c){var d=a.element.data("offset"); a.element.css("position","fixed"); a.element.offset(d) }}); this.resizers=this.element.children(".ui-resizable-handle") },_initPosition:function(){this.element.css({left:0,top:0}); if(/(center|left|top|right|bottom)/.test(this.options.location)){this.options.location=this.options.location.replace(","," "); this.element.position({my:"center",at:this.options.location,collision:"fit",of:window,using:function(f){var d=f.left<0?0:f.left,e=f.top<0?0:f.top; $(this).css({left:d,top:e}) }}) }else{var b=this.options.position.split(","),a=$.trim(b[0]),c=$.trim(b[1]); this.element.offset({left:a,top:c}) }this.positionInitialized=true },_moveToTop:function(){this.element.css("z-index",++PUI.zindex) },toggleMaximize:function(){if(this.minimized){this.toggleMinimize() }if(this.maximized){this.element.removeClass("pui-dialog-maximized"); this._restoreState(); this.maximizeIcon.removeClass("ui-state-hover"); this.maximized=false }else{this._saveState(); var a=$(window); this.element.addClass("pui-dialog-maximized").css({width:a.width()-6,height:a.height()}).offset({top:a.scrollTop(),left:a.scrollLeft()}); this.content.css({width:"auto",height:"auto"}); this.maximizeIcon.removeClass("ui-state-hover"); this.maximized=true; this._trigger("maximize") }},toggleMinimize:function(){var a=true,c=$(document.body).children(".pui-dialog-docking-zone"); if(this.maximized){this.toggleMaximize(); a=false }var b=this; if(this.minimized){this.element.appendTo(this.parent).removeClass("pui-dialog-minimized").css({position:"fixed","float":"none"}); this._restoreState(); this.content.show(); this.minimizeIcon.removeClass("ui-state-hover"); this.minimized=false; if(this.options.resizable){this.resizers.show() }if(this.footer){this.footer.show() }}else{this._saveState(); if(a){this.element.effect("transfer",{to:c,className:"pui-dialog-minimizing"},500,function(){b._dock(c); b.element.addClass("pui-dialog-minimized") }) }else{this._dock(c) }}},_dock:function(a){this.element.appendTo(a).css("position","static"); this.element.css({height:"auto",width:"auto","float":"left"}); this.content.hide(); this.minimizeIcon.removeClass("ui-state-hover").children(".ui-icon").removeClass("ui-icon-minus").addClass("ui-icon-plus"); this.minimized=true; if(this.options.resizable){this.resizers.hide() }if(this.footer){this.footer.hide() }a.css("z-index",++PUI.zindex); this._trigger("minimize") },_saveState:function(){this.state={width:this.element.width(),height:this.element.height()}; var a=$(window); this.state.offset=this.element.offset(); this.state.windowScrollLeft=a.scrollLeft(); this.state.windowScrollTop=a.scrollTop() },_restoreState:function(){this.element.width(this.state.width).height(this.state.height); var a=$(window); this.element.offset({top:this.state.offset.top+(a.scrollTop()-this.state.windowScrollTop),left:this.state.offset.left+(a.scrollLeft()-this.state.windowScrollLeft)}) },_applyARIA:function(){this.element.attr({role:"dialog","aria-labelledby":this.element.attr("id")+"_title","aria-hidden":!this.options.visible}); this.titlebar.children("a.pui-dialog-titlebar-icon").attr("role","button") },_bindResizeListener:function(){var a=this; $(window).on(this.resizeNS,function(b){if(b.target===window){a._initPosition() }}) },_unbindResizeListener:function(){$(window).off(this.resizeNS) }}) })();(function(){$.widget("primeui.puidropdown",{options:{effect:"fade",effectSpeed:"normal",filter:false,filterMatchMode:"startsWith",caseSensitiveFilter:false,filterFunction:null,data:null,content:null,scrollHeight:200,appendTo:"body"},_create:function(){if(this.options.data){for(var c=0; c<this.options.data.length; c++){var a=this.options.data[c]; if(a.label){this.element.append('<option value="'+a.value+'">'+a.label+"</option>") }else{this.element.append('<option value="'+a+'">'+a+"</option>") }}}this.element.wrap('<div class="pui-dropdown ui-widget ui-state-default ui-corner-all ui-helper-clearfix" />').wrap('<div class="ui-helper-hidden-accessible" />'); this.container=this.element.closest(".pui-dropdown"); this.focusElementContainer=$('<div class="ui-helper-hidden-accessible"><input type="text" /></div>').appendTo(this.container); this.focusElement=this.focusElementContainer.children("input"); this.label=this.options.editable?$('<input type="text" class="pui-dropdown-label pui-inputtext ui-corner-all"">'):$('<label class="pui-dropdown-label pui-inputtext ui-corner-all"/>'); this.label.appendTo(this.container); this.menuIcon=$('<div class="pui-dropdown-trigger ui-state-default ui-corner-right"><span class="pui-icon fa fa-fw fa-caret-down"></span></div>').appendTo(this.container); this.panel=$('<div class="pui-dropdown-panel ui-widget-content ui-corner-all ui-helper-hidden pui-shadow" />'); if(this.options.appendTo==="self"){this.panel.appendTo(this.container) }else{this.panel.appendTo(this.options.appendTo) }this.itemsWrapper=$('<div class="pui-dropdown-items-wrapper" />').appendTo(this.panel); this.itemsContainer=$('<ul class="pui-dropdown-items pui-dropdown-list ui-widget-content ui-widget ui-corner-all ui-helper-reset"></ul>').appendTo(this.itemsWrapper); this.disabled=this.element.prop("disabled"); this.choices=this.element.children("option"); this.optGroupsSize=this.itemsContainer.children("li.puiselectonemenu-item-group").length; if(this.options.filter){this.filterContainer=$('<div class="pui-dropdown-filter-container" />').prependTo(this.panel); this.filterInput=$('<input type="text" autocomplete="off" class="pui-dropdown-filter pui-inputtext ui-widget ui-state-default ui-corner-all" />').appendTo(this.filterContainer); this.filterContainer.append('<span class="pui-icon fa fa-search"></span>') }this._generateItems(); if(this.options.scrollHeight&&this.panel.outerHeight()>this.options.scrollHeight){this.itemsWrapper.height(this.options.scrollHeight) }var e=this,d=this.choices.filter(":selected"); this.choices.filter(":disabled").each(function(){e.items.eq($(this).index()).addClass("ui-state-disabled") }); this.triggers=this.options.editable?this.menuIcon:this.container.children(".pui-dropdown-trigger, .pui-dropdown-label"); if(this.options.editable){var b=this.label.val(); if(b===d.text()){this._highlightItem(this.items.eq(d.index())) }else{this.items.eq(0).addClass("ui-state-highlight"); this.customInput=true; this.customInputVal=b }}else{this._highlightItem(this.items.eq(d.index())) }if(!this.disabled){this._bindEvents(); this._bindConstantEvents() }},_generateItems:function(){for(var a=0; a<this.choices.length; a++){var b=this.choices.eq(a),d=b.text(),c=this.options.content?this.options.content.call(this,this.options.data[a]):d; this.itemsContainer.append('<li data-label="'+d+'" class="pui-dropdown-item pui-dropdown-list-item ui-corner-all">'+c+"</li>") }this.items=this.itemsContainer.children(".pui-dropdown-item") },_bindEvents:function(){var a=this; this.items.filter(":not(.ui-state-disabled)").each(function(b,c){a._bindItemEvents($(c)) }); this.triggers.on("mouseenter.puidropdown",function(){if(!a.container.hasClass("ui-state-focus")){a.container.addClass("ui-state-hover"); a.menuIcon.addClass("ui-state-hover") }}).on("mouseleave.puidropdown",function(){a.container.removeClass("ui-state-hover"); a.menuIcon.removeClass("ui-state-hover") }).on("click.puidropdown",function(b){if(a.panel.is(":hidden")){a._show() }else{a._hide(); a._revert() }a.container.removeClass("ui-state-hover"); a.menuIcon.removeClass("ui-state-hover"); a.focusElement.trigger("focus.puidropdown"); b.preventDefault() }); this.focusElement.on("focus.puidropdown",function(){a.container.addClass("ui-state-focus"); a.menuIcon.addClass("ui-state-focus") }).on("blur.puidropdown",function(){a.container.removeClass("ui-state-focus"); a.menuIcon.removeClass("ui-state-focus") }); if(this.options.editable){this.label.on("change.pui-dropdown",function(){a._triggerChange(true); a.customInput=true; a.customInputVal=$(this).val(); a.items.filter(".ui-state-highlight").removeClass("ui-state-highlight"); a.items.eq(0).addClass("ui-state-highlight") }) }this._bindKeyEvents(); if(this.options.filter){this._setupFilterMatcher(); this.filterInput.puiinputtext(); this.filterInput.on("keyup.pui-dropdown",function(){a._filter($(this).val()) }) }},_bindItemEvents:function(a){var b=this; a.on("mouseover.puidropdown",function(){var c=$(this); if(!c.hasClass("ui-state-highlight")){$(this).addClass("ui-state-hover") }}).on("mouseout.puidropdown",function(){$(this).removeClass("ui-state-hover") }).on("click.puidropdown",function(){b._selectItem($(this)) }) },_bindConstantEvents:function(){var a=this; $(document.body).bind("mousedown.pui-dropdown",function(b){if(a.panel.is(":hidden")){return }var c=a.panel.offset(); if(b.target===a.label.get(0)||b.target===a.menuIcon.get(0)||b.target===a.menuIcon.children().get(0)){return }if(b.pageX<c.left||b.pageX>c.left+a.panel.width()||b.pageY<c.top||b.pageY>c.top+a.panel.height()){a._hide(); a._revert() }}); this.resizeNS="resize."+this.id; this._unbindResize(); this._bindResize() },_bindKeyEvents:function(){var a=this; this.focusElement.on("keydown.puiselectonemenu",function(h){var l=$.ui.keyCode,j=h.which,d; switch(j){case l.UP:case l.LEFT:d=a._getActiveItem(); var b=d.prevAll(":not(.ui-state-disabled,.ui-selectonemenu-item-group):first"); if(b.length==1){if(a.panel.is(":hidden")){a._selectItem(b) }else{a._highlightItem(b); PUI.scrollInView(a.itemsWrapper,b) }}h.preventDefault(); break; case l.DOWN:case l.RIGHT:d=a._getActiveItem(); var f=d.nextAll(":not(.ui-state-disabled,.ui-selectonemenu-item-group):first"); if(f.length==1){if(a.panel.is(":hidden")){if(h.altKey){a._show() }else{a._selectItem(f) }}else{a._highlightItem(f); PUI.scrollInView(a.itemsWrapper,f) }}h.preventDefault(); break; case l.ENTER:case l.NUMPAD_ENTER:if(a.panel.is(":hidden")){a._show() }else{a._selectItem(a._getActiveItem()) }h.preventDefault(); break; case l.TAB:if(a.panel.is(":visible")){a._revert(); a._hide() }break; case l.ESCAPE:if(a.panel.is(":visible")){a._revert(); a._hide() }break; default:var c=String.fromCharCode((96<=j&&j<=105)?j-48:j),i=a.items.filter(".ui-state-highlight"); var g=a._search(c,i.index()+1,a.options.length); if(!g){g=a._search(c,0,i.index()) }if(g){if(a.panel.is(":hidden")){a._selectItem(g) }else{a._highlightItem(g); PUI.scrollInView(a.itemsWrapper,g) }}break }}) },_selectItem:function(f,b){var e=this.choices.eq(this._resolveItemIndex(f)),d=this.choices.filter(":selected"),a=e.val()==d.val(),c=null; if(this.options.editable){c=(!a)||(e.text()!=this.label.val()) }else{c=!a }if(c){this._highlightItem(f); this.element.val(e.val()); this._triggerChange(); if(this.options.editable){this.customInput=false }}if(!b){this.focusElement.trigger("focus.puidropdown") }if(this.panel.is(":visible")){this._hide() }},_highlightItem:function(a){this.items.filter(".ui-state-highlight").removeClass("ui-state-highlight"); a.addClass("ui-state-highlight"); this._setLabel(a.data("label")) },_triggerChange:function(a){this.changed=false; if(this.options.change){this._trigger("change") }if(!a){this.value=this.choices.filter(":selected").val() }},_resolveItemIndex:function(a){if(this.optGroupsSize===0){return a.index() }else{return a.index()-a.prevAll("li.pui-dropdown-item-group").length }},_setLabel:function(a){if(this.options.editable){this.label.val(a) }else{if(a==="&nbsp;"){this.label.html("&nbsp;") }else{this.label.text(a) }}},_bindResize:function(){var a=this; $(window).bind(this.resizeNS,function(b){if(a.panel.is(":visible")){a._alignPanel() }}) },_unbindResize:function(){$(window).unbind(this.resizeNS) },_unbindEvents:function(){this.items.off(); this.triggers.off(); this.label.off() },_alignPanelWidth:function(){if(!this.panelWidthAdjusted){var a=this.container.outerWidth(); if(this.panel.outerWidth()<a){this.panel.width(a) }this.panelWidthAdjusted=true }},_alignPanel:function(){if(this.panel.parent().is(this.container)){this.panel.css({left:"0px",top:this.container.outerHeight()+"px"}).width(this.container.outerWidth()) }else{this._alignPanelWidth(); this.panel.css({left:"",top:""}).position({my:"left top",at:"left bottom",of:this.container,collision:"flipfit"}) }},_show:function(){this._alignPanel(); this.panel.css("z-index",++PUI.zindex); if(this.options.effect!=="none"){this.panel.show(this.options.effect,{},this.options.effectSpeed) }else{this.panel.show() }this.preShowValue=this.choices.filter(":selected") },_hide:function(){this.panel.hide() },_revert:function(){if(this.options.editable&&this.customInput){this._setLabel(this.customInputVal); this.items.filter(".ui-state-active").removeClass("ui-state-active"); this.items.eq(0).addClass("ui-state-active") }else{this._highlightItem(this.items.eq(this.preShowValue.index())) }},_getActiveItem:function(){return this.items.filter(".ui-state-highlight") },_setupFilterMatcher:function(){this.filterMatchers={startsWith:this._startsWithFilter,contains:this._containsFilter,endsWith:this._endsWithFilter,custom:this.options.filterFunction}; this.filterMatcher=this.filterMatchers[this.options.filterMatchMode] },_startsWithFilter:function(b,a){return b.indexOf(a)===0 },_containsFilter:function(b,a){return b.indexOf(a)!==-1 },_endsWithFilter:function(b,a){return b.indexOf(a,b.length-a.length)!==-1 },_filter:function(e){this.initialHeight=this.initialHeight||this.itemsWrapper.height(); var f=this.options.caseSensitiveFilter?$.trim(e):$.trim(e).toLowerCase(); if(f===""){this.items.filter(":hidden").show() }else{for(var a=0; a<this.choices.length; a++){var c=this.choices.eq(a),b=this.options.caseSensitiveFilter?c.text():c.text().toLowerCase(),d=this.items.eq(a); if(this.filterMatcher(b,f)){d.show() }else{d.hide() }}}if(this.itemsContainer.height()<this.initialHeight){this.itemsWrapper.css("height","auto") }else{this.itemsWrapper.height(this.initialHeight) }},_search:function(d,e,a){for(var b=e; b<a; b++){var c=this.choices.eq(b); if(c.text().indexOf(d)===0){return this.items.eq(b) }}return null },getSelectedValue:function(){return this.element.val() },getSelectedLabel:function(){return this.choices.filter(":selected").text() },selectValue:function(b){var a=this.choices.filter('[value="'+b+'"]'); this._selectItem(this.items.eq(a.index()),true) },addOption:function(b,d){var c=$('<li data-label="'+b+'" class="pui-dropdown-item pui-dropdown-list-item ui-corner-all">'+b+"</li>"),a=$('<option value="'+d+'">'+b+"</option>"); a.appendTo(this.element); this._bindItemEvents(c); c.appendTo(this.itemsContainer); this.items.push(c[0]); this.choices=this.element.children("option"); if(this.items.length===1){this.selectValue(d); this._highlightItem(c) }},removeAllOptions:function(){this.element.empty(); this.itemsContainer.empty(); this.items.length=0; this.choices.length=0; this.element.val(""); this.label.text("") },_setOption:function(c,d){$.Widget.prototype._setOption.apply(this,arguments); if(c==="data"){this.removeAllOptions(); for(var b=0; b<this.options.data.length; b++){var a=this.options.data[b]; if(a.label){this.addOption(a.label,a.value) }else{this.addOption(a,a) }}if(this.options.scrollHeight&&this.panel.outerHeight()>this.options.scrollHeight){this.itemsWrapper.height(this.options.scrollHeight) }}},disable:function(){this._unbindEvents(); this.label.addClass("ui-state-disabled"); this.menuIcon.addClass("ui-state-disabled") },enable:function(){this._bindEvents(); this.label.removeClass("ui-state-disabled"); this.menuIcon.removeClass("ui-state-disabled") }}) })();(function(){$.widget("primeui.puifieldset",{options:{toggleable:false,toggleDuration:"normal",collapsed:false},_create:function(){this.element.addClass("pui-fieldset ui-widget ui-widget-content ui-corner-all").children("legend").addClass("pui-fieldset-legend ui-corner-all ui-state-default"); this.element.contents().wrapAll('<div class="pui-fieldset-content" />'); this.content=this.element.children("div.pui-fieldset-content"); this.legend=this.content.children("legend.pui-fieldset-legend"); this.legend.prependTo(this.element); if(this.options.toggleable){this.element.addClass("pui-fieldset-toggleable"); this.toggler=$('<span class="pui-fieldset-toggler fa fa-fw" />').prependTo(this.legend); this._bindEvents(); if(this.options.collapsed){this.content.hide(); this.toggler.addClass("fa-plus") }else{this.toggler.addClass("fa-minus") }}},_bindEvents:function(){var a=this; this.legend.on("click.puifieldset",function(b){a.toggle(b) }).on("mouseover.puifieldset",function(){a.legend.addClass("ui-state-hover") }).on("mouseout.puifieldset",function(){a.legend.removeClass("ui-state-hover ui-state-active") }).on("mousedown.puifieldset",function(){a.legend.removeClass("ui-state-hover").addClass("ui-state-active") }).on("mouseup.puifieldset",function(){a.legend.removeClass("ui-state-active").addClass("ui-state-hover") }) },toggle:function(b){var a=this; this._trigger("beforeToggle",b); if(this.options.collapsed){this.toggler.removeClass("fa-plus").addClass("fa-minus") }else{this.toggler.removeClass("fa-minus").addClass("fa-plus") }this.content.slideToggle(this.options.toggleSpeed,"easeInOutCirc",function(){a._trigger("afterToggle",b); a.options.collapsed=!a.options.collapsed }) }}) })();(function(){$.widget("primeui.puigalleria",{options:{panelWidth:600,panelHeight:400,frameWidth:60,frameHeight:40,activeIndex:0,showFilmstrip:true,autoPlay:true,transitionInterval:4000,effect:"fade",effectSpeed:250,effectOptions:{},showCaption:true,customContent:false},_create:function(){this.element.addClass("pui-galleria ui-widget ui-widget-content ui-corner-all"); this.panelWrapper=this.element.children("ul"); this.panelWrapper.addClass("pui-galleria-panel-wrapper"); this.panels=this.panelWrapper.children("li"); this.panels.addClass("pui-galleria-panel ui-helper-hidden"); this.element.width(this.options.panelWidth); this.panelWrapper.width(this.options.panelWidth).height(this.options.panelHeight); this.panels.width(this.options.panelWidth).height(this.options.panelHeight); if(this.options.showFilmstrip){this._renderStrip(); this._bindEvents() }if(this.options.customContent){this.panels.children("img").remove(); this.panels.children("div").addClass("pui-galleria-panel-content") }var a=this.panels.eq(this.options.activeIndex); a.removeClass("ui-helper-hidden"); if(this.options.showCaption){this._showCaption(a) }this.element.css("visibility","visible"); if(this.options.autoPlay){this.startSlideshow() }},_renderStrip:function(){var a='style="width:'+this.options.frameWidth+"px;height:"+this.options.frameHeight+'px;"'; this.stripWrapper=$('<div class="pui-galleria-filmstrip-wrapper"></div>').width(this.element.width()-50).height(this.options.frameHeight).appendTo(this.element); this.strip=$('<ul class="pui-galleria-filmstrip"></div>').appendTo(this.stripWrapper); for(var c=0; c<this.panels.length; c++){var e=this.panels.eq(c).children("img"),b=(c==this.options.activeIndex)?"pui-galleria-frame pui-galleria-frame-active":"pui-galleria-frame",d='<li class="'+b+'" '+a+'><div class="pui-galleria-frame-content" '+a+'><img src="'+e.attr("src")+'" class="pui-galleria-frame-image" '+a+"/></div></li>"; this.strip.append(d) }this.frames=this.strip.children("li.pui-galleria-frame"); this.element.append('<div class="pui-galleria-nav-prev fa fa-fw fa-chevron-circle-left" style="bottom:'+(this.options.frameHeight/2)+'px"></div><div class="pui-galleria-nav-next fa fa-fw fa-chevron-circle-right" style="bottom:'+(this.options.frameHeight/2)+'px"></div>'); if(this.options.showCaption){this.caption=$('<div class="pui-galleria-caption"></div>').css({bottom:this.stripWrapper.outerHeight()+10,width:this.panelWrapper.width()}).appendTo(this.element) }},_bindEvents:function(){var a=this; this.element.children("div.pui-galleria-nav-prev").on("click.puigalleria",function(){if(a.slideshowActive){a.stopSlideshow() }if(!a.isAnimating()){a.prev() }}); this.element.children("div.pui-galleria-nav-next").on("click.puigalleria",function(){if(a.slideshowActive){a.stopSlideshow() }if(!a.isAnimating()){a.next() }}); this.strip.children("li.pui-galleria-frame").on("click.puigalleria",function(){if(a.slideshowActive){a.stopSlideshow() }a.select($(this).index(),false) }) },startSlideshow:function(){var a=this; this.interval=window.setInterval(function(){a.next() },this.options.transitionInterval); this.slideshowActive=true },stopSlideshow:function(){window.clearInterval(this.interval); this.slideshowActive=false },isSlideshowActive:function(){return this.slideshowActive },select:function(g,j){if(g!==this.options.activeIndex){if(this.options.showCaption){this._hideCaption() }var a=this.panels.eq(this.options.activeIndex),b=this.panels.eq(g); a.hide(this.options.effect,this.options.effectOptions,this.options.effectSpeed); b.show(this.options.effect,this.options.effectOptions,this.options.effectSpeed); if(this.options.showFilmstrip){var c=this.frames.eq(this.options.activeIndex),e=this.frames.eq(g); c.removeClass("pui-galleria-frame-active").css("opacity",""); e.animate({opacity:1},this.options.effectSpeed,null,function(){$(this).addClass("pui-galleria-frame-active") }); if((j===undefined||j===true)){var h=e.position().left,k=this.options.frameWidth+parseInt(e.css("margin-right"),10),i=this.strip.position().left,d=h+i,f=d+this.options.frameWidth; if(f>this.stripWrapper.width()){this.strip.animate({left:"-="+k},this.options.effectSpeed,"easeInOutCirc") }else{if(d<0){this.strip.animate({left:"+="+k},this.options.effectSpeed,"easeInOutCirc") }}}}if(this.options.showCaption){this._showCaption(b) }this.options.activeIndex=g }},_hideCaption:function(){this.caption.slideUp(this.options.effectSpeed) },_showCaption:function(a){var b=a.children("img"); this.caption.html("<h4>"+b.attr("title")+"</h4><p>"+b.attr("alt")+"</p>").slideDown(this.options.effectSpeed) },prev:function(){if(this.options.activeIndex!==0){this.select(this.options.activeIndex-1) }},next:function(){if(this.options.activeIndex!==(this.panels.length-1)){this.select(this.options.activeIndex+1) }else{this.select(0,false); this.strip.animate({left:0},this.options.effectSpeed,"easeInOutCirc") }},isAnimating:function(){return this.strip.is(":animated") }}) })();(function(){$.widget("primeui.puigrowl",{options:{sticky:false,life:3000},_create:function(){var a=this.element; a.addClass("pui-growl ui-widget").appendTo(document.body) },show:function(a){var b=this; this.clear(); $.each(a,function(c,d){b._renderMessage(d) }) },clear:function(){this.element.children("div.pui-growl-item-container").remove() },_renderMessage:function(c){var a='<div class="pui-growl-item-container ui-state-highlight ui-corner-all ui-helper-hidden" aria-live="polite">'; a+='<div class="pui-growl-item pui-shadow">'; a+='<div class="pui-growl-icon-close fa fa-close" style="display:none"></div>'; a+='<span class="pui-growl-image fa fa-info-circle fa-2x" />'; a+='<div class="pui-growl-message">'; a+='<span class="pui-growl-title">'+c.summary+"</span>"; a+="<p>"+(c.detail||"")+"</p>"; a+='</div><div style="clear: both;"></div></div></div>'; var b=$(a); this._bindMessageEvents(b); b.appendTo(this.element).fadeIn() },_removeMessage:function(a){a.fadeTo("normal",0,function(){a.slideUp("normal","easeInOutCirc",function(){a.remove() }) }) },_bindMessageEvents:function(a){var c=this,b=this.options.sticky; a.on("mouseover.puigrowl",function(){var d=$(this); if(!d.is(":animated")){d.find("div.pui-growl-icon-close:first").show() }}).on("mouseout.puigrowl",function(){$(this).find("div.pui-growl-icon-close:first").hide() }); a.find("div.pui-growl-icon-close").on("click.puigrowl",function(){c._removeMessage(a); if(!b){window.clearTimeout(a.data("timeout")) }}); if(!b){this._setRemovalTimeout(a) }},_setRemovalTimeout:function(a){var c=this; var b=window.setTimeout(function(){c._removeMessage(a) },this.options.life); a.data("timeout",b) }}) })();(function(){$.widget("primeui.puiinputtext",{_create:function(){var a=this.element,b=a.prop("disabled"); a.addClass("pui-inputtext ui-widget ui-state-default ui-corner-all"); if(b){a.addClass("ui-state-disabled") }else{this._enableMouseEffects() }a.attr("role","textbox").attr("aria-disabled",b).attr("aria-readonly",a.prop("readonly")).attr("aria-multiline",a.is("textarea")) },_destroy:function(){},_enableMouseEffects:function(){var a=this.element; a.hover(function(){a.toggleClass("ui-state-hover") }).focus(function(){a.addClass("ui-state-focus") }).blur(function(){a.removeClass("ui-state-focus") }) },_disableMouseEffects:function(){var a=this.element; a.off("mouseenter mouseleave focus blur") },disable:function(){this.element.prop("disabled",true); this.element.attr("aria-disabled",true); this.element.addClass("ui-state-disabled"); this.element.removeClass("ui-state-focus ui-state-hover"); this._disableMouseEffects() },enable:function(){this.element.prop("disabled",false); this.element.attr("aria-disabled",false); this.element.removeClass("ui-state-disabled"); this._enableMouseEffects() }}) })();(function(){$.widget("primeui.puiinputtextarea",{options:{autoResize:false,autoComplete:false,maxlength:null,counter:null,counterTemplate:"{0}",minQueryLength:3,queryDelay:700},_create:function(){var a=this; this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.puiinputtext(); if(this.options.autoResize){this.options.rowsDefault=this.element.attr("rows"); this.options.colsDefault=this.element.attr("cols"); this.element.addClass("pui-inputtextarea-resizable"); this.element.keyup(function(){a._resize() }).focus(function(){a._resize() }).blur(function(){a._resize() }) }if(this.options.maxlength){this.element.keyup(function(d){var c=a.element.val(),b=c.length; if(b>a.options.maxlength){a.element.val(c.substr(0,a.options.maxlength)) }if(a.options.counter){a._updateCounter() }}) }if(this.options.counter){this._updateCounter() }if(this.options.autoComplete){this._initAutoComplete() }},_updateCounter:function(){var d=this.element.val(),c=d.length; if(this.options.counter){var b=this.options.maxlength-c,a=this.options.counterTemplate.replace("{0}",b); this.options.counter.text(a) }},_resize:function(){var d=0,a=this.element.val().split("\n"); for(var b=a.length-1; b>=0; --b){d+=Math.floor((a[b].length/this.options.colsDefault)+1) }var c=(d>=this.options.rowsDefault)?(d+1):this.options.rowsDefault; this.element.attr("rows",c) },_initAutoComplete:function(){var b='<div id="'+this.id+'_panel" class="pui-autocomplete-panel ui-widget-content ui-corner-all ui-helper-hidden pui-shadow"></div>',c=this; this.panel=$(b).appendTo(document.body); this.element.keyup(function(g){var f=$.ui.keyCode; switch(g.which){case f.UP:case f.LEFT:case f.DOWN:case f.RIGHT:case f.ENTER:case f.NUMPAD_ENTER:case f.TAB:case f.SPACE:case f.CONTROL:case f.ALT:case f.ESCAPE:case 224:break; default:var d=c._extractQuery(); if(d&&d.length>=c.options.minQueryLength){if(c.timeout){c._clearTimeout(c.timeout) }c.timeout=window.setTimeout(function(){c.search(d) },c.options.queryDelay) }break }}).keydown(function(j){var d=c.panel.is(":visible"),i=$.ui.keyCode,h; switch(j.which){case i.UP:case i.LEFT:if(d){h=c.items.filter(".ui-state-highlight"); var g=h.length===0?c.items.eq(0):h.prev(); if(g.length==1){h.removeClass("ui-state-highlight"); g.addClass("ui-state-highlight"); if(c.options.scrollHeight){PUI.scrollInView(c.panel,g) }}j.preventDefault() }else{c._clearTimeout() }break; case i.DOWN:case i.RIGHT:if(d){h=c.items.filter(".ui-state-highlight"); var f=h.length===0?_self.items.eq(0):h.next(); if(f.length==1){h.removeClass("ui-state-highlight"); f.addClass("ui-state-highlight"); if(c.options.scrollHeight){PUI.scrollInView(c.panel,f) }}j.preventDefault() }else{c._clearTimeout() }break; case i.ENTER:case i.NUMPAD_ENTER:if(d){c.items.filter(".ui-state-highlight").trigger("click"); j.preventDefault() }else{c._clearTimeout() }break; case i.SPACE:case i.CONTROL:case i.ALT:case i.BACKSPACE:case i.ESCAPE:case 224:c._clearTimeout(); if(d){c._hide() }break; case i.TAB:c._clearTimeout(); if(d){c.items.filter(".ui-state-highlight").trigger("click"); c._hide() }break }}); $(document.body).bind("mousedown.puiinputtextarea",function(d){if(c.panel.is(":hidden")){return }var f=c.panel.offset(); if(d.target===c.element.get(0)){return }if(d.pageX<f.left||d.pageX>f.left+c.panel.width()||d.pageY<f.top||d.pageY>f.top+c.panel.height()){c._hide() }}); var a="resize."+this.id; $(window).unbind(a).bind(a,function(){if(c.panel.is(":visible")){c._hide() }}) },_bindDynamicEvents:function(){var a=this; this.items.bind("mouseover",function(){var b=$(this); if(!b.hasClass("ui-state-highlight")){a.items.filter(".ui-state-highlight").removeClass("ui-state-highlight"); b.addClass("ui-state-highlight") }}).bind("click",function(d){var c=$(this),e=c.attr("data-item-value"),b=e.substring(a.query.length); a.element.focus(); a.element.insertText(b,a.element.getSelection().start,true); a._hide(); a._trigger("itemselect",d,c) }) },_clearTimeout:function(){if(this.timeout){window.clearTimeout(this.timeout) }this.timeout=null },_extractQuery:function(){var b=this.element.getSelection().end,a=/\S+$/.exec(this.element.get(0).value.slice(0,b)),c=a?a[0]:null; return c },search:function(b){this.query=b; var a={query:b}; if(this.options.completeSource){this.options.completeSource.call(this,a,this._handleResponse) }},_handleResponse:function(c){this.panel.html(""); var d=$('<ul class="pui-autocomplete-items pui-autocomplete-list ui-widget-content ui-widget ui-corner-all ui-helper-reset"></ul>'); for(var a=0; a<c.length; a++){var b=$('<li class="pui-autocomplete-item pui-autocomplete-list-item ui-corner-all"></li>'); b.attr("data-item-value",c[a].value); b.text(c[a].label); d.append(b) }this.panel.append(d); this.items=this.panel.find(".pui-autocomplete-item"); this._bindDynamicEvents(); if(this.items.length>0){this.items.eq(0).addClass("ui-state-highlight"); if(this.options.scrollHeight&&this.panel.height()>this.options.scrollHeight){this.panel.height(this.options.scrollHeight) }if(this.panel.is(":hidden")){this._show() }else{this._alignPanel() }}else{this.panel.hide() }},_alignPanel:function(){var b=this.element.getCaretPosition(),a=this.element.offset(); this.panel.css({left:a.left+b.left,top:a.top+b.top,width:this.element.innerWidth()}) },_show:function(){this._alignPanel(); this.panel.show() },_hide:function(){this.panel.hide() },disable:function(){this.element.puiinputtext("disable") },enable:function(){this.element.puiinputtext("enable") }}) })();(function(){$.widget("primeui.puilightbox",{options:{iframeWidth:640,iframeHeight:480,iframe:false},_create:function(){this.options.mode=this.options.iframe?"iframe":(this.element.children("div").length==1)?"inline":"image"; var a='<div class="pui-lightbox ui-widget ui-helper-hidden ui-corner-all pui-shadow">'; a+='<div class="pui-lightbox-content-wrapper">'; a+='<a class="ui-state-default pui-lightbox-nav-left ui-corner-right ui-helper-hidden"><span class="fa fa-fw fa-caret-left"></span></a>'; a+='<div class="pui-lightbox-content ui-corner-all"></div>'; a+='<a class="ui-state-default pui-lightbox-nav-right ui-corner-left ui-helper-hidden"><span class="fa fa-fw fa-caret-right"></span></a>'; a+="</div>"; a+='<div class="pui-lightbox-caption ui-widget-header"><span class="pui-lightbox-caption-text"></span>'; a+='<a class="pui-lightbox-close ui-corner-all" href="#"><span class="fa fa-fw fa-close"></span></a><div style="clear:both" /></div>'; a+="</div>"; this.panel=$(a).appendTo(document.body); this.contentWrapper=this.panel.children(".pui-lightbox-content-wrapper"); this.content=this.contentWrapper.children(".pui-lightbox-content"); this.caption=this.panel.children(".pui-lightbox-caption"); this.captionText=this.caption.children(".pui-lightbox-caption-text"); this.closeIcon=this.caption.children(".pui-lightbox-close"); if(this.options.mode==="image"){this._setupImaging() }else{if(this.options.mode==="inline"){this._setupInline() }else{if(this.options.mode==="iframe"){this._setupIframe() }}}this._bindCommonEvents(); this.links.data("puilightbox-trigger",true).find("*").data("puilightbox-trigger",true); this.closeIcon.data("puilightbox-trigger",true).find("*").data("puilightbox-trigger",true) },_bindCommonEvents:function(){var a=this; this.closeIcon.hover(function(){$(this).toggleClass("ui-state-hover") }).click(function(b){a.hide(); b.preventDefault() }); $(document.body).bind("click.pui-lightbox",function(c){if(a.isHidden()){return }var b=$(c.target); if(b.data("puilightbox-trigger")){return }var d=a.panel.offset(); if(c.pageX<d.left||c.pageX>d.left+a.panel.width()||c.pageY<d.top||c.pageY>d.top+a.panel.height()){a.hide() }}); $(window).resize(function(){if(!a.isHidden()){$(document.body).children(".ui-widget-overlay").css({width:$(document).width(),height:$(document).height()}) }}) },_setupImaging:function(){var a=this; this.links=this.element.children("a"); this.content.append('<img class="ui-helper-hidden"></img>'); this.imageDisplay=this.content.children("img"); this.navigators=this.contentWrapper.children("a"); this.imageDisplay.load(function(){var d=$(this); a._scaleImage(d); var c=(a.panel.width()-d.width())/2,b=(a.panel.height()-d.height())/2; a.content.removeClass("pui-lightbox-loading").animate({width:d.width(),height:d.height()},500,function(){d.fadeIn(); a._showNavigators(); a.caption.slideDown() }); a.panel.animate({left:"+="+c,top:"+="+b},500) }); this.navigators.hover(function(){$(this).toggleClass("ui-state-hover") }).click(function(c){var d=$(this),b; a._hideNavigators(); if(d.hasClass("pui-lightbox-nav-left")){b=a.current===0?a.links.length-1:a.current-1; a.links.eq(b).trigger("click") }else{b=a.current==a.links.length-1?0:a.current+1; a.links.eq(b).trigger("click") }c.preventDefault() }); this.links.click(function(c){var b=$(this); if(a.isHidden()){a.content.addClass("pui-lightbox-loading").width(32).height(32); a.show() }else{a.imageDisplay.fadeOut(function(){$(this).css({width:"auto",height:"auto"}); a.content.addClass("pui-lightbox-loading") }); a.caption.slideUp() }window.setTimeout(function(){a.imageDisplay.attr("src",b.attr("href")); a.current=b.index(); var d=b.attr("title"); if(d){a.captionText.html(d) }},1000); c.preventDefault() }) },_scaleImage:function(g){var f=$(window),c=f.width(),b=f.height(),d=g.width(),a=g.height(),e=a/d; if(d>=c&&e<=1){d=c*0.75; a=d*e }else{if(a>=b){a=b*0.75; d=a/e }}g.css({width:d+"px",height:a+"px"}) },_setupInline:function(){this.links=this.element.children("a"); this.inline=this.element.children("div").addClass("pui-lightbox-inline"); this.inline.appendTo(this.content).show(); var a=this; this.links.click(function(b){a.show(); var c=$(this).attr("title"); if(c){a.captionText.html(c); a.caption.slideDown() }b.preventDefault() }) },_setupIframe:function(){var a=this; this.links=this.element; this.iframe=$('<iframe frameborder="0" style="width:'+this.options.iframeWidth+"px;height:"+this.options.iframeHeight+'px;border:0 none; display: block;"></iframe>').appendTo(this.content); if(this.options.iframeTitle){this.iframe.attr("title",this.options.iframeTitle) }this.element.click(function(b){if(!a.iframeLoaded){a.content.addClass("pui-lightbox-loading").css({width:a.options.iframeWidth,height:a.options.iframeHeight}); a.show(); a.iframe.on("load",function(){a.iframeLoaded=true; a.content.removeClass("pui-lightbox-loading") }).attr("src",a.element.attr("href")) }else{a.show() }var c=a.element.attr("title"); if(c){a.caption.html(c); a.caption.slideDown() }b.preventDefault() }) },show:function(){this.center(); this.panel.css("z-index",++PUI.zindex).show(); if(!this.modality){this._enableModality() }this._trigger("show") },hide:function(){this.panel.fadeOut(); this._disableModality(); this.caption.hide(); if(this.options.mode==="image"){this.imageDisplay.hide().attr("src","").removeAttr("style"); this._hideNavigators() }this._trigger("hide") },center:function(){var c=$(window),b=(c.width()/2)-(this.panel.width()/2),a=(c.height()/2)-(this.panel.height()/2); this.panel.css({left:b,top:a}) },_enableModality:function(){this.modality=$('<div class="ui-widget-overlay"></div>').css({width:$(document).width(),height:$(document).height(),"z-index":this.panel.css("z-index")-1}).appendTo(document.body) },_disableModality:function(){this.modality.remove(); this.modality=null },_showNavigators:function(){this.navigators.zIndex(this.imageDisplay.zIndex()+1).show() },_hideNavigators:function(){this.navigators.hide() },isHidden:function(){return this.panel.is(":hidden") },showURL:function(a){if(a.width){this.iframe.attr("width",a.width) }if(a.height){this.iframe.attr("height",a.height) }this.iframe.attr("src",a.src); this.show() }}) })();(function(){$.widget("primeui.puilistbox",{options:{scrollHeight:200},_create:function(){this.element.wrap('<div class="pui-listbox pui-inputtext ui-widget ui-widget-content ui-corner-all"><div class="ui-helper-hidden-accessible"></div></div>'); this.container=this.element.parent().parent(); this.listContainer=$('<ul class="pui-listbox-list"></ul>').appendTo(this.container); this.options.multiple=this.element.prop("multiple"); if(this.options.data){this._populateInputFromData() }this._populateContainerFromOptions(); this._restrictHeight(); this._bindEvents() },_populateInputFromData:function(){for(var b=0; b<this.options.data.length; b++){var a=this.options.data[b]; if(a.label){this.element.append('<option value="'+a.value+'">'+a.label+"</option>") }else{this.element.append('<option value="'+a+'">'+a+"</option>") }}},_populateContainerFromOptions:function(){this.choices=this.element.children("option"); for(var b=0; b<this.choices.length; b++){var a=this.choices.eq(b),c=this.options.content?this.options.content.call(this,this.options.data[b]):a.text(); this.listContainer.append('<li class="pui-listbox-item ui-corner-all">'+c+"</li>") }this.items=this.listContainer.find(".pui-listbox-item:not(.ui-state-disabled)") },_restrictHeight:function(){if(this.container.height()>this.options.scrollHeight){this.container.height(this.options.scrollHeight) }},_bindEvents:function(){var a=this; this.items.on("mouseover.puilistbox",function(){var b=$(this); if(!b.hasClass("ui-state-highlight")){b.addClass("ui-state-hover") }}).on("mouseout.puilistbox",function(){$(this).removeClass("ui-state-hover") }).on("dblclick.puilistbox",function(b){a.element.trigger("dblclick"); PUI.clearSelection(); b.preventDefault() }).on("click.puilistbox",function(b){if(a.options.multiple){a._clickMultiple(b,$(this)) }else{a._clickSingle(b,$(this)) }}); this.element.on("focus.puilistbox",function(){a.container.addClass("ui-state-focus") }).on("blur.puilistbox",function(){a.container.removeClass("ui-state-focus") }) },_clickSingle:function(b,a){var c=this.items.filter(".ui-state-highlight"); if(a.index()!==c.index()){if(c.length){this.unselectItem(c) }this.selectItem(a); this.element.trigger("change") }this.element.trigger("click"); PUI.clearSelection(); b.preventDefault() },_clickMultiple:function(a,j){var c=this.items.filter(".ui-state-highlight"),f=(a.metaKey||a.ctrlKey),b=(!f&&c.length===1&&c.index()===j.index()); if(!a.shiftKey){if(!f){this.unselectAll() }if(f&&j.hasClass("ui-state-highlight")){this.unselectItem(j) }else{this.selectItem(j); this.cursorItem=j }}else{if(this.cursorItem){this.unselectAll(); var g=j.index(),k=this.cursorItem.index(),h=(g>k)?k:g,e=(g>k)?(g+1):(k+1); for(var d=h; d<e; d++){this.selectItem(this.items.eq(d)) }}else{this.selectItem(j); this.cursorItem=j }}if(!b){this.element.trigger("change") }this.element.trigger("click"); PUI.clearSelection(); a.preventDefault() },unselectAll:function(){this.items.removeClass("ui-state-highlight ui-state-hover"); this.choices.filter(":selected").prop("selected",false) },selectItem:function(b){var a=null; if($.type(b)==="number"){a=this.items.eq(b) }else{a=b }a.addClass("ui-state-highlight").removeClass("ui-state-hover"); this.choices.eq(a.index()).prop("selected",true); this._trigger("itemSelect",null,this.choices.eq(a.index())) },unselectItem:function(b){var a=null; if($.type(b)==="number"){a=this.items.eq(b) }else{a=b }a.removeClass("ui-state-highlight"); this.choices.eq(a.index()).prop("selected",false); this._trigger("itemUnselect",null,this.choices.eq(a.index())) },_setOption:function(a,b){$.Widget.prototype._setOption.apply(this,arguments); if(a==="data"){this.element.empty(); this.listContainer.empty(); this._populateInputFromData(); this._populateContainerFromOptions(); this._restrictHeight(); this._bindEvents() }},_unbindEvents:function(){this.items.off("mouseover.puilistbox click.puilistbox dblclick.puilistbox") },disable:function(){this._unbindEvents(); this.items.addClass("ui-state-disabled") },enable:function(){this._bindEvents(); this.items.removeClass("ui-state-disabled") }}) })();(function(){$.widget("primeui.puibasemenu",{options:{popup:false,trigger:null,my:"left top",at:"left bottom",triggerEvent:"click"},_create:function(){if(this.options.popup){this._initPopup() }},_initPopup:function(){var a=this; this.element.closest(".pui-menu").addClass("pui-menu-dynamic pui-shadow").appendTo(document.body); this.positionConfig={my:this.options.my,at:this.options.at,of:this.options.trigger}; this.options.trigger.on(this.options.triggerEvent+".pui-menu",function(b){if(a.element.is(":visible")){a.hide() }else{a.show() }b.preventDefault() }); $(document.body).on("click.pui-menu",function(d){var b=a.element.closest(".pui-menu"); if(b.is(":hidden")){return }var c=$(d.target); if(c.is(a.options.trigger.get(0))||a.options.trigger.has(c).length>0){return }var f=b.offset(); if(d.pageX<f.left||d.pageX>f.left+b.width()||d.pageY<f.top||d.pageY>f.top+b.height()){a.hide(d) }}); $(window).on("resize.pui-menu",function(){if(a.element.closest(".pui-menu").is(":visible")){a.align() }}) },show:function(){this.align(); this.element.closest(".pui-menu").css("z-index",++PUI.zindex).show() },hide:function(){this.element.closest(".pui-menu").fadeOut("fast") },align:function(){this.element.closest(".pui-menu").css({left:"",top:""}).position(this.positionConfig) }}) })(); (function(){$.widget("primeui.puimenu",$.primeui.puibasemenu,{options:{},_create:function(){this.element.addClass("pui-menu-list ui-helper-reset").wrap('<div class="pui-menu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix" />'); this.element.children("li").each(function(){var c=$(this); if(c.children("h3").length>0){c.addClass("ui-widget-header ui-corner-all") }else{c.addClass("pui-menuitem ui-widget ui-corner-all"); var a=c.children("a"),b=a.data("icon"); a.addClass("pui-menuitem-link ui-corner-all").contents().wrap('<span class="ui-menuitem-text" />'); if(b){a.prepend('<span class="pui-menuitem-icon fa fa-fw '+b+'"></span>') }}}); this.menuitemLinks=this.element.find(".pui-menuitem-link:not(.ui-state-disabled)"); this._bindEvents(); this._super() },_bindEvents:function(){var a=this; this.menuitemLinks.on("mouseenter.pui-menu",function(b){$(this).addClass("ui-state-hover") }).on("mouseleave.pui-menu",function(b){$(this).removeClass("ui-state-hover") }); if(this.options.popup){this.menuitemLinks.on("click.pui-menu",function(){a.hide() }) }}}) })(); (function(){$.widget("primeui.puibreadcrumb",{_create:function(){this.element.wrap('<div class="pui-breadcrumb ui-module ui-widget ui-widget-header ui-helper-clearfix ui-corner-all" role="menu">'); this.element.children("li").each(function(b){var c=$(this); c.attr("role","menuitem"); var a=c.children("a"); a.addClass("pui-menuitem-link ui-corner-all").contents().wrap('<span class="ui-menuitem-text" />'); if(b>0){c.before('<li class="pui-breadcrumb-chevron fa fa-chevron-right"></li>') }else{c.before('<li class="fa fa-home"></li>') }}) }}) })(); (function(){$.widget("primeui.puitieredmenu",$.primeui.puibasemenu,{options:{autoDisplay:true},_create:function(){this._render(); this.links=this.element.find(".pui-menuitem-link:not(.ui-state-disabled)"); this._bindEvents(); this._super() },_render:function(){var a=this; this.element.addClass("pui-menu-list ui-helper-reset").wrap('<div class="pui-tieredmenu pui-menu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix" />'); this.element.parent().uniqueId(); this.options.id=this.element.parent().attr("id"); this.element.find("li").each(function(){var d=$(this),b=d.children("a"),c=b.data("icon"); b.addClass("pui-menuitem-link ui-corner-all").contents().wrap('<span class="ui-menuitem-text" />'); if(c){b.prepend('<span class="fa fa-fw '+c+'"></span>') }d.addClass("pui-menuitem ui-widget ui-corner-all"); if(d.children("ul").length>0){var e=d.parent().hasClass("pui-menu-child")?"fa-caret-right":a._getRootSubmenuIcon(); d.addClass("pui-menu-parent"); d.children("ul").addClass("ui-widget-content pui-menu-list ui-corner-all ui-helper-clearfix pui-menu-child pui-shadow"); b.prepend('<span class="pui-submenu-icon fa fa-fw '+e+'"></span>') }}) },_bindEvents:function(){this._bindItemEvents(); this._bindDocumentHandler() },_bindItemEvents:function(){var a=this; this.links.on("mouseenter.pui-menu",function(){var b=$(this),d=b.parent(),c=a.options.autoDisplay; var e=d.siblings(".pui-menuitem-active"); if(e.length===1){a._deactivate(e) }if(c||a.active){if(d.hasClass("pui-menuitem-active")){a._reactivate(d) }else{a._activate(d) }}else{a._highlight(d) }}); if(this.options.autoDisplay===false){this.rootLinks=this.element.find("> .pui-menuitem > .pui-menuitem-link"); this.rootLinks.data("primeui-tieredmenu-rootlink",this.options.id).find("*").data("primeui-tieredmenu-rootlink",this.options.id); this.rootLinks.on("click.pui-menu",function(f){var c=$(this),d=c.parent(),b=d.children("ul.pui-menu-child"); if(b.length===1){if(b.is(":visible")){a.active=false; a._deactivate(d) }else{a.active=true; a._highlight(d); a._showSubmenu(d,b) }}}) }this.element.parent().find("ul.pui-menu-list").on("mouseleave.pui-menu",function(b){if(a.activeitem){a._deactivate(a.activeitem) }b.stopPropagation() }) },_bindDocumentHandler:function(){var a=this; $(document.body).on("click.pui-menu",function(c){var b=$(c.target); if(b.data("primeui-tieredmenu-rootlink")===a.options.id){return }a.active=false; a.element.find("li.pui-menuitem-active").each(function(){a._deactivate($(this),true) }) }) },_deactivate:function(b,a){this.activeitem=null; b.children("a.pui-menuitem-link").removeClass("ui-state-hover"); b.removeClass("pui-menuitem-active"); if(a){b.children("ul.pui-menu-child:visible").fadeOut("fast") }else{b.children("ul.pui-menu-child:visible").hide() }},_activate:function(b){this._highlight(b); var a=b.children("ul.pui-menu-child"); if(a.length===1){this._showSubmenu(b,a) }},_reactivate:function(d){this.activeitem=d; var c=d.children("ul.pui-menu-child"),b=c.children("li.pui-menuitem-active:first"),a=this; if(b.length===1){a._deactivate(b) }},_highlight:function(a){this.activeitem=a; a.children("a.pui-menuitem-link").addClass("ui-state-hover"); a.addClass("pui-menuitem-active") },_showSubmenu:function(b,a){a.css({left:b.outerWidth(),top:0,"z-index":++PUI.zindex}); a.show() },_getRootSubmenuIcon:function(){return"fa-caret-right" }}) })(); (function(){$.widget("primeui.puimenubar",$.primeui.puitieredmenu,{options:{autoDisplay:true},_create:function(){this._super(); this.element.parent().removeClass("pui-tieredmenu").addClass("pui-menubar") },_showSubmenu:function(e,c){var d=$(window),b=null,a={"z-index":++PUI.zindex}; if(e.parent().hasClass("pui-menu-child")){a.left=e.outerWidth(); a.top=0; b=e.offset().top-d.scrollTop() }else{a.left=0; a.top=e.outerHeight(); b=e.offset().top+a.top-d.scrollTop() }c.css("height","auto"); if((b+c.outerHeight())>d.height()){a.overflow="auto"; a.height=d.height()-(b+20) }c.css(a).show() },_getRootSubmenuIcon:function(){return"fa-caret-down" }}) })(); (function(){$.widget("primeui.puislidemenu",$.primeui.puibasemenu,{_create:function(){this._render(); this.rootList=this.element; this.content=this.element.parent(); this.wrapper=this.content.parent(); this.container=this.wrapper.parent(); this.submenus=this.container.find("ul.pui-menu-list"); this.links=this.element.find("a.pui-menuitem-link:not(.ui-state-disabled)"); this.backward=this.wrapper.children("div.pui-slidemenu-backward"); this.stack=[]; this.jqWidth=this.container.width(); if(!this.element.hasClass("pui-menu-dynamic")){var a=this; setTimeout(function(){a._applyDimensions() },100) }this._super(); this._bindEvents() },_render:function(){this.element.addClass("pui-menu-list ui-helper-reset").wrap('<div class="pui-menu pui-slidemenu ui-widget ui-widget-content ui-corner-all"/>').wrap('<div class="pui-slidemenu-wrapper" />').after('<div class="pui-slidemenu-backward ui-widget-header ui-corner-all">\n <span class="pui-icon fa fa-fw fa-caret-left"></span>Back</div>').wrap('<div class="pui-slidemenu-content" />'); this.element.parent().uniqueId(); this.options.id=this.element.parent().attr("id"); this.element.find("li").each(function(){var c=$(this),a=c.children("a"),b=a.data("icon"); a.addClass("pui-menuitem-link ui-corner-all").contents().wrap('<span class="ui-menuitem-text" />'); if(b){a.prepend('<span class="pui-menuitem-icon fa fa-fw '+b+'"></span>') }c.addClass("pui-menuitem ui-widget ui-corner-all"); if(c.children("ul").length>0){c.addClass("pui-menu-parent"); c.children("ul").addClass("ui-widget-content pui-menu-list ui-corner-all ui-helper-clearfix pui-menu-child ui-shadow"); a.prepend('<span class="pui-submenu-icon fa fa-fw fa-caret-right"></span>') }}) },_bindEvents:function(){var a=this; this.links.on("mouseenter.pui-menu",function(){$(this).addClass("ui-state-hover") }).on("mouseleave.pui-menu",function(){$(this).removeClass("ui-state-hover") }).on("click.pui-menu",function(){var c=$(this),b=c.next(); if(b.length==1){a._forward(b) }}); this.backward.on("click.pui-menu",function(){a._back() }) },_forward:function(b){var c=this; this._push(b); var a=-1*(this._depth()*this.jqWidth); b.show().css({left:this.jqWidth}); this.rootList.animate({left:a},500,"easeInOutCirc",function(){if(c.backward.is(":hidden")){c.backward.fadeIn("fast") }}) },_back:function(){var c=this,b=this._pop(),d=this._depth(); var a=-1*(d*this.jqWidth); this.rootList.animate({left:a},500,"easeInOutCirc",function(){b.hide(); if(d===0){c.backward.fadeOut("fast") }}) },_push:function(a){this.stack.push(a) },_pop:function(){return this.stack.pop() },_last:function(){return this.stack[this.stack.length-1] },_depth:function(){return this.stack.length },_applyDimensions:function(){this.submenus.width(this.container.width()); this.wrapper.height(this.rootList.outerHeight(true)+this.backward.outerHeight(true)); this.content.height(this.rootList.outerHeight(true)); this.rendered=true },show:function(){this.align(); this.container.css("z-index",++PUI.zindex).show(); if(!this.rendered){this._applyDimensions() }}}) })(); (function(){$.widget("primeui.puicontextmenu",$.primeui.puitieredmenu,{options:{autoDisplay:true,target:null,event:"contextmenu"},_create:function(){this._super(); this.element.parent().removeClass("pui-tieredmenu").addClass("pui-contextmenu pui-menu-dynamic pui-shadow"); var a=this; this.options.target=this.options.target||$(document); if(!this.element.parent().parent().is(document.body)){this.element.parent().appendTo("body") }if(this.options.target.hasClass("pui-datatable")){a._bindDataTable() }else{this.options.target.on(this.options.event+".pui-contextmenu",function(b){a.show(b) }) }},_bindItemEvents:function(){this._super(); var a=this; this.links.bind("click",function(){a._hide() }) },_bindDocumentHandler:function(){var a=this; $(document.body).on("click.pui-contextmenu",function(b){if(a.element.parent().is(":hidden")){return }a._hide() }) },_bindDataTable:function(){var a="#"+this.options.target.attr("id")+" tbody.pui-datatable-data > tr.ui-widget-content:not(.pui-datatable-empty-message)",b=this.options.event+".pui-datatable",c=this; $(document).off(b,a).on(b,a,null,function(d){c.options.target.puidatatable("onRowRightClick",b,$(this)); c.show(d) }) },show:function(g){$(document.body).children(".pui-contextmenu:visible").hide(); var f=$(window),d=g.pageX,c=g.pageY,b=this.element.parent().outerWidth(),a=this.element.parent().outerHeight(); if((d+b)>(f.width())+f.scrollLeft()){d=d-b }if((c+a)>(f.height()+f.scrollTop())){c=c-a }if(this.options.beforeShow){this.options.beforeShow.call(this) }this.element.parent().css({left:d,top:c,"z-index":++PUI.zindex}).show(); g.preventDefault(); g.stopPropagation() },_hide:function(){var a=this; this.element.parent().find("li.pui-menuitem-active").each(function(){a._deactivate($(this),true) }); this.element.parent().fadeOut("fast") },isVisible:function(){return this.element.parent().is(":visible") },getTarget:function(){return this.jqTarget }}) })();(function(){$.widget("primeui.puimessages",{options:{closable:true},_create:function(){this.element.addClass("pui-messages ui-widget ui-corner-all"); if(this.options.closable){this.closer=$('<a href="#" class="pui-messages-close"><i class="fa fa-close"></i></a>').appendTo(this.element) }this.element.append('<span class="pui-messages-icon fa fa-info-circle fa-2x"></span>'); this.msgContainer=$("<ul></ul>").appendTo(this.element); this._bindEvents() },_bindEvents:function(){var a=this; if(this.options.closable){this.closer.on("click",function(b){a.element.slideUp(); b.preventDefault() }) }},show:function(a,c){this.clear(); this.element.removeClass("pui-messages-info pui-messages-warn pui-messages-error").addClass("pui-messages-"+a); if($.isArray(c)){for(var b=0; b<c.length; b++){this._showMessage(c[b]) }}else{this._showMessage(c) }this.element.show() },_showMessage:function(a){this.msgContainer.append('<li><span class="pui-messages-summary">'+a.summary+'</span><span class="pui-messages-detail">'+a.detail+"</span></li>") },clear:function(){this.msgContainer.children().remove(); this.element.hide() }}) })();(function(){$.widget("primeui.puinotify",{options:{position:"top",visible:false,animate:true,effectSpeed:"normal",easing:"swing"},_create:function(){this.element.addClass("pui-notify pui-notify-"+this.options.position+" ui-widget ui-widget-content pui-shadow").wrapInner('<div class="pui-notify-content" />').appendTo(document.body); this.content=this.element.children(".pui-notify-content"); this.closeIcon=$('<span class="pui-notify-close fa fa-close"></span>').appendTo(this.element); this._bindEvents(); if(this.options.visible){this.show() }},_bindEvents:function(){var a=this; this.closeIcon.on("click.puinotify",function(){a.hide() }) },show:function(a){var b=this; if(a){this.update(a) }this.element.css("z-index",++PUI.zindex); this._trigger("beforeShow"); if(this.options.animate){this.element.slideDown(this.options.effectSpeed,this.options.easing,function(){b._trigger("afterShow") }) }else{this.element.show(); b._trigger("afterShow") }},hide:function(){var a=this; this._trigger("beforeHide"); if(this.options.animate){this.element.slideUp(this.options.effectSpeed,this.options.easing,function(){a._trigger("afterHide") }) }else{this.element.hide(); a._trigger("afterHide") }},update:function(a){this.content.html(a) }}) })();(function(){$.widget("primeui.puiorderlist",{options:{controlsLocation:"none",dragdrop:true,effect:"fade",caption:null,responsive:false,datasource:null,content:null},_create:function(){this._createDom(); if(this.options.datasource){if($.isArray(this.options.datasource)){this._generateOptionElements(this.options.datasource) }else{if($.type(this.options.datasource)==="function"){this.options.datasource.call(this,this._generateOptionElements) }}}this.optionElements=this.element.children("option"); this._createListElement(); this._bindEvents() },_createDom:function(){this.element.addClass("ui-helper-hidden"); if(this.options.controlsLocation!=="none"){this.element.wrap('<div class="pui-grid-col-10"></div>') }else{this.element.wrap('<div class="pui-grid-col-12"></div>') }this.element.parent().wrap('<div class="pui-orderlist pui-grid ui-widget"><div class="pui-grid-row"></div></div>'); this.container=this.element.closest(".pui-orderlist"); if(this.options.controlsLocation!=="none"){this.element.parent().before('<div class="pui-orderlist-controls pui-grid-col-2"></div>'); this._createButtons() }if(this.options.responsive){this.container.addClass("pui-grid-responsive") }},_generateOptionElements:function(c){for(var b=0; b<c.length; b++){var a=c[b]; if(a.label){this.element.append('<option value="'+a.value+'">'+a.label+"</option>") }else{this.element.append('<option value="'+a+'">'+a+"</option>") }}},_createListElement:function(){this.list=$('<ul class="ui-widget-content pui-orderlist-list"></ul>').insertBefore(this.element); for(var b=0; b<this.optionElements.length; b++){var a=this.optionElements.eq(b),d=this.options.content?this.options.content.call(this,a):a.text(),c=$('<li class="pui-orderlist-item ui-corner-all"></li>'); if($.type(d)==="string"){c.html(d) }else{c.append(d) }c.data("item-value",a.attr("value")).appendTo(this.list) }this.items=this.list.children(".pui-orderlist-item"); if(this.options.caption){this.list.addClass("ui-corner-bottom").before('<div class="pui-orderlist-caption ui-widget-header ui-corner-top">'+this.options.caption+"</div>") }else{this.list.addClass("ui-corner-all") }},_createButtons:function(){var b=this,a=this.element.parent().prev(); a.append(this._createButton("fa-angle-up","pui-orderlist-button-moveup",function(){b._moveUp() })).append(this._createButton("fa-angle-double-up","pui-orderlist-button-move-top",function(){b._moveTop() })).append(this._createButton("fa-angle-down","pui-orderlist-button-move-down",function(){b._moveDown() })).append(this._createButton("fa-angle-double-down","pui-orderlist-move-bottom",function(){b._moveBottom() })) },_createButton:function(d,a,c){var b=$('<button class="'+a+'" type="button"></button>').puibutton({icon:d,click:function(){c(); $(this).removeClass("ui-state-hover ui-state-focus") }}); return b },_bindEvents:function(){var a=this; this.items.on("mouseover.puiorderlist",function(c){var b=$(this); if(!b.hasClass("ui-state-highlight")){$(this).addClass("ui-state-hover") }}).on("mouseout.puiorderlist",function(c){var b=$(this); if(!b.hasClass("ui-state-highlight")){$(this).removeClass("ui-state-hover") }}).on("mousedown.puiorderlist",function(c){var b=$(this),d=(c.metaKey||c.ctrlKey); if(!d){b.removeClass("ui-state-hover").addClass("ui-state-highlight").siblings(".ui-state-highlight").removeClass("ui-state-highlight") }else{if(b.hasClass("ui-state-highlight")){b.removeClass("ui-state-highlight") }else{b.removeClass("ui-state-hover").addClass("ui-state-highlight") }}}); if(this.options.dragdrop){this.list.sortable({revert:1,start:function(b,c){},update:function(b,c){a.onDragDrop(b,c) }}) }},_moveUp:function(){var b=this,d=this.items.filter(".ui-state-highlight"),c=d.length,a=0; d.each(function(){var e=$(this); if(!e.is(":first-child")){e.hide(b.options.effect,{},"fast",function(){e.insertBefore(e.prev()).show(b.options.effect,{},"fast",function(){a++; if(c===a){b._saveState(); b._fireReorderEvent() }}) }) }else{c-- }}) },_moveTop:function(){var b=this,d=this.items.filter(".ui-state-highlight"),c=d.length,a=0; d.each(function(){var e=$(this); if(!e.is(":first-child")){e.hide(b.options.effect,{},"fast",function(){e.prependTo(e.parent()).show(b.options.effect,{},"fast",function(){a++; if(c===a){b._saveState(); b._fireReorderEvent() }}) }) }else{c-- }}) },_moveDown:function(){var b=this,d=$(this.items.filter(".ui-state-highlight").get().reverse()),c=d.length,a=0; d.each(function(){var e=$(this); if(!e.is(":last-child")){e.hide(b.options.effect,{},"fast",function(){e.insertAfter(e.next()).show(b.options.effect,{},"fast",function(){a++; if(c===a){b._saveState(); b._fireReorderEvent() }}) }) }else{c-- }}) },_moveBottom:function(){var b=this,d=this.items.filter(".ui-state-highlight"),c=d.length,a=0; d.each(function(){var e=$(this); if(!e.is(":last-child")){e.hide(b.options.effect,{},"fast",function(){e.appendTo(e.parent()).show(b.options.effect,{},"fast",function(){a++; if(c===a){b._saveState(); b._fireReorderEvent() }}) }) }else{c-- }}) },_saveState:function(){this.element.children().remove(); this._generateOptions() },_fireReorderEvent:function(){this._trigger("reorder",null) },onDragDrop:function(a,b){b.item.removeClass("ui-state-highlight"); this._saveState(); this._fireReorderEvent() },_generateOptions:function(){var a=this; this.list.children(".pui-orderlist-item").each(function(){var b=$(this),c=b.data("item-value"); a.element.append('<option value="'+c+'" selected="selected">'+c+"</option>") }) }}) })();(function(){var a={"{FirstPageLink}":{markup:'<span class="pui-paginator-first pui-paginator-element ui-state-default ui-corner-all"><span class="fa fa-step-backward"></span></span>',create:function(c){var b=$(this.markup); if(c.options.page===0){b.addClass("ui-state-disabled") }b.on("click.puipaginator",function(){if(!$(this).hasClass("ui-state-disabled")){c.option("page",0) }}); return b },update:function(b,c){if(c.page===0){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }else{b.removeClass("ui-state-disabled") }}},"{PreviousPageLink}":{markup:'<span class="pui-paginator-prev pui-paginator-element ui-state-default ui-corner-all"><span class="fa fa-backward"></span></span>',create:function(c){var b=$(this.markup); if(c.options.page===0){b.addClass("ui-state-disabled") }b.on("click.puipaginator",function(){if(!$(this).hasClass("ui-state-disabled")){c.option("page",c.options.page-1) }}); return b },update:function(b,c){if(c.page===0){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }else{b.removeClass("ui-state-disabled") }}},"{NextPageLink}":{markup:'<span class="pui-paginator-next pui-paginator-element ui-state-default ui-corner-all"><span class="fa fa-forward"></span></span>',create:function(c){var b=$(this.markup); if(c.options.page===(c.getPageCount()-1)){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }b.on("click.puipaginator",function(){if(!$(this).hasClass("ui-state-disabled")){c.option("page",c.options.page+1) }}); return b },update:function(b,c){if(c.page===(c.pageCount-1)){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }else{b.removeClass("ui-state-disabled") }}},"{LastPageLink}":{markup:'<span class="pui-paginator-last pui-paginator-element ui-state-default ui-corner-all"><span class="fa fa-step-forward"></span></span>',create:function(c){var b=$(this.markup); if(c.options.page===(c.getPageCount()-1)){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }b.on("click.puipaginator",function(){if(!$(this).hasClass("ui-state-disabled")){c.option("page",c.getPageCount()-1) }}); return b },update:function(b,c){if(c.page===(c.pageCount-1)){b.addClass("ui-state-disabled").removeClass("ui-state-hover ui-state-active") }else{b.removeClass("ui-state-disabled") }}},"{PageLinks}":{markup:'<span class="pui-paginator-pages"></span>',create:function(j){var f=$(this.markup),c=this.calculateBoundaries({page:j.options.page,pageLinks:j.options.pageLinks,pageCount:j.getPageCount()}),h=c[0],b=c[1]; for(var e=h; e<=b; e++){var g=(e+1),d=$('<span class="pui-paginator-page pui-paginator-element ui-state-default ui-corner-all">'+g+"</span>"); if(e===j.options.page){d.addClass("ui-state-active") }d.on("click.puipaginator",function(k){var i=$(this); if(!i.hasClass("ui-state-disabled")&&!i.hasClass("ui-state-active")){j.option("page",parseInt(i.text(),10)-1) }}); f.append(d) }return f },update:function(f,b,k){var j=f.children(),d=this.calculateBoundaries({page:b.page,pageLinks:b.pageLinks,pageCount:b.pageCount}),c=d[0],e=d[1]; j.remove(); for(var g=c; g<=e; g++){var l=(g+1),h=$('<span class="pui-paginator-page pui-paginator-element ui-state-default ui-corner-all">'+l+"</span>"); if(g===b.page){h.addClass("ui-state-active") }h.on("click.puipaginator",function(m){var i=$(this); if(!i.hasClass("ui-state-disabled")&&!i.hasClass("ui-state-active")){k.option("page",parseInt(i.text(),10)-1) }}); k._bindHover(h); f.append(h) }},calculateBoundaries:function(d){var e=d.page,i=d.pageLinks,c=d.pageCount,f=Math.min(i,c); var h=Math.max(0,parseInt(Math.ceil(e-((f)/2)),10)),b=Math.min(c-1,h+f-1); var g=i-(b-h+1); h=Math.max(0,h-g); return[h,b] }}}; $.widget("primeui.puipaginator",{options:{pageLinks:5,totalRecords:0,page:0,rows:0,template:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"},_create:function(){this.element.addClass("pui-paginator ui-widget-header"); this.paginatorElements=[]; var b=this.options.template.split(/[ ]+/); for(var c=0; c<b.length; c++){var f=b[c],e=a[f]; if(e){var d=e.create(this); this.paginatorElements[f]=d; this.element.append(d) }}this._bindEvents() },_bindEvents:function(){this._bindHover(this.element.find("span.pui-paginator-element")) },_bindHover:function(b){b.on("mouseover.puipaginator",function(){var c=$(this); if(!c.hasClass("ui-state-active")&&!c.hasClass("ui-state-disabled")){c.addClass("ui-state-hover") }}).on("mouseout.puipaginator",function(){var c=$(this); if(c.hasClass("ui-state-hover")){c.removeClass("ui-state-hover") }}) },_setOption:function(b,c){if(b==="page"){this.setPage(c) }else{if(b==="totalRecords"){this.setTotalRecords(c) }else{$.Widget.prototype._setOption.apply(this,arguments) }}},setPage:function(e,b){var c=this.getPageCount(); if(e>=0&&e<c){var d={first:this.options.rows*e,rows:this.options.rows,page:e,pageCount:c,pageLinks:this.options.pageLinks}; this.options.page=e; if(!b){this._trigger("paginate",null,d) }this.updateUI(d) }},setState:function(b){this.options.totalRecords=b.totalRecords; this.setPage(b.page,true) },updateUI:function(c){for(var b in this.paginatorElements){a[b].update(this.paginatorElements[b],c,this) }},getPageCount:function(){return Math.ceil(this.options.totalRecords/this.options.rows)||1 },setTotalRecords:function(b){this.options.totalRecords=b; this.setPage(0,true) }}) })();(function(){$.widget("primeui.puipanel",{options:{toggleable:false,toggleDuration:"normal",toggleOrientation:"vertical",collapsed:false,closable:false,closeDuration:"normal"},_create:function(){this.element.addClass("pui-panel ui-widget ui-widget-content ui-corner-all").contents().wrapAll('<div class="pui-panel-content ui-widget-content" />'); var c=this.element.attr("title"); if(c){this.element.prepend('<div class="pui-panel-titlebar ui-widget-header ui-helper-clearfix ui-corner-all"><span class="ui-panel-title">'+c+"</span></div>").removeAttr("title") }this.header=this.element.children("div.pui-panel-titlebar"); this.title=this.header.children("span.ui-panel-title"); this.content=this.element.children("div.pui-panel-content"); var b=this; if(this.options.closable){this.closer=$('<a class="pui-panel-titlebar-icon ui-corner-all ui-state-default" href="#"><span class="pui-icon fa fa-fw fa-close"></span></a>').appendTo(this.header).on("click.puipanel",function(d){b.close(); d.preventDefault() }) }if(this.options.toggleable){var a=this.options.collapsed?"fa-plus":"fa-minus"; this.toggler=$('<a class="pui-panel-titlebar-icon ui-corner-all ui-state-default" href="#"><span class="pui-icon fa fa-fw '+a+'"></span></a>').appendTo(this.header).on("click.puipanel",function(d){b.toggle(); d.preventDefault() }); if(this.options.collapsed){this.content.hide() }}this._bindEvents() },_bindEvents:function(){this.header.find("a.pui-panel-titlebar-icon").on("mouseenter.puipanel",function(){$(this).addClass("ui-state-hover") }).on("mouseleave.puipanel",function(){$(this).removeClass("ui-state-hover") }) },close:function(){var a=this; this._trigger("beforeClose",null); this.element.fadeOut(this.options.closeDuration,function(){a._trigger("afterClose",null) }) },toggle:function(){if(this.options.collapsed){this.expand() }else{this.collapse() }},expand:function(){this.toggler.children(".pui-icon").removeClass("fa-plus").addClass("fa-minus"); if(this.options.toggleOrientation==="vertical"){this._slideDown() }else{if(this.options.toggleOrientation==="horizontal"){this._slideRight() }}},collapse:function(){this.toggler.children(".pui-icon").removeClass("fa-minus").addClass("fa-plus"); if(this.options.toggleOrientation==="vertical"){this._slideUp() }else{if(this.options.toggleOrientation==="horizontal"){this._slideLeft() }}},_slideUp:function(){var a=this; this._trigger("beforeCollapse"); this.content.slideUp(this.options.toggleDuration,"easeInOutCirc",function(){a._trigger("afterCollapse"); a.options.collapsed=!a.options.collapsed }) },_slideDown:function(){var a=this; this._trigger("beforeExpand"); this.content.slideDown(this.options.toggleDuration,"easeInOutCirc",function(){a._trigger("afterExpand"); a.options.collapsed=!a.options.collapsed }) },_slideLeft:function(){var a=this; this.originalWidth=this.element.width(); this.title.hide(); this.toggler.hide(); this.content.hide(); this.element.animate({width:"42px"},this.options.toggleSpeed,"easeInOutCirc",function(){a.toggler.show(); a.element.addClass("pui-panel-collapsed-h"); a.options.collapsed=!a.options.collapsed }) },_slideRight:function(){var b=this,a=this.originalWidth||"100%"; this.toggler.hide(); this.element.animate({width:a},this.options.toggleSpeed,"easeInOutCirc",function(){b.element.removeClass("pui-panel-collapsed-h"); b.title.show(); b.toggler.show(); b.options.collapsed=!b.options.collapsed; b.content.css({visibility:"visible",display:"block",height:"auto"}) }) }}) })();(function(){$.widget("primeui.puipassword",{options:{promptLabel:"Please enter a password",weakLabel:"Weak",goodLabel:"Medium",strongLabel:"Strong",inline:false},_create:function(){this.element.puiinputtext().addClass("pui-password"); if(!this.element.prop(":disabled")){var a='<div class="pui-password-panel ui-widget ui-state-highlight ui-corner-all ui-helper-hidden">'; a+='<div class="pui-password-meter" style="background-position:0pt 0pt">&nbsp;</div>'; a+='<div class="pui-password-info">'+this.options.promptLabel+"</div>"; a+="</div>"; this.panel=$(a).insertAfter(this.element); this.meter=this.panel.children("div.pui-password-meter"); this.infoText=this.panel.children("div.pui-password-info"); if(this.options.inline){this.panel.addClass("pui-password-panel-inline") }else{this.panel.addClass("pui-password-panel-overlay").appendTo("body") }this._bindEvents() }},_destroy:function(){this.panel.remove() },_bindEvents:function(){var b=this; this.element.on("focus.puipassword",function(){b.show() }).on("blur.puipassword",function(){b.hide() }).on("keyup.puipassword",function(){var e=b.element.val(),c=null,d=null; if(e.length===0){c=b.options.promptLabel; d="0px 0px" }else{var f=b._testStrength(b.element.val()); if(f<30){c=b.options.weakLabel; d="0px -10px" }else{if(f>=30&&f<80){c=b.options.goodLabel; d="0px -20px" }else{if(f>=80){c=b.options.strongLabel; d="0px -30px" }}}}b.meter.css("background-position",d); b.infoText.text(c) }); if(!this.options.inline){var a="resize."+this.element.attr("id"); $(window).unbind(a).bind(a,function(){if(b.panel.is(":visible")){b.align() }}) }},_unbindEvents:function(){this.element.off("focus.puipassword blur.puipassword keyup.puipassword") },_testStrength:function(d){var b=0,c=0,a=this; c=d.match("[0-9]"); b+=a._normalize(c?c.length:1/4,1)*25; c=d.match("[a-zA-Z]"); b+=a._normalize(c?c.length:1/2,3)*10; c=d.match("[!@#$%^&*?_~.,;=]"); b+=a._normalize(c?c.length:1/6,1)*35; c=d.match("[A-Z]"); b+=a._normalize(c?c.length:1/6,1)*30; b*=d.length/8; return b>100?100:b },_normalize:function(a,c){var b=a-c; if(b<=0){return a/c }else{return 1+0.5*(a/(a+c/4)) }},align:function(){this.panel.css({left:"",top:"","z-index":++PUI.zindex}).position({my:"left top",at:"right top",of:this.element}) },show:function(){if(!this.options.inline){this.align(); this.panel.fadeIn() }else{this.panel.slideDown() }},hide:function(){if(this.options.inline){this.panel.slideUp() }else{this.panel.fadeOut() }},disable:function(){this.element.puiinputtext("disable"); this._unbindEvents() },enable:function(){this.element.puiinputtext("enable"); this._bindEvents() }}) })();(function(){$.widget("primeui.puipicklist",{options:{effect:"fade",effectSpeed:"fast",sourceCaption:null,targetCaption:null,filter:false,filterFunction:null,filterMatchMode:"startsWith",dragdrop:true,sourceData:null,targetData:null,content:null},_create:function(){this.element.uniqueId().addClass("pui-picklist ui-widget ui-helper-clearfix"); this.inputs=this.element.children("select"); this.items=$(); this.sourceInput=this.inputs.eq(0); this.targetInput=this.inputs.eq(1); if(this.options.sourceData){this._populateInputFromData(this.sourceInput,this.options.sourceData) }if(this.options.targetData){this._populateInputFromData(this.targetInput,this.options.targetData) }this.sourceList=this._createList(this.sourceInput,"pui-picklist-source",this.options.sourceCaption,this.options.sourceData); this._createButtons(); this.targetList=this._createList(this.targetInput,"pui-picklist-target",this.options.targetCaption,this.options.targetData); if(this.options.showSourceControls){this.element.prepend(this._createListControls(this.sourceList)) }if(this.options.showTargetControls){this.element.append(this._createListControls(this.targetList)) }this._bindEvents() },_populateInputFromData:function(b,d){for(var c=0; c<d.length; c++){var a=d[c]; if(a.label){b.append('<option value="'+a.value+'">'+a.label+"</option>") }else{b.append('<option value="'+a+'">'+a+"</option>") }}},_createList:function(d,b,c,e){d.wrap('<div class="ui-helper-hidden"></div>'); var a=$('<div class="pui-picklist-listwrapper '+b+'"></div>'),f=$('<ul class="ui-widget-content pui-picklist-list pui-inputtext"></ul>'); if(this.options.filter){a.append('<div class="pui-picklist-filter-container"><input type="text" class="pui-picklist-filter" /><span class="pui-icon fa fa-fw fa-search"></span></div>'); a.find("> .pui-picklist-filter-container > input").puiinputtext() }if(c){a.append('<div class="pui-picklist-caption ui-widget-header ui-corner-tl ui-corner-tr">'+c+"</div>"); f.addClass("ui-corner-bottom") }else{f.addClass("ui-corner-all") }this._populateContainerFromOptions(d,f,e); a.append(f).appendTo(this.element); return f },_populateContainerFromOptions:function(b,h,f){var g=b.children("option"); for(var c=0; c<g.length; c++){var a=g.eq(c),e=this.options.content?this.options.content.call(this,f[c]):a.text(),d=$('<li class="pui-picklist-item ui-corner-all"></li>').data({"item-label":a.text(),"item-value":a.val()}); if($.type(e)==="string"){d.html(e) }else{d.append(e) }this.items=this.items.add(d); h.append(d) }},_createButtons:function(){var b=this,a=$('<ul class="pui-picklist-buttons"></ul>'); a.append(this._createButton("fa-angle-right","pui-picklist-button-add",function(){b._add() })).append(this._createButton("fa-angle-double-right","pui-picklist-button-addall",function(){b._addAll() })).append(this._createButton("fa-angle-left","pui-picklist-button-remove",function(){b._remove() })).append(this._createButton("fa-angle-double-left","pui-picklist-button-removeall",function(){b._removeAll() })); this.element.append(a) },_createListControls:function(b){var c=this,a=$('<ul class="pui-picklist-buttons"></ul>'); a.append(this._createButton("fa-angle-up","pui-picklist-button-move-up",function(){c._moveUp(b) })).append(this._createButton("fa-angle-double-up","pui-picklist-button-move-top",function(){c._moveTop(b) })).append(this._createButton("fa-angle-down","pui-picklist-button-move-down",function(){c._moveDown(b) })).append(this._createButton("fa-angle-double-down","pui-picklist-button-move-bottom",function(){c._moveBottom(b) })); return a },_createButton:function(d,a,c){var b=$('<button class="'+a+'" type="button"></button>').puibutton({icon:d,click:function(){c(); $(this).removeClass("ui-state-hover ui-state-focus") }}); return b },_bindEvents:function(){var a=this; this.items.on("mouseover.puipicklist",function(c){var b=$(this); if(!b.hasClass("ui-state-highlight")){$(this).addClass("ui-state-hover") }}).on("mouseout.puipicklist",function(b){$(this).removeClass("ui-state-hover") }).on("click.puipicklist",function(d){var k=$(this),f=(d.metaKey||d.ctrlKey); if(!d.shiftKey){if(!f){a.unselectAll() }if(f&&k.hasClass("ui-state-highlight")){a.unselectItem(k) }else{a.selectItem(k); a.cursorItem=k }}else{a.unselectAll(); if(a.cursorItem&&(a.cursorItem.parent().is(k.parent()))){var g=k.index(),l=a.cursorItem.index(),j=(g>l)?l:g,c=(g>l)?(g+1):(l+1),h=k.parent(); for(var b=j; b<c; b++){a.selectItem(h.children("li.ui-picklist-item").eq(b)) }}else{a.selectItem(k); a.cursorItem=k }}}).on("dblclick.pickList",function(){var b=$(this); if($(this).closest(".pui-picklist-listwrapper").hasClass("pui-picklist-source")){a._transfer(b,a.sourceList,a.targetList,"dblclick") }else{a._transfer(b,a.targetList,a.sourceList,"dblclick") }PUI.clearSelection() }); if(this.options.filter){this._setupFilterMatcher(); this.element.find("> .pui-picklist-source > .pui-picklist-filter-container > input").on("keyup",function(b){a._filter(this.value,a.sourceList) }); this.element.find("> .pui-picklist-target > .pui-picklist-filter-container > input").on("keyup",function(b){a._filter(this.value,a.targetList) }) }if(this.options.dragdrop){this.element.find("> .pui-picklist-listwrapper > ul.pui-picklist-list").sortable({cancel:".ui-state-disabled",connectWith:"#"+this.element.attr("id")+" .pui-picklist-list",revert:true,containment:this.element,update:function(b,c){a.unselectItem(c.item); a._saveState() },receive:function(b,c){a._triggerTransferEvent(c.item,c.sender,c.item.closest("ul.pui-picklist-list"),"dragdrop") }}) }},selectItem:function(a){a.removeClass("ui-state-hover").addClass("ui-state-highlight") },unselectItem:function(a){a.removeClass("ui-state-highlight") },unselectAll:function(){var b=this.items.filter(".ui-state-highlight"); for(var a=0; a<b.length; a++){this.unselectItem(b.eq(a)) }},_add:function(){var a=this.sourceList.children("li.pui-picklist-item.ui-state-highlight"); this._transfer(a,this.sourceList,this.targetList,"command") },_addAll:function(){var a=this.sourceList.children("li.pui-picklist-item:visible:not(.ui-state-disabled)"); this._transfer(a,this.sourceList,this.targetList,"command") },_remove:function(){var a=this.targetList.children("li.pui-picklist-item.ui-state-highlight"); this._transfer(a,this.targetList,this.sourceList,"command") },_removeAll:function(){var a=this.targetList.children("li.pui-picklist-item:visible:not(.ui-state-disabled)"); this._transfer(a,this.targetList,this.sourceList,"command") },_moveUp:function(e){var f=this,d=f.options.effect,b=e.children(".ui-state-highlight"),a=b.length,c=0; b.each(function(){var g=$(this); if(!g.is(":first-child")){if(d){g.hide(f.options.effect,{},f.options.effectSpeed,function(){g.insertBefore(g.prev()).show(f.options.effect,{},f.options.effectSpeed,function(){c++; if(c===a){f._saveState() }}) }) }else{g.hide().insertBefore(g.prev()).show() }}}); if(!d){this._saveState() }},_moveTop:function(e){var f=this,d=f.options.effect,b=e.children(".ui-state-highlight"),a=b.length,c=0; e.children(".ui-state-highlight").each(function(){var g=$(this); if(!g.is(":first-child")){if(d){g.hide(f.options.effect,{},f.options.effectSpeed,function(){g.prependTo(g.parent()).show(f.options.effect,{},f.options.effectSpeed,function(){c++; if(c===a){f._saveState() }}) }) }else{g.hide().prependTo(g.parent()).show() }}}); if(!d){this._saveState() }},_moveDown:function(e){var f=this,d=f.options.effect,b=e.children(".ui-state-highlight"),a=b.length,c=0; $(e.children(".ui-state-highlight").get().reverse()).each(function(){var g=$(this); if(!g.is(":last-child")){if(d){g.hide(f.options.effect,{},f.options.effectSpeed,function(){g.insertAfter(g.next()).show(f.options.effect,{},f.options.effectSpeed,function(){c++; if(c===a){f._saveState() }}) }) }else{g.hide().insertAfter(g.next()).show() }}}); if(!d){this._saveState() }},_moveBottom:function(e){var f=this,d=f.options.effect,b=e.children(".ui-state-highlight"),a=b.length,c=0; e.children(".ui-state-highlight").each(function(){var g=$(this); if(!g.is(":last-child")){if(d){g.hide(f.options.effect,{},f.options.effectSpeed,function(){g.appendTo(g.parent()).show(f.options.effect,{},f.options.effectSpeed,function(){c++; if(c===a){f._saveState() }}) }) }else{g.hide().appendTo(g.parent()).show() }}}); if(!d){this._saveState() }},_transfer:function(b,g,f,d){var e=this,a=b.length,c=0; if(this.options.effect){b.hide(this.options.effect,{},this.options.effectSpeed,function(){var h=$(this); e.unselectItem(h); h.appendTo(f).show(e.options.effect,{},e.options.effectSpeed,function(){c++; if(c===a){e._saveState(); e._triggerTransferEvent(b,g,f,d) }}) }) }else{b.hide().removeClass("ui-state-highlight ui-state-hover").appendTo(f).show(); this._saveState(); this._triggerTransferEvent(b,g,f,d) }},_triggerTransferEvent:function(a,e,d,b){var c={}; c.items=a; c.from=e; c.to=d; c.type=b; this._trigger("transfer",null,c) },_saveState:function(){this.sourceInput.children().remove(); this.targetInput.children().remove(); this._generateItems(this.sourceList,this.sourceInput); this._generateItems(this.targetList,this.targetInput); this.cursorItem=null },_generateItems:function(b,a){b.children(".pui-picklist-item").each(function(){var d=$(this),e=d.data("item-value"),c=d.data("item-label"); a.append('<option value="'+e+'" selected="selected">'+c+"</option>") }) },_setupFilterMatcher:function(){this.filterMatchers={startsWith:this._startsWithFilter,contains:this._containsFilter,endsWith:this._endsWithFilter,custom:this.options.filterFunction}; this.filterMatcher=this.filterMatchers[this.options.filterMatchMode] },_filter:function(f,e){var g=$.trim(f).toLowerCase(),a=e.children("li.pui-picklist-item"); if(g===""){a.filter(":hidden").show() }else{for(var b=0; b<a.length; b++){var d=a.eq(b),c=d.data("item-label"); if(this.filterMatcher(c,g)){d.show() }else{d.hide() }}}},_startsWithFilter:function(b,a){return b.toLowerCase().indexOf(a)===0 },_containsFilter:function(b,a){return b.toLowerCase().indexOf(a)!==-1 },_endsWithFilter:function(b,a){return b.indexOf(a,b.length-a.length)!==-1 },_setOption:function(a,b){$.Widget.prototype._setOption.apply(this,arguments); if(a==="sourceData"){this._setOptionData(this.sourceInput,this.sourceList,this.options.sourceData) }if(a==="targetData"){this._setOptionData(this.targetInput,this.targetList,this.options.targetData) }},_setOptionData:function(a,c,b){a.empty(); c.empty(); this._populateInputFromData(a,b); this._populateContainerFromOptions(a,c,b); this._bindEvents() },_unbindEvents:function(){this.items.off("mouseover.puipicklist mouseout.puipicklist click.puipicklist dblclick.pickList") },disable:function(){this._unbindEvents(); this.items.addClass("ui-state-disabled"); this.element.find(".pui-picklist-buttons > button").each(function(a,b){$(b).puibutton("disable") }) },enable:function(){this._bindEvents(); this.items.removeClass("ui-state-disabled"); this.element.find(".pui-picklist-buttons > button").each(function(a,b){$(b).puibutton("enable") }) }}) })();(function(){$.widget("primeui.puiprogressbar",{options:{value:0,labelTemplate:"{value}%",complete:null,easing:"easeInOutCirc",effectSpeed:"normal",showLabel:true},_create:function(){this.element.addClass("pui-progressbar ui-widget ui-widget-content ui-corner-all").append('<div class="pui-progressbar-value ui-widget-header ui-corner-all"></div>').append('<div class="pui-progressbar-label"></div>'); this.jqValue=this.element.children(".pui-progressbar-value"); this.jqLabel=this.element.children(".pui-progressbar-label"); if(this.options.value!==0){this._setValue(this.options.value,false) }this.enableARIA() },_setValue:function(d,b){var c=(b===undefined||b)?true:false; if(d>=0&&d<=100){if(d===0){this.jqValue.hide().css("width","0%").removeClass("ui-corner-right"); this.jqLabel.hide() }else{if(c){this.jqValue.show().animate({width:d+"%"},this.options.effectSpeed,this.options.easing) }else{this.jqValue.show().css("width",d+"%") }if(this.options.labelTemplate&&this.options.showLabel){var a=this.options.labelTemplate.replace(/{value}/gi,d); this.jqLabel.html(a).show() }if(d===100){this._trigger("complete") }}this.options.value=d; this.element.attr("aria-valuenow",d) }},_getValue:function(){return this.options.value },enableARIA:function(){this.element.attr("role","progressbar").attr("aria-valuemin",0).attr("aria-valuenow",this.options.value).attr("aria-valuemax",100) },_setOption:function(a,b){if(a==="value"){this._setValue(b) }$.Widget.prototype._setOption.apply(this,arguments) },_destroy:function(){}}) })();(function(){var a={}; $.widget("primeui.puiradiobutton",{_create:function(){this.element.wrap('<div class="pui-radiobutton ui-widget"><div class="ui-helper-hidden-accessible"></div></div>'); this.container=this.element.parent().parent(); this.box=$('<div class="pui-radiobutton-box ui-widget pui-radiobutton-relative ui-state-default">').appendTo(this.container); this.icon=$('<span class="pui-radiobutton-icon pui-icon"></span>').appendTo(this.box); this.disabled=this.element.prop("disabled"); this.label=$('label[for="'+this.element.attr("id")+'"]'); if(this.element.prop("checked")){this.box.addClass("ui-state-active"); this.icon.addClass("fa fa-fw fa-circle"); a[this.element.attr("name")]=this.box }if(this.disabled){this.box.addClass("ui-state-disabled") }else{this._bindEvents() }},_bindEvents:function(){var b=this; this.box.on("mouseover.puiradiobutton",function(){if(!b._isChecked()){b.box.addClass("ui-state-hover") }}).on("mouseout.puiradiobutton",function(){if(!b._isChecked()){b.box.removeClass("ui-state-hover") }}).on("click.puiradiobutton",function(){if(!b._isChecked()){b.element.trigger("click"); if(PUI.browser.msie&&parseInt(PUI.browser.version,10)<9){b.element.trigger("change") }}}); if(this.label.length>0){this.label.on("click.puiradiobutton",function(c){b.element.trigger("click"); c.preventDefault() }) }this.element.focus(function(){if(b._isChecked()){b.box.removeClass("ui-state-active") }b.box.addClass("ui-state-focus") }).blur(function(){if(b._isChecked()){b.box.addClass("ui-state-active") }b.box.removeClass("ui-state-focus") }).change(function(d){var c=b.element.attr("name"); if(a[c]){a[c].removeClass("ui-state-active ui-state-focus ui-state-hover").children(".pui-radiobutton-icon").removeClass("fa fa-fw fa-circle") }b.icon.addClass("fa fa-fw fa-circle"); if(!b.element.is(":focus")){b.box.addClass("ui-state-active") }a[c]=b.box; b._trigger("change",null) }) },_isChecked:function(){return this.element.prop("checked") },_unbindEvents:function(){this.box.off(); if(this.label.length>0){this.label.off() }},enable:function(){this._bindEvents(); this.box.removeClass("ui-state-disabled") },disable:function(){this._unbindEvents(); this.box.addClass("ui-state-disabled") }}) })();(function(){$.widget("primeui.puirating",{options:{stars:5,cancel:true},_create:function(){var b=this.element; b.wrap("<div />"); this.container=b.parent(); this.container.addClass("pui-rating"); var d=b.val(),e=d===""?null:parseInt(d,10); if(this.options.cancel){this.container.append('<div class="pui-rating-cancel"><a></a></div>') }for(var c=0; c<this.options.stars; c++){var a=(e>c)?"pui-rating-star pui-rating-star-on":"pui-rating-star"; this.container.append('<div class="'+a+'"><a></a></div>') }this.stars=this.container.children(".pui-rating-star"); if(b.prop("disabled")){this.container.addClass("ui-state-disabled") }else{if(!b.prop("readonly")){this._bindEvents() }}},_bindEvents:function(){var a=this; this.stars.click(function(){var b=a.stars.index(this)+1; a.setValue(b) }); this.container.children(".pui-rating-cancel").hover(function(){$(this).toggleClass("pui-rating-cancel-hover") }).click(function(){a.cancel() }) },cancel:function(){this.element.val(""); this.stars.filter(".pui-rating-star-on").removeClass("pui-rating-star-on"); this._trigger("cancel",null) },getValue:function(){var a=this.element.val(); return a===""?null:parseInt(a,10) },setValue:function(b){this.element.val(b); this.stars.removeClass("pui-rating-star-on"); for(var a=0; a<b; a++){this.stars.eq(a).addClass("pui-rating-star-on") }this._trigger("rate",null,b) },enable:function(){this.container.removeClass("ui-state-disabled"); this._bindEvents() },disable:function(){this.container.addClass("ui-state-disabled"); this._unbindEvents() },_unbindEvents:function(){this.stars.off("click"); this.container.children(".pui-rating-cancel").off("hover click") }}) })();(function(){$.widget("primeui.puispinner",{options:{step:1},_create:function(){var a=this.element,b=a.prop("disabled"); a.puiinputtext().addClass("pui-spinner-input").wrap('<span class="pui-spinner ui-widget ui-corner-all" />'); this.wrapper=a.parent(); this.wrapper.append('<a class="pui-spinner-button pui-spinner-up ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only"><span class="ui-button-text"><span class="pui-icon fa fa-fw fa-caret-up"></span></span></a><a class="pui-spinner-button pui-spinner-down ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only"><span class="ui-button-text"><span class="pui-icon fa fa-fw fa-caret-down"></span></span></a>'); this.upButton=this.wrapper.children("a.pui-spinner-up"); this.downButton=this.wrapper.children("a.pui-spinner-down"); this.options.step=this.options.step||1; if(parseInt(this.options.step,10)===0){this.options.precision=this.options.step.toString().split(/[,]|[.]/)[1].length }this._initValue(); if(!b&&!a.prop("readonly")){this._bindEvents() }if(b){this.wrapper.addClass("ui-state-disabled") }a.attr({role:"spinner","aria-multiline":false,"aria-valuenow":this.value}); if(this.options.min!==undefined){a.attr("aria-valuemin",this.options.min) }if(this.options.max!==undefined){a.attr("aria-valuemax",this.options.max) }if(a.prop("disabled")){a.attr("aria-disabled",true) }if(a.prop("readonly")){a.attr("aria-readonly",true) }},_bindEvents:function(){var a=this; this.wrapper.children(".pui-spinner-button").mouseover(function(){$(this).addClass("ui-state-hover") }).mouseout(function(){$(this).removeClass("ui-state-hover ui-state-active"); if(a.timer){window.clearInterval(a.timer) }}).mouseup(function(){window.clearInterval(a.timer); $(this).removeClass("ui-state-active").addClass("ui-state-hover") }).mousedown(function(d){var c=$(this),b=c.hasClass("pui-spinner-up")?1:-1; c.removeClass("ui-state-hover").addClass("ui-state-active"); if(a.element.is(":not(:focus)")){a.element.focus() }a._repeat(null,b); d.preventDefault() }); this.element.keydown(function(c){var b=$.ui.keyCode; switch(c.which){case b.UP:a._spin(a.options.step); break; case b.DOWN:a._spin(-1*a.options.step); break; default:break }}).keyup(function(){a._updateValue() }).blur(function(){a._format() }).focus(function(){a.element.val(a.value) }); this.element.bind("mousewheel",function(b,c){if(a.element.is(":focus")){if(c>0){a._spin(a.options.step) }else{a._spin(-1*a.options.step) }return false }}) },_repeat:function(a,b){var d=this,c=a||500; window.clearTimeout(this.timer); this.timer=window.setTimeout(function(){d._repeat(40,b) },c); this._spin(this.options.step*b) },_toFixed:function(c,a){var b=Math.pow(10,a||0); return String(Math.round(c*b)/b) },_spin:function(b){var c,a=this.value?this.value:0; if(this.options.precision){c=parseFloat(this._toFixed(a+b,this.options.precision)) }else{c=parseInt(a+b,10) }if(this.options.min!==undefined&&c<this.options.min){c=this.options.min }if(this.options.max!==undefined&&c>this.options.max){c=this.options.max }this.element.val(c).attr("aria-valuenow",c); this.value=c; this.element.trigger("change") },_updateValue:function(){var a=this.element.val(); if(a===""){if(this.options.min!==undefined){this.value=this.options.min }else{this.value=0 }}else{if(this.options.step){a=parseFloat(a) }else{a=parseInt(a,10) }if(!isNaN(a)){this.value=a }}},_initValue:function(){var a=this.element.val(); if(a===""){if(this.options.min!==undefined){this.value=this.options.min }else{this.value=0 }}else{if(this.options.prefix){a=a.split(this.options.prefix)[1] }if(this.options.suffix){a=a.split(this.options.suffix)[0] }if(this.options.step){this.value=parseFloat(a) }else{this.value=parseInt(a,10) }}},_format:function(){var a=this.value; if(this.options.prefix){a=this.options.prefix+a }if(this.options.suffix){a=a+this.options.suffix }this.element.val(a) },_unbindEvents:function(){this.wrapper.children(".pui-spinner-button").off(); this.element.off() },enable:function(){this.wrapper.removeClass("ui-state-disabled"); this.element.puiinputtext("enable"); this._bindEvents() },disable:function(){this.wrapper.addClass("ui-state-disabled"); this.element.puiinputtext("disable"); this._unbindEvents() }}) })();(function(){$.widget("primeui.puisplitbutton",{options:{icon:null,iconPos:"left",items:null},_create:function(){this.element.wrap('<div class="pui-splitbutton pui-buttonset ui-widget"></div>'); this.container=this.element.parent().uniqueId(); this.menuButton=this.container.append('<button class="pui-splitbutton-menubutton" type="button"></button>').children(".pui-splitbutton-menubutton"); this.options.disabled=this.element.prop("disabled"); if(this.options.disabled){this.menuButton.prop("disabled",true) }this.element.puibutton(this.options).removeClass("ui-corner-all").addClass("ui-corner-left"); this.menuButton.puibutton({icon:"fa-caret-down"}).removeClass("ui-corner-all").addClass("ui-corner-right"); if(this.options.items&&this.options.items.length){this._renderPanel(); this._bindEvents() }},_renderPanel:function(){this.menu=$('<div class="pui-menu pui-menu-dynamic ui-widget ui-widget-content ui-corner-all ui-helper-clearfix pui-shadow"></div>').append('<ul class="pui-menu-list ui-helper-reset"></ul>'); this.menuList=this.menu.children(".pui-menu-list"); for(var a=0; a<this.options.items.length; a++){var c=this.options.items[a],d=$('<li class="pui-menuitem ui-widget ui-corner-all" role="menuitem"></li>'),b=$('<a class="pui-menuitem-link ui-corner-all"><span class="pui-menuitem-icon fa fa-fw '+c.icon+'"></span><span class="ui-menuitem-text">'+c.text+"</span></a>"); if(c.url){b.attr("href",c.url) }if(c.click){b.on("click.puisplitbutton",c.click) }d.append(b).appendTo(this.menuList) }this.menu.appendTo(this.options.appendTo||this.container); this.options.position={my:"left top",at:"left bottom",of:this.element} },_bindEvents:function(){var b=this; this.menuButton.on("click.puisplitbutton",function(){if(b.menu.is(":hidden")){b.show() }else{b.hide() }}); this.menuList.children().on("mouseover.puisplitbutton",function(c){$(this).addClass("ui-state-hover") }).on("mouseout.puisplitbutton",function(c){$(this).removeClass("ui-state-hover") }).on("click.puisplitbutton",function(){b.hide() }); $(document.body).bind("mousedown."+this.container.attr("id"),function(d){if(b.menu.is(":hidden")){return }var c=$(d.target); if(c.is(b.element)||b.element.has(c).length>0){return }var f=b.menu.offset(); if(d.pageX<f.left||d.pageX>f.left+b.menu.width()||d.pageY<f.top||d.pageY>f.top+b.menu.height()){b.element.removeClass("ui-state-focus ui-state-hover"); b.hide() }}); var a="resize."+this.container.attr("id"); $(window).unbind(a).bind(a,function(){if(b.menu.is(":visible")){b._alignPanel() }}) },show:function(){this._alignPanel(); this.menuButton.trigger("focus"); this.menu.show(); this._trigger("show",null) },hide:function(){this.menuButton.removeClass("ui-state-focus"); this.menu.fadeOut("fast"); this._trigger("hide",null) },_alignPanel:function(){this.menu.css({left:"",top:"","z-index":++PUI.zindex}).position(this.options.position) },disable:function(){this.element.puibutton("disable"); this.menuButton.puibutton("disable") },enable:function(){this.element.puibutton("enable"); this.menuButton.puibutton("enable") }}) })();(function(){$.widget("primeui.puisticky",{_create:function(){this.initialState={top:this.element.offset().top,height:this.element.height()}; this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this._bindEvents() },_bindEvents:function(){var d=this,c=$(window),b="scroll."+this.id,a="resize."+this.id; c.off(b).on(b,function(){if(c.scrollTop()>d.initialState.top){d._fix() }else{d._restore() }}).off(a).on(a,function(){if(d.fixed){d.element.width(d.ghost.outerWidth()-(d.element.outerWidth()-d.element.width())) }}) },_fix:function(){if(!this.fixed){this.element.css({position:"fixed",top:0,"z-index":10000}).addClass("pui-shadow pui-sticky"); this.ghost=$('<div class="pui-sticky-ghost"></div>').height(this.initialState.height).insertBefore(this.element); this.element.width(this.ghost.outerWidth()-(this.element.outerWidth()-this.element.width())); this.fixed=true }},_restore:function(){if(this.fixed){this.element.css({position:"static",top:"auto",width:"auto"}).removeClass("pui-shadow pui-sticky"); this.ghost.remove(); this.fixed=false }}}) })();(function(){$.widget("primeui.puitabview",{options:{activeIndex:0,orientation:"top"},_create:function(){var a=this.element; a.addClass("pui-tabview ui-widget ui-widget-content ui-corner-all ui-hidden-container").children("ul").addClass("pui-tabview-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").children("li").addClass("ui-state-default ui-corner-top"); a.addClass("pui-tabview-"+this.options.orientation); a.children("div").addClass("pui-tabview-panels").children().addClass("pui-tabview-panel ui-widget-content ui-corner-bottom"); a.find("> ul.pui-tabview-nav > li").eq(this.options.activeIndex).addClass("pui-tabview-selected ui-state-active"); a.find("> div.pui-tabview-panels > div.pui-tabview-panel:not(:eq("+this.options.activeIndex+"))").addClass("ui-helper-hidden"); this.navContainer=a.children(".pui-tabview-nav"); this.panelContainer=a.children(".pui-tabview-panels"); this._bindEvents() },_bindEvents:function(){var a=this; this.navContainer.children("li").on("mouseover.tabview",function(c){var b=$(this); if(!b.hasClass("ui-state-disabled")&&!b.hasClass("ui-state-active")){b.addClass("ui-state-hover") }}).on("mouseout.tabview",function(c){var b=$(this); if(!b.hasClass("ui-state-disabled")&&!b.hasClass("ui-state-active")){b.removeClass("ui-state-hover") }}).on("click.tabview",function(d){var c=$(this); if($(d.target).is(":not(.fa-close)")){var b=c.index(); if(!c.hasClass("ui-state-disabled")&&b!=a.options.selected){a.select(b) }}d.preventDefault() }); this.navContainer.find("li .fa-close").on("click.tabview",function(c){var b=$(this).parent().index(); a.remove(b); c.preventDefault() }) },select:function(c){this.options.selected=c; var b=this.panelContainer.children().eq(c),g=this.navContainer.children(),f=g.filter(".ui-state-active"),a=g.eq(b.index()),e=this.panelContainer.children(".pui-tabview-panel:visible"),d=this; e.attr("aria-hidden",true); f.attr("aria-expanded",false); b.attr("aria-hidden",false); a.attr("aria-expanded",true); if(this.options.effect){e.hide(this.options.effect.name,null,this.options.effect.duration,function(){f.removeClass("pui-tabview-selected ui-state-active"); a.removeClass("ui-state-hover").addClass("pui-tabview-selected ui-state-active"); b.show(d.options.name,null,d.options.effect.duration,function(){d._trigger("change",null,{index:c}) }) }) }else{f.removeClass("pui-tabview-selected ui-state-active"); e.hide(); a.removeClass("ui-state-hover").addClass("pui-tabview-selected ui-state-active"); b.show(); d._trigger("change",null,{index:c}) }},remove:function(b){var d=this.navContainer.children().eq(b),a=this.panelContainer.children().eq(b); this._trigger("close",null,{index:b}); d.remove(); a.remove(); if(b==this.options.selected){var c=this.options.selected==this.getLength()?this.options.selected-1:this.options.selected; this.select(c) }},getLength:function(){return this.navContainer.children().length },getActiveIndex:function(){return this.options.selected },_markAsLoaded:function(a){a.data("loaded",true) },_isLoaded:function(a){return a.data("loaded")===true },disable:function(a){this.navContainer.children().eq(a).addClass("ui-state-disabled") },enable:function(a){this.navContainer.children().eq(a).removeClass("ui-state-disabled") }}) })();(function(){$.widget("primeui.puiterminal",{options:{welcomeMessage:"",prompt:"prime $",handler:null},_create:function(){this.element.addClass("pui-terminal ui-widget ui-widget-content ui-corner-all").append("<div>"+this.options.welcomeMessage+"</div>").append('<div class="pui-terminal-content"></div>').append('<div><span class="pui-terminal-prompt">'+this.options.prompt+'</span><input type="text" class="pui-terminal-input" autocomplete="off"></div>'); this.promptContainer=this.element.find("> div:last-child > span.pui-terminal-prompt"); this.content=this.element.children(".pui-terminal-content"); this.input=this.promptContainer.next(); this.commands=[]; this.commandIndex=0; this._bindEvents() },_bindEvents:function(){var a=this; this.input.on("keydown.terminal",function(c){var b=$.ui.keyCode; switch(c.which){case b.UP:if(a.commandIndex>0){a.input.val(a.commands[--a.commandIndex]) }c.preventDefault(); break; case b.DOWN:if(a.commandIndex<(a.commands.length-1)){a.input.val(a.commands[++a.commandIndex]) }else{a.commandIndex=a.commands.length; a.input.val("") }c.preventDefault(); break; case b.ENTER:case b.NUMPAD_ENTER:a._processCommand(); c.preventDefault(); break }}) },_processCommand:function(){var a=this.input.val(); this.commands.push(); this.commandIndex++; if(this.options.handler&&$.type(this.options.handler)==="function"){this.options.handler.call(this,a,this._updateContent) }},_updateContent:function(a){var b=$("<div></div>"); b.append("<span>"+this.options.prompt+'</span><span class="pui-terminal-command">'+this.input.val()+"</span>").append("<div>"+a+"</div>").appendTo(this.content); this.input.val(""); this.element.scrollTop(this.content.height()) },clear:function(){this.content.html(""); this.input.val("") }}) })();(function(){$.widget("primeui.puitogglebutton",{options:{onLabel:"Yes",offLabel:"No",onIcon:null,offIcon:null},_create:function(){this.element.wrap('<div class="pui-button pui-togglebutton ui-widget ui-state-default ui-corner-all" />'); this.container=this.element.parent(); this.element.addClass("ui-helper-hidden-accessible"); if(this.options.onIcon&&this.options.offIcon){this.container.addClass("pui-button-text-icon-left"); this.container.append('<span class="pui-button-icon-left pui-icon fa fa-fw"></span>') }else{this.container.addClass("pui-button-text-only") }this.container.append('<span class="pui-button-text"></span>'); if(this.options.style){this.container.attr("style",this.options.style) }if(this.options.styleClass){this.container.attr("class",this.options.styleClass) }this.label=this.container.children(".pui-button-text"); this.icon=this.container.children(".pui-icon"); if(this.element.prop("checked")){this.check(true) }else{this.uncheck(true) }if(!this.element.prop("disabled")){this._bindEvents() }},_bindEvents:function(){var a=this; this.container.on("mouseover",function(){if(!a.container.hasClass("ui-state-active")){a.container.addClass("ui-state-hover") }}).on("mouseout",function(){a.container.removeClass("ui-state-hover") }).on("click",function(){a.toggle(); a.element.trigger("focus") }); this.element.on("focus",function(){a.container.addClass("ui-state-focus") }).on("blur",function(){a.container.removeClass("ui-state-focus") }).on("keydown",function(c){var b=$.ui.keyCode; if(c.which===b.SPACE){c.preventDefault() }}).on("keyup",function(c){var b=$.ui.keyCode; if(c.which===b.SPACE){a.toggle(); c.preventDefault() }}) },_unbindEvents:function(){this.container.off("mouseover mouseout click"); this.element.off("focus blur keydown keyup") },toggle:function(){if(this.element.prop("checked")){this.uncheck() }else{this.check() }this._trigger("change",null,this.element.prop("checked")) },check:function(a){this.container.addClass("ui-state-active"); this.label.text(this.options.onLabel); this.element.prop("checked",true); if(this.options.onIcon){this.icon.removeClass(this.options.offIcon).addClass(this.options.onIcon) }if(!a){this.element.trigger("change") }},uncheck:function(a){this.container.removeClass("ui-state-active"); this.label.text(this.options.offLabel); this.element.prop("checked",false); if(this.options.offIcon){this.icon.removeClass(this.options.onIcon).addClass(this.options.offIcon) }if(!a){this.element.trigger("change") }},disable:function(){this.element.prop("disabled",true); this.container.attr("aria-disabled",true); this.container.addClass("ui-state-disabled").removeClass("ui-state-focus ui-state-hover"); this._unbindEvents() },enable:function(){this.element.prop("disabled",false); this.container.attr("aria-disabled",false); this.container.removeClass("ui-state-disabled"); this._bindEvents() },isChecked:function(){return this.element.prop("checked") }}) })();(function(){$.widget("primeui.puitooltip",{options:{showEvent:"mouseover",hideEvent:"mouseout",showEffect:"fade",hideEffect:null,showEffectSpeed:"normal",hideEffectSpeed:"normal",my:"left top",at:"right bottom",showDelay:150},_create:function(){this.options.showEvent=this.options.showEvent+".puitooltip"; this.options.hideEvent=this.options.hideEvent+".puitooltip"; if(this.element.get(0)===document){this._bindGlobal() }else{this._bindTarget() }},_bindGlobal:function(){this.container=$('<div class="pui-tooltip pui-tooltip-global ui-widget ui-widget-content ui-corner-all pui-shadow" />').appendTo(document.body); this.globalSelector="a,:input,:button,img"; var b=this; $(document).off(this.options.showEvent+" "+this.options.hideEvent,this.globalSelector).on(this.options.showEvent,this.globalSelector,null,function(){var c=$(this),d=c.attr("title"); if(d){b.container.text(d); b.globalTitle=d; b.target=c; c.attr("title",""); b.show() }}).on(this.options.hideEvent,this.globalSelector,null,function(){var c=$(this); if(b.globalTitle){b.container.hide(); c.attr("title",b.globalTitle); b.globalTitle=null; b.target=null }}); var a="resize.puitooltip"; $(window).unbind(a).bind(a,function(){if(b.container.is(":visible")){b._align() }}) },_bindTarget:function(){this.container=$('<div class="pui-tooltip ui-widget ui-widget-content ui-corner-all pui-shadow" />').appendTo(document.body); var b=this; this.element.off(this.options.showEvent+" "+this.options.hideEvent).on(this.options.showEvent,function(){b.show() }).on(this.options.hideEvent,function(){b.hide() }); this.container.html(this.options.content); this.element.removeAttr("title"); this.target=this.element; var a="resize."+this.element.attr("id"); $(window).unbind(a).bind(a,function(){if(b.container.is(":visible")){b._align() }}) },_align:function(){this.container.css({left:"",top:"","z-index":++PUI.zindex}).position({my:this.options.my,at:this.options.at,of:this.target}) },show:function(){var a=this; this.timeout=window.setTimeout(function(){a._align(); a.container.show(a.options.showEffect,{},a.options.showEffectSpeed) },this.options.showDelay) },hide:function(){window.clearTimeout(this.timeout); this.container.hide(this.options.hideEffect,{},this.options.hideEffectSpeed,function(){$(this).css("z-index","") }) }}) })();(function(){$.widget("primeui.puitree",{options:{nodes:null,lazy:false,animate:false,selectionMode:null,icons:null},_create:function(){this.element.uniqueId().addClass("pui-tree ui-widget ui-widget-content ui-corner-all").append('<ul class="pui-tree-container"></ul>'); this.rootContainer=this.element.children(".pui-tree-container"); if(this.options.selectionMode){this.selection=[] }this._bindEvents(); if($.type(this.options.nodes)==="array"){this._renderNodes(this.options.nodes,this.rootContainer) }else{if($.type(this.options.nodes)==="function"){this.options.nodes.call(this,{},this._initData) }else{throw"Unsupported type. nodes option can be either an array or a function" }}},_renderNodes:function(b,a){for(var c=0; c<b.length; c++){this._renderNode(b[c],a) }},_renderNode:function(c,b){var k=this.options.lazy?c.leaf:!(c.children&&c.children.length),d=c.iconType||"def",h=c.expanded,m=this.options.selectionMode?(c.selectable===false?false:true):false,f=k?"pui-treenode-leaf-icon":(c.expanded?"pui-tree-toggler fa fa-fw fa-caret-down":"pui-tree-toggler fa fa-fw fa-caret-right"),g=k?"pui-treenode pui-treenode-leaf":"pui-treenode pui-treenode-parent",p=$('<li class="'+g+'"></li>'),o=$('<span class="pui-treenode-content"></span>'); p.data("puidata",c.data).appendTo(b); if(m){o.addClass("pui-treenode-selectable") }o.append('<span class="'+f+'"></span>').append('<span class="pui-treenode-icon"></span>').append('<span class="pui-treenode-label ui-corner-all">'+c.label+"</span>").appendTo(p); var a=this.options.icons&&this.options.icons[d]; if(a){var j=o.children(".pui-treenode-icon"),l=($.type(a)==="string")?a:(h?a.expanded:a.collapsed); j.addClass("fa fa-fw "+l) }if(!k){var n=$('<ul class="pui-treenode-children"></ul>'); if(!c.expanded){n.hide() }n.appendTo(p); if(c.children){for(var e=0; e<c.children.length; e++){this._renderNode(c.children[e],n) }}}},_initData:function(a){this._renderNodes(a,this.rootContainer) },_handleNodeData:function(b,a){this._renderNodes(b,a.children(".pui-treenode-children")); this._showNodeChildren(a); a.data("puiloaded",true) },_bindEvents:function(){var e=this,c=this.element.attr("id"),b="#"+c+" .pui-tree-toggler"; $(document).off("click.puitree-"+c,b).on("click.puitree-"+c,b,null,function(h){var f=$(this),g=f.closest("li"); if(g.hasClass("pui-treenode-expanded")){e.collapseNode(g) }else{e.expandNode(g) }}); if(this.options.selectionMode){var a="#"+c+" .pui-treenode-selectable .pui-treenode-label",d="#"+c+" .pui-treenode-selectable.pui-treenode-content"; $(document).off("mouseout.puitree-"+c+" mouseover.puitree-"+c,a).on("mouseout.puitree-"+c,a,null,function(){$(this).removeClass("ui-state-hover") }).on("mouseover.puitree-"+c,a,null,function(){$(this).addClass("ui-state-hover") }).off("click.puitree-"+c,d).on("click.puitree-"+c,d,null,function(f){e._nodeClick(f,$(this)) }) }},expandNode:function(a){this._trigger("beforeExpand",null,{node:a,data:a.data("puidata")}); if(this.options.lazy&&!a.data("puiloaded")){this.options.nodes.call(this,{node:a,data:a.data("puidata")},this._handleNodeData) }else{this._showNodeChildren(a) }},collapseNode:function(e){this._trigger("beforeCollapse",null,{node:e,data:e.data("puidata")}); e.removeClass("pui-treenode-expanded"); var a=e.iconType||"def",c=this.options.icons&&this.options.icons[a]; if(c&&$.type(c)!=="string"){e.find("> .pui-treenode-content > .pui-treenode-icon").removeClass(c.expanded).addClass(c.collapsed) }var d=e.find("> .pui-treenode-content > .pui-tree-toggler"),b=e.children(".pui-treenode-children"); d.addClass("fa-caret-right").removeClass("fa-caret-down"); if(this.options.animate){b.slideUp("fast") }else{b.hide() }this._trigger("afterCollapse",null,{node:e,data:e.data("puidata")}) },_showNodeChildren:function(d){d.addClass("pui-treenode-expanded").attr("aria-expanded",true); var a=d.iconType||"def",b=this.options.icons&&this.options.icons[a]; if(b&&$.type(b)!=="string"){d.find("> .pui-treenode-content > .pui-treenode-icon").removeClass(b.collapsed).addClass(b.expanded) }var c=d.find("> .pui-treenode-content > .pui-tree-toggler"); c.addClass("fa-caret-down").removeClass("fa-caret-right"); if(this.options.animate){d.children(".pui-treenode-children").slideDown("fast") }else{d.children(".pui-treenode-children").show() }this._trigger("afterExpand",null,{node:d,data:d.data("puidata")}) },_nodeClick:function(d,a){PUI.clearSelection(); if($(d.target).is(":not(.pui-tree-toggler)")){var c=a.parent(); var b=this._isNodeSelected(c.data("puidata")),e=d.metaKey||d.ctrlKey; if(b&&e){this.unselectNode(c) }else{if(this._isSingleSelection()||(this._isMultipleSelection()&&!e)){this.unselectAllNodes() }this.selectNode(c) }}},selectNode:function(a){a.attr("aria-selected",true).find("> .pui-treenode-content > .pui-treenode-label").removeClass("ui-state-hover").addClass("ui-state-highlight"); this._addToSelection(a.data("puidata")); this._trigger("nodeSelect",null,{node:a,data:a.data("puidata")}) },unselectNode:function(a){a.attr("aria-selected",false).find("> .pui-treenode-content > .pui-treenode-label").removeClass("ui-state-highlight ui-state-hover"); this._removeFromSelection(a.data("puidata")); this._trigger("nodeUnselect",null,{node:a,data:a.data("puidata")}) },unselectAllNodes:function(){this.selection=[]; this.element.find(".pui-treenode-label.ui-state-highlight").each(function(){$(this).removeClass("ui-state-highlight").closest(".ui-treenode").attr("aria-selected",false) }) },_addToSelection:function(b){if(b){var a=this._isNodeSelected(b); if(!a){this.selection.push(b) }}},_removeFromSelection:function(c){if(c){var a=-1; for(var b=0; b<this.selection.length; b++){var d=this.selection[b]; if(d&&(JSON.stringify(d)===JSON.stringify(c))){a=b; break }}if(a>=0){this.selection.splice(a,1) }}},_isNodeSelected:function(c){var b=false; if(c){for(var a=0; a<this.selection.length; a++){var d=this.selection[a]; if(d&&(JSON.stringify(d)===JSON.stringify(c))){b=true; break }}}return b },_isSingleSelection:function(){return this.options.selectionMode&&this.options.selectionMode==="single" },_isMultipleSelection:function(){return this.options.selectionMode&&this.options.selectionMode==="multiple" }}) })();(function(){$.widget("primeui.puitreetable",{options:{nodes:null,lazy:false,selectionMode:null},_create:function(){this.id=this.element.attr("id"); if(!this.id){this.id=this.element.uniqueId().attr("id") }this.element.addClass("pui-treetable ui-widget"); this.tableWrapper=$('<div class="pui-treetable-tablewrapper" />').appendTo(this.element); this.table=$("<table><thead></thead><tbody></tbody></table>").appendTo(this.tableWrapper); this.thead=this.table.children("thead"); this.tbody=this.table.children("tbody").addClass("pui-treetable-data"); var a=this; if(this.options.columns){$.each(this.options.columns,function(c,b){var d=$('<th class="ui-state-default"></th>').data("field",b.field).appendTo(a.thead); if(b.headerClass){d.addClass(b.headerClass) }if(b.headerStyle){d.attr("style",b.headerStyle) }if(b.headerText){d.text(b.headerText) }}) }if(this.options.header){this.element.prepend('<div class="pui-treetable-header ui-widget-header ui-corner-top">'+this.options.header+"</div>") }if(this.options.footer){this.element.append('<div class="pui-treetable-footer ui-widget-header ui-corner-bottom">'+this.options.footer+"</div>") }if($.isArray(this.options.nodes)){this._renderNodes(this.options.nodes,null,true) }else{if($.type(this.options.nodes)==="function"){this.options.nodes.call(this,{},this._initData) }else{throw"Unsupported type. nodes option can be either an array or a function" }}this._bindEvents() },_initData:function(a){this._renderNodes(a,null,true) },_renderNodes:function(a,r,l){for(var h=0; h<a.length; h++){var d=a[h],c=d.data,n=this.options.lazy?d.leaf:!(d.children&&d.children.length),q=$('<tr class="ui-widget-content"></tr>'),g=r?r.data("depth")+1:0,o=r?r.data("rowkey"):null,b=o?o+"_"+h:h.toString(); q.data({depth:g,rowkey:b,parentrowkey:o,puidata:c}); if(!l){q.addClass("ui-helper-hidden") }for(var f=0; f<this.options.columns.length; f++){var e=$("<td />").appendTo(q),p=this.options.columns[f]; if(p.bodyClass){e.addClass(p.bodyClass) }if(p.bodyStyle){e.attr("style",p.bodyStyle) }if(f===0){var k=$('<span class="pui-treetable-toggler pui-icon fa fa-fw fa-caret-right"></span>'); k.css("margin-left",g*16+"px"); if(n){k.css("visibility","hidden") }k.appendTo(e) }if(p.content){var m=p.content.call(this,c); if($.type(m)==="string"){e.text(m) }else{e.append(m) }}else{e.append(c[p.field]) }}if(r){q.insertAfter(r) }else{q.appendTo(this.tbody) }if(!n){this._renderNodes(d.children,q,d.expanded) }}},_bindEvents:function(){var c=this,a="> tr > td:first-child > .pui-treetable-toggler"; this.tbody.off("click.puitreetable",a).on("click.puitreetable",a,null,function(f){var d=$(this),g=d.closest("tr"); if(!g.data("processing")){g.data("processing",true); if(d.hasClass("fa-caret-right")){c.expandNode(g) }else{c.collapseNode(g) }}}); if(this.options.selectionMode){this.selection=[]; var b="> tr"; this.tbody.off("mouseover.puitreetable mouseout.puitreetable click.puitreetable",b).on("mouseover.puitreetable",b,null,function(f){var d=$(this); if(!d.hasClass("ui-state-highlight")){d.addClass("ui-state-hover") }}).on("mouseout.puitreetable",b,null,function(f){var d=$(this); if(!d.hasClass("ui-state-highlight")){d.removeClass("ui-state-hover") }}).on("click.puitreetable",b,null,function(d){c.onRowClick(d,$(this)) }) }},expandNode:function(a){this._trigger("beforeExpand",null,{node:a,data:a.data("puidata")}); if(this.options.lazy&&!a.data("puiloaded")){this.options.nodes.call(this,{node:a,data:a.data("puidata")},this._handleNodeData) }else{this._showNodeChildren(a,false); this._trigger("afterExpand",null,{node:a,data:a.data("puidata")}) }},_handleNodeData:function(b,a){this._renderNodes(b,a,true); this._showNodeChildren(a,false); a.data("puiloaded",true); this._trigger("afterExpand",null,{node:a,data:a.data("puidata")}) },_showNodeChildren:function(d,c){if(!c){d.data("expanded",true).attr("aria-expanded",true).find(".pui-treetable-toggler:first").addClass("fa-caret-down").removeClass("fa-caret-right") }var b=this._getChildren(d); for(var a=0; a<b.length; a++){var e=b[a]; e.removeClass("ui-helper-hidden"); if(e.data("expanded")){this._showNodeChildren(e,true) }}d.data("processing",false) },collapseNode:function(a){this._trigger("beforeCollapse",null,{node:a,data:a.data("puidata")}); this._hideNodeChildren(a,false); a.data("processing",false); this._trigger("afterCollapse",null,{node:a,data:a.data("puidata")}) },_hideNodeChildren:function(d,c){if(!c){d.data("expanded",false).attr("aria-expanded",false).find(".pui-treetable-toggler:first").addClass("fa-caret-right").removeClass("fa-caret-down") }var b=this._getChildren(d); for(var a=0; a<b.length; a++){var e=b[a]; e.addClass("ui-helper-hidden"); if(e.data("expanded")){this._hideNodeChildren(e,true) }}},onRowClick:function(b,d){if($(b.target).is("td,span:not(.ui-c)")){var a=d.hasClass("ui-state-highlight"),c=b.metaKey||b.ctrlKey; if(a&&c){this.unselectNode(d) }else{if(this.isSingleSelection()||(this.isMultipleSelection()&&!c)){this.unselectAllNodes() }this.selectNode(d) }PUI.clearSelection() }},selectNode:function(b,a){b.removeClass("ui-state-hover").addClass("ui-state-highlight").attr("aria-selected",true); if(!a){this._trigger("nodeSelect",{},{node:b,data:b.data("puidata")}) }},unselectNode:function(b,a){b.removeClass("ui-state-highlight").attr("aria-selected",false); if(!a){this._trigger("nodeUnselect",{},{node:b,data:b.data("puidata")}) }},unselectAllNodes:function(){var b=this.tbody.children("tr.ui-state-highlight"); for(var a=0; a<b.length; a++){this.unselectNode(b.eq(a),true) }},isSingleSelection:function(){return this.options.selectionMode==="single" },isMultipleSelection:function(){return this.options.selectionMode==="multiple" },_getChildren:function(f){var c=f.data("rowkey"),g=f.nextAll(),e=[]; for(var d=0; d<g.length; d++){var a=g.eq(d),b=a.data("parentrowkey"); if(b===c){e.push(a) }}return e }}) })();
app/javascript/mastodon/components/icon_with_badge.js
d6rkaiz/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import Icon from 'mastodon/components/icon'; const formatNumber = num => num > 40 ? '40+' : num; const IconWithBadge = ({ id, count, className }) => ( <i className='icon-with-badge'> <Icon id={id} fixedWidth className={className} /> {count > 0 && <i className='icon-with-badge__badge'>{formatNumber(count)}</i>} </i> ); IconWithBadge.propTypes = { id: PropTypes.string.isRequired, count: PropTypes.number.isRequired, className: PropTypes.string, }; export default IconWithBadge;
components/Entry.js
nikhilsaraf/react-native-todo-app
/** * @flow */ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import PropTypes from 'prop-types'; import { Icon } from 'react-native-elements'; import Box from './Box'; class Entry extends React.Component { render() { return ( <Box style={styles.box} numberOfLines={this.props.numberOfLines} > <Text style={styles.text} numberOfLines={this.props.numberOfLines} ellipsizeMode='tail' > {this.props.text} </Text> <Icon style={styles.icon} name={this.props.icon1} raised={true} color='#000' size={20} underlayColor='transparent' onPress={this.props.onPressIcon1} /> <Icon style={styles.icon} name={this.props.icon2} raised={true} color='#000' size={20} underlayColor='transparent' onPress={this.props.onPressIcon2} /> </Box> ); } } Entry.propTypes = { text: PropTypes.string.isRequired, numberOfLines: PropTypes.number.isRequired, icon1: PropTypes.string.isRequired, icon2: PropTypes.string.isRequired, onPressIcon1: PropTypes.func.isRequired, onPressIcon2: PropTypes.func.isRequired }; const styles = StyleSheet.create({ box: { flexDirection: 'row', alignItems: 'center', }, text: { flex: 10, paddingTop: 6, paddingBottom: 2, paddingLeft: 6, paddingRight: 2, color: '#000', alignItems: 'center', justifyContent: 'center', fontSize: 16, fontFamily: 'Helvetica', }, icon: { flex: 1, paddingTop: 4, paddingRight: 2, }, }); export default Entry;
app/utils/injectSaga.js
react-boilerplate/react-boilerplate
import React from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { ReactReduxContext } from 'react-redux'; import getInjectors from './sagaInjectors'; /** * Dynamically injects a saga, passes component's props as saga arguments * * @param {string} key A key of the saga * @param {function} saga A root saga that will be injected * @param {string} [mode] By default (constants.DAEMON) the saga will be started * on component mount and never canceled or started again. Another two options: * - constants.RESTART_ON_REMOUNT — the saga will be started on component mount and * cancelled with `task.cancel()` on component unmount for improved performance, * - constants.ONCE_TILL_UNMOUNT — behaves like 'RESTART_ON_REMOUNT' but never runs it again. * */ export default ({ key, saga, mode }) => WrappedComponent => { class InjectSaga extends React.Component { static WrappedComponent = WrappedComponent; static contextType = ReactReduxContext; static displayName = `withSaga(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`; constructor(props, context) { super(props, context); this.injectors = getInjectors(context.store); this.injectors.injectSaga(key, { saga, mode }, this.props); } componentWillUnmount() { this.injectors.ejectSaga(key); } render() { return <WrappedComponent {...this.props} />; } } return hoistNonReactStatics(InjectSaga, WrappedComponent); }; const useInjectSaga = ({ key, saga, mode }) => { const context = React.useContext(ReactReduxContext); React.useEffect(() => { const injectors = getInjectors(context.store); injectors.injectSaga(key, { saga, mode }); return () => { injectors.ejectSaga(key); }; }, []); }; export { useInjectSaga };
fantasy-football/src/Tiers.js
paulpooch/fantasy-football
import React, { Component } from 'react'; import { Button } from '@blueprintjs/core'; import { times } from './utils'; const POSITIONS_IN_ORDER = [ 'QB', 'WR', 'RB', 'TE', 'K', // 'LB', // 'DL', // 'DB', ]; const DISPLAY_LIMIT = 10; export default class Tiers extends Component { constructor(props) { super(props); this.state = { displayedTiers: [], }; } handleTierClick = (e) => { const { tiers } = this.props; const { displayedTiers } = this.state; const { position, tier } = e.currentTarget.dataset; if (!tiers[position][tier]) return; let newDisplayed = [ { position, tier, }, ...displayedTiers, ]; if (newDisplayed.length > DISPLAY_LIMIT) newDisplayed.pop(); const displayed = {}; newDisplayed = newDisplayed.filter((element, index) => { const key = `${ element.position }-${ element.tier}`; if (displayed[key]) return false; displayed[key] = true; return true; }); this.setState({ displayedTiers: newDisplayed, }); }; render() { const { displayedTiers } = this.state; const { drafted, onTierFilterClick, tiers, } = this.props; let maxTier = 0; POSITIONS_IN_ORDER.forEach((position) => { const positionTiers = tiers[position]; const tier = Object.keys(positionTiers).length - 1; if (tier > maxTier) maxTier = tier; }); return ( <div id="tiers" className="flextainer" style={{ overflowX: 'scroll', width: '100vw', whiteSpace: 'nowrap' }}> <table id="tierTable" className="pt-monospace-text pt-table pt-condensed pt-interactive pt-striped pt-bordered"> <thead> <tr> <th>Tier</th> { POSITIONS_IN_ORDER.map(position => ( <th key={ position }>{ position }</th> )) } </tr> </thead> <tbody> { times(maxTier, i => i + 1).map((tier) => { return ( <tr key={ tier }> <td>{ tier }</td> { POSITIONS_IN_ORDER.map((position) => { const players = tiers[position][tier]; let total = 0; let available = 0; if (players) { total = players.length; available = players.reduce((acc, current) => { if (drafted[current.playerId]) return acc + 0; return acc + 1; }, 0); } return ( <td data-position={ position } data-tier={ tier } key={ `${ position }-${ tier }` } onClick={ this.handleTierClick } > <div className="available">{ available }</div> <div className="total">{ total }</div> </td> ); }) } </tr> ); }) } </tbody> </table> { displayedTiers.map(({ position, tier }) => { const players = tiers[position][tier]; return ( <div className="tierBox" key={ `${ position }-${ tier }` }> <div className={ `header flextainer flexspacebetween ${ position }` }> <div>{ position } { tier }</div> <Button className="filterButton" data-position={ position } data-tier={ tier } iconName="filter" onClick={ onTierFilterClick } /> </div> <div className="players"> { players.map((player) => { const draftedClass = drafted[player.playerId] ? 'drafted' : ''; return ( <div className={ `player ${ draftedClass }` } key={ player.playerId }> { player.displayName } </div> ); }) } </div> </div> ); })} </div> ); } }
tpl/Wap/default/common/css/162/js/jQuery.js
taobataoma/saivi
/*! jQuery v1.8.3 jquery.com | jquery.org/license */ (function (e, t) { function _(e) { var t = M[e] = {}; return v.each(e.split(y), function (e, n) { t[n] = !0 }), t } function H(e, n, r) { if (r === t && e.nodeType === 1) { var i = "data-" + n.replace(P, "-$1").toLowerCase(); r = e.getAttribute(i); if (typeof r == "string") { try { r = r === "true" ? !0 : r === "false" ? !1 : r === "null" ? null : +r + "" === r ? +r : D.test(r) ? v.parseJSON(r) : r } catch (s) { } v.data(e, n, r) } else r = t } return r } function B(e) { var t; for (t in e) { if (t === "data" && v.isEmptyObject(e[t])) continue; if (t !== "toJSON") return !1 } return !0 } function et() { return !1 } function tt() { return !0 } function ut(e) { return !e || !e.parentNode || e.parentNode.nodeType === 11 } function at(e, t) { do e = e[t]; while (e && e.nodeType !== 1); return e } function ft(e, t, n) { t = t || 0; if (v.isFunction(t)) return v.grep(e, function (e, r) { var i = !!t.call(e, r, e); return i === n }); if (t.nodeType) return v.grep(e, function (e, r) { return e === t === n }); if (typeof t == "string") { var r = v.grep(e, function (e) { return e.nodeType === 1 }); if (it.test(t)) return v.filter(t, r, !n); t = v.filter(t, r) } return v.grep(e, function (e, r) { return v.inArray(e, t) >= 0 === n }) } function lt(e) { var t = ct.split("|"), n = e.createDocumentFragment(); if (n.createElement) while (t.length) n.createElement(t.pop()); return n } function Lt(e, t) { return e.getElementsByTagName(t)[0] || e.appendChild(e.ownerDocument.createElement(t)) } function At(e, t) { if (t.nodeType !== 1 || !v.hasData(e)) return; var n, r, i, s = v._data(e), o = v._data(t, s), u = s.events; if (u) { delete o.handle, o.events = {}; for (n in u) for (r = 0, i = u[n].length; r < i; r++) v.event.add(t, n, u[n][r]) } o.data && (o.data = v.extend({}, o.data)) } function Ot(e, t) { var n; if (t.nodeType !== 1) return; t.clearAttributes && t.clearAttributes(), t.mergeAttributes && t.mergeAttributes(e), n = t.nodeName.toLowerCase(), n === "object" ? (t.parentNode && (t.outerHTML = e.outerHTML), v.support.html5Clone && e.innerHTML && !v.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : n === "input" && Et.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : n === "option" ? t.selected = e.defaultSelected : n === "input" || n === "textarea" ? t.defaultValue = e.defaultValue : n === "script" && t.text !== e.text && (t.text = e.text), t.removeAttribute(v.expando) } function Mt(e) { return typeof e.getElementsByTagName != "undefined" ? e.getElementsByTagName("*") : typeof e.querySelectorAll != "undefined" ? e.querySelectorAll("*") : [] } function _t(e) { Et.test(e.type) && (e.defaultChecked = e.checked) } function Qt(e, t) { if (t in e) return t; var n = t.charAt(0).toUpperCase() + t.slice(1), r = t, i = Jt.length; while (i--) { t = Jt[i] + n; if (t in e) return t } return r } function Gt(e, t) { return e = t || e, v.css(e, "display") === "none" || !v.contains(e.ownerDocument, e) } function Yt(e, t) { var n, r, i = [], s = 0, o = e.length; for (; s < o; s++) { n = e[s]; if (!n.style) continue; i[s] = v._data(n, "olddisplay"), t ? (!i[s] && n.style.display === "none" && (n.style.display = ""), n.style.display === "" && Gt(n) && (i[s] = v._data(n, "olddisplay", nn(n.nodeName)))) : (r = Dt(n, "display"), !i[s] && r !== "none" && v._data(n, "olddisplay", r)) } for (s = 0; s < o; s++) { n = e[s]; if (!n.style) continue; if (!t || n.style.display === "none" || n.style.display === "") n.style.display = t ? i[s] || "" : "none" } return e } function Zt(e, t, n) { var r = Rt.exec(t); return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t } function en(e, t, n, r) { var i = n === (r ? "border" : "content") ? 4 : t === "width" ? 1 : 0, s = 0; for (; i < 4; i += 2) n === "margin" && (s += v.css(e, n + $t[i], !0)), r ? (n === "content" && (s -= parseFloat(Dt(e, "padding" + $t[i])) || 0), n !== "margin" && (s -= parseFloat(Dt(e, "border" + $t[i] + "Width")) || 0)) : (s += parseFloat(Dt(e, "padding" + $t[i])) || 0, n !== "padding" && (s += parseFloat(Dt(e, "border" + $t[i] + "Width")) || 0)); return s } function tn(e, t, n) { var r = t === "width" ? e.offsetWidth : e.offsetHeight, i = !0, s = v.support.boxSizing && v.css(e, "boxSizing") === "border-box"; if (r <= 0 || r == null) { r = Dt(e, t); if (r < 0 || r == null) r = e.style[t]; if (Ut.test(r)) return r; i = s && (v.support.boxSizingReliable || r === e.style[t]), r = parseFloat(r) || 0 } return r + en(e, t, n || (s ? "border" : "content"), i) + "px" } function nn(e) { if (Wt[e]) return Wt[e]; var t = v("<" + e + ">").appendTo(i.body), n = t.css("display"); t.remove(); if (n === "none" || n === "") { Pt = i.body.appendChild(Pt || v.extend(i.createElement("iframe"), { frameBorder: 0, width: 0, height: 0 })); if (!Ht || !Pt.createElement) Ht = (Pt.contentWindow || Pt.contentDocument).document, Ht.write("<!doctype html><html><body>"), Ht.close(); t = Ht.body.appendChild(Ht.createElement(e)), n = Dt(t, "display"), i.body.removeChild(Pt) } return Wt[e] = n, n } function fn(e, t, n, r) { var i; if (v.isArray(t)) v.each(t, function (t, i) { n || sn.test(e) ? r(e, i) : fn(e + "[" + (typeof i == "object" ? t : "") + "]", i, n, r) }); else if (!n && v.type(t) === "object") for (i in t) fn(e + "[" + i + "]", t[i], n, r); else r(e, t) } function Cn(e) { return function (t, n) { typeof t != "string" && (n = t, t = "*"); var r, i, s, o = t.toLowerCase().split(y), u = 0, a = o.length; if (v.isFunction(n)) for (; u < a; u++) r = o[u], s = /^\+/.test(r), s && (r = r.substr(1) || "*"), i = e[r] = e[r] || [], i[s ? "unshift" : "push"](n) } } function kn(e, n, r, i, s, o) { s = s || n.dataTypes[0], o = o || {}, o[s] = !0; var u, a = e[s], f = 0, l = a ? a.length : 0, c = e === Sn; for (; f < l && (c || !u) ; f++) u = a[f](n, r, i), typeof u == "string" && (!c || o[u] ? u = t : (n.dataTypes.unshift(u), u = kn(e, n, r, i, u, o))); return (c || !u) && !o["*"] && (u = kn(e, n, r, i, "*", o)), u } function Ln(e, n) { var r, i, s = v.ajaxSettings.flatOptions || {}; for (r in n) n[r] !== t && ((s[r] ? e : i || (i = {}))[r] = n[r]); i && v.extend(!0, e, i) } function An(e, n, r) { var i, s, o, u, a = e.contents, f = e.dataTypes, l = e.responseFields; for (s in l) s in r && (n[l[s]] = r[s]); while (f[0] === "*") f.shift(), i === t && (i = e.mimeType || n.getResponseHeader("content-type")); if (i) for (s in a) if (a[s] && a[s].test(i)) { f.unshift(s); break } if (f[0] in r) o = f[0]; else { for (s in r) { if (!f[0] || e.converters[s + " " + f[0]]) { o = s; break } u || (u = s) } o = o || u } if (o) return o !== f[0] && f.unshift(o), r[o] } function On(e, t) { var n, r, i, s, o = e.dataTypes.slice(), u = o[0], a = {}, f = 0; e.dataFilter && (t = e.dataFilter(t, e.dataType)); if (o[1]) for (n in e.converters) a[n.toLowerCase()] = e.converters[n]; for (; i = o[++f];) if (i !== "*") { if (u !== "*" && u !== i) { n = a[u + " " + i] || a["* " + i]; if (!n) for (r in a) { s = r.split(" "); if (s[1] === i) { n = a[u + " " + s[0]] || a["* " + s[0]]; if (n) { n === !0 ? n = a[r] : a[r] !== !0 && (i = s[0], o.splice(f--, 0, i)); break } } } if (n !== !0) if (n && e["throws"]) t = n(t); else try { t = n(t) } catch (l) { return { state: "parsererror", error: n ? l : "No conversion from " + u + " to " + i } } } u = i } return { state: "success", data: t } } function Fn() { try { return new e.XMLHttpRequest } catch (t) { } } function In() { try { return new e.ActiveXObject("Microsoft.XMLHTTP") } catch (t) { } } function $n() { return setTimeout(function () { qn = t }, 0), qn = v.now() } function Jn(e, t) { v.each(t, function (t, n) { var r = (Vn[t] || []).concat(Vn["*"]), i = 0, s = r.length; for (; i < s; i++) if (r[i].call(e, t, n)) return }) } function Kn(e, t, n) { var r, i = 0, s = 0, o = Xn.length, u = v.Deferred().always(function () { delete a.elem }), a = function () { var t = qn || $n(), n = Math.max(0, f.startTime + f.duration - t), r = n / f.duration || 0, i = 1 - r, s = 0, o = f.tweens.length; for (; s < o; s++) f.tweens[s].run(i); return u.notifyWith(e, [f, i, n]), i < 1 && o ? n : (u.resolveWith(e, [f]), !1) }, f = u.promise({ elem: e, props: v.extend({}, t), opts: v.extend(!0, { specialEasing: {} }, n), originalProperties: t, originalOptions: n, startTime: qn || $n(), duration: n.duration, tweens: [], createTween: function (t, n, r) { var i = v.Tween(e, f.opts, t, n, f.opts.specialEasing[t] || f.opts.easing); return f.tweens.push(i), i }, stop: function (t) { var n = 0, r = t ? f.tweens.length : 0; for (; n < r; n++) f.tweens[n].run(1); return t ? u.resolveWith(e, [f, t]) : u.rejectWith(e, [f, t]), this } }), l = f.props; Qn(l, f.opts.specialEasing); for (; i < o; i++) { r = Xn[i].call(f, e, l, f.opts); if (r) return r } return Jn(f, l), v.isFunction(f.opts.start) && f.opts.start.call(e, f), v.fx.timer(v.extend(a, { anim: f, queue: f.opts.queue, elem: e })), f.progress(f.opts.progress).done(f.opts.done, f.opts.complete).fail(f.opts.fail).always(f.opts.always) } function Qn(e, t) { var n, r, i, s, o; for (n in e) { r = v.camelCase(n), i = t[r], s = e[n], v.isArray(s) && (i = s[1], s = e[n] = s[0]), n !== r && (e[r] = s, delete e[n]), o = v.cssHooks[r]; if (o && "expand" in o) { s = o.expand(s), delete e[r]; for (n in s) n in e || (e[n] = s[n], t[n] = i) } else t[r] = i } } function Gn(e, t, n) { var r, i, s, o, u, a, f, l, c, h = this, p = e.style, d = {}, m = [], g = e.nodeType && Gt(e); n.queue || (l = v._queueHooks(e, "fx"), l.unqueued == null && (l.unqueued = 0, c = l.empty.fire, l.empty.fire = function () { l.unqueued || c() }), l.unqueued++, h.always(function () { h.always(function () { l.unqueued--, v.queue(e, "fx").length || l.empty.fire() }) })), e.nodeType === 1 && ("height" in t || "width" in t) && (n.overflow = [p.overflow, p.overflowX, p.overflowY], v.css(e, "display") === "inline" && v.css(e, "float") === "none" && (!v.support.inlineBlockNeedsLayout || nn(e.nodeName) === "inline" ? p.display = "inline-block" : p.zoom = 1)), n.overflow && (p.overflow = "hidden", v.support.shrinkWrapBlocks || h.done(function () { p.overflow = n.overflow[0], p.overflowX = n.overflow[1], p.overflowY = n.overflow[2] })); for (r in t) { s = t[r]; if (Un.exec(s)) { delete t[r], a = a || s === "toggle"; if (s === (g ? "hide" : "show")) continue; m.push(r) } } o = m.length; if (o) { u = v._data(e, "fxshow") || v._data(e, "fxshow", {}), "hidden" in u && (g = u.hidden), a && (u.hidden = !g), g ? v(e).show() : h.done(function () { v(e).hide() }), h.done(function () { var t; v.removeData(e, "fxshow", !0); for (t in d) v.style(e, t, d[t]) }); for (r = 0; r < o; r++) i = m[r], f = h.createTween(i, g ? u[i] : 0), d[i] = u[i] || v.style(e, i), i in u || (u[i] = f.start, g && (f.end = f.start, f.start = i === "width" || i === "height" ? 1 : 0)) } } function Yn(e, t, n, r, i) { return new Yn.prototype.init(e, t, n, r, i) } function Zn(e, t) { var n, r = { height: e }, i = 0; t = t ? 1 : 0; for (; i < 4; i += 2 - t) n = $t[i], r["margin" + n] = r["padding" + n] = e; return t && (r.opacity = r.width = e), r } function tr(e) { return v.isWindow(e) ? e : e.nodeType === 9 ? e.defaultView || e.parentWindow : !1 } var n, r, i = e.document, s = e.location, o = e.navigator, u = e.jQuery, a = e.$, f = Array.prototype.push, l = Array.prototype.slice, c = Array.prototype.indexOf, h = Object.prototype.toString, p = Object.prototype.hasOwnProperty, d = String.prototype.trim, v = function (e, t) { return new v.fn.init(e, t, n) }, m = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, g = /\S/, y = /\s+/, b = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, w = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, E = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, S = /^[\],:{}\s]*$/, x = /(?:^|:|,)(?:\s*\[)+/g, T = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, N = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, C = /^-ms-/, k = /-([\da-z])/gi, L = function (e, t) { return (t + "").toUpperCase() }, A = function () { i.addEventListener ? (i.removeEventListener("DOMContentLoaded", A, !1), v.ready()) : i.readyState === "complete" && (i.detachEvent("onreadystatechange", A), v.ready()) }, O = {}; v.fn = v.prototype = { constructor: v, init: function (e, n, r) { var s, o, u, a; if (!e) return this; if (e.nodeType) return this.context = this[0] = e, this.length = 1, this; if (typeof e == "string") { e.charAt(0) === "<" && e.charAt(e.length - 1) === ">" && e.length >= 3 ? s = [null, e, null] : s = w.exec(e); if (s && (s[1] || !n)) { if (s[1]) return n = n instanceof v ? n[0] : n, a = n && n.nodeType ? n.ownerDocument || n : i, e = v.parseHTML(s[1], a, !0), E.test(s[1]) && v.isPlainObject(n) && this.attr.call(e, n, !0), v.merge(this, e); o = i.getElementById(s[2]); if (o && o.parentNode) { if (o.id !== s[2]) return r.find(e); this.length = 1, this[0] = o } return this.context = i, this.selector = e, this } return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e) } return v.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), v.makeArray(e, this)) }, selector: "", jquery: "1.8.3", length: 0, size: function () { return this.length }, toArray: function () { return l.call(this) }, get: function (e) { return e == null ? this.toArray() : e < 0 ? this[this.length + e] : this[e] }, pushStack: function (e, t, n) { var r = v.merge(this.constructor(), e); return r.prevObject = this, r.context = this.context, t === "find" ? r.selector = this.selector + (this.selector ? " " : "") + n : t && (r.selector = this.selector + "." + t + "(" + n + ")"), r }, each: function (e, t) { return v.each(this, e, t) }, ready: function (e) { return v.ready.promise().done(e), this }, eq: function (e) { return e = +e, e === -1 ? this.slice(e) : this.slice(e, e + 1) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, slice: function () { return this.pushStack(l.apply(this, arguments), "slice", l.call(arguments).join(",")) }, map: function (e) { return this.pushStack(v.map(this, function (t, n) { return e.call(t, n, t) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: f, sort: [].sort, splice: [].splice }, v.fn.init.prototype = v.fn, v.extend = v.fn.extend = function () { var e, n, r, i, s, o, u = arguments[0] || {}, a = 1, f = arguments.length, l = !1; typeof u == "boolean" && (l = u, u = arguments[1] || {}, a = 2), typeof u != "object" && !v.isFunction(u) && (u = {}), f === a && (u = this, --a); for (; a < f; a++) if ((e = arguments[a]) != null) for (n in e) { r = u[n], i = e[n]; if (u === i) continue; l && i && (v.isPlainObject(i) || (s = v.isArray(i))) ? (s ? (s = !1, o = r && v.isArray(r) ? r : []) : o = r && v.isPlainObject(r) ? r : {}, u[n] = v.extend(l, o, i)) : i !== t && (u[n] = i) } return u }, v.extend({ noConflict: function (t) { return e.$ === v && (e.$ = a), t && e.jQuery === v && (e.jQuery = u), v }, isReady: !1, readyWait: 1, holdReady: function (e) { e ? v.readyWait++ : v.ready(!0) }, ready: function (e) { if (e === !0 ? --v.readyWait : v.isReady) return; if (!i.body) return setTimeout(v.ready, 1); v.isReady = !0; if (e !== !0 && --v.readyWait > 0) return; r.resolveWith(i, [v]), v.fn.trigger && v(i).trigger("ready").off("ready") }, isFunction: function (e) { return v.type(e) === "function" }, isArray: Array.isArray || function (e) { return v.type(e) === "array" }, isWindow: function (e) { return e != null && e == e.window }, isNumeric: function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, type: function (e) { return e == null ? String(e) : O[h.call(e)] || "object" }, isPlainObject: function (e) { if (!e || v.type(e) !== "object" || e.nodeType || v.isWindow(e)) return !1; try { if (e.constructor && !p.call(e, "constructor") && !p.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (n) { return !1 } var r; for (r in e); return r === t || p.call(e, r) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, error: function (e) { throw new Error(e) }, parseHTML: function (e, t, n) { var r; return !e || typeof e != "string" ? null : (typeof t == "boolean" && (n = t, t = 0), t = t || i, (r = E.exec(e)) ? [t.createElement(r[1])] : (r = v.buildFragment([e], t, n ? null : []), v.merge([], (r.cacheable ? v.clone(r.fragment) : r.fragment).childNodes))) }, parseJSON: function (t) { if (!t || typeof t != "string") return null; t = v.trim(t); if (e.JSON && e.JSON.parse) return e.JSON.parse(t); if (S.test(t.replace(T, "@").replace(N, "]").replace(x, ""))) return (new Function("return " + t))(); v.error("Invalid JSON: " + t) }, parseXML: function (n) { var r, i; if (!n || typeof n != "string") return null; try { e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n)) } catch (s) { r = t } return (!r || !r.documentElement || r.getElementsByTagName("parsererror").length) && v.error("Invalid XML: " + n), r }, noop: function () { }, globalEval: function (t) { t && g.test(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(C, "ms-").replace(k, L) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, n, r) { var i, s = 0, o = e.length, u = o === t || v.isFunction(e); if (r) { if (u) { for (i in e) if (n.apply(e[i], r) === !1) break } else for (; s < o;) if (n.apply(e[s++], r) === !1) break } else if (u) { for (i in e) if (n.call(e[i], i, e[i]) === !1) break } else for (; s < o;) if (n.call(e[s], s, e[s++]) === !1) break; return e }, trim: d && !d.call("\ufeff\u00a0") ? function (e) { return e == null ? "" : d.call(e) } : function (e) { return e == null ? "" : (e + "").replace(b, "") }, makeArray: function (e, t) { var n, r = t || []; return e != null && (n = v.type(e), e.length == null || n === "string" || n === "function" || n === "regexp" || v.isWindow(e) ? f.call(r, e) : v.merge(r, e)), r }, inArray: function (e, t, n) { var r; if (t) { if (c) return c.call(t, e, n); r = t.length, n = n ? n < 0 ? Math.max(0, r + n) : n : 0; for (; n < r; n++) if (n in t && t[n] === e) return n } return -1 }, merge: function (e, n) { var r = n.length, i = e.length, s = 0; if (typeof r == "number") for (; s < r; s++) e[i++] = n[s]; else while (n[s] !== t) e[i++] = n[s++]; return e.length = i, e }, grep: function (e, t, n) { var r, i = [], s = 0, o = e.length; n = !!n; for (; s < o; s++) r = !!t(e[s], s), n !== r && i.push(e[s]); return i }, map: function (e, n, r) { var i, s, o = [], u = 0, a = e.length, f = e instanceof v || a !== t && typeof a == "number" && (a > 0 && e[0] && e[a - 1] || a === 0 || v.isArray(e)); if (f) for (; u < a; u++) i = n(e[u], u, r), i != null && (o[o.length] = i); else for (s in e) i = n(e[s], s, r), i != null && (o[o.length] = i); return o.concat.apply([], o) }, guid: 1, proxy: function (e, n) { var r, i, s; return typeof n == "string" && (r = e[n], n = e, e = r), v.isFunction(e) ? (i = l.call(arguments, 2), s = function () { return e.apply(n, i.concat(l.call(arguments))) }, s.guid = e.guid = e.guid || v.guid++, s) : t }, access: function (e, n, r, i, s, o, u) { var a, f = r == null, l = 0, c = e.length; if (r && typeof r == "object") { for (l in r) v.access(e, n, l, r[l], 1, o, i); s = 1 } else if (i !== t) { a = u === t && v.isFunction(i), f && (a ? (a = n, n = function (e, t, n) { return a.call(v(e), n) }) : (n.call(e, i), n = null)); if (n) for (; l < c; l++) n(e[l], r, a ? i.call(e[l], l, n(e[l], r)) : i, u); s = 1 } return s ? e : f ? n.call(e) : c ? n(e[0], r) : o }, now: function () { return (new Date).getTime() } }), v.ready.promise = function (t) { if (!r) { r = v.Deferred(); if (i.readyState === "complete") setTimeout(v.ready, 1); else if (i.addEventListener) i.addEventListener("DOMContentLoaded", A, !1), e.addEventListener("load", v.ready, !1); else { i.attachEvent("onreadystatechange", A), e.attachEvent("onload", v.ready); var n = !1; try { n = e.frameElement == null && i.documentElement } catch (s) { } n && n.doScroll && function o() { if (!v.isReady) { try { n.doScroll("left") } catch (e) { return setTimeout(o, 50) } v.ready() } }() } } return r.promise(t) }, v.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (e, t) { O["[object " + t + "]"] = t.toLowerCase() }), n = v(i); var M = {}; v.Callbacks = function (e) { e = typeof e == "string" ? M[e] || _(e) : v.extend({}, e); var n, r, i, s, o, u, a = [], f = !e.once && [], l = function (t) { n = e.memory && t, r = !0, u = s || 0, s = 0, o = a.length, i = !0; for (; a && u < o; u++) if (a[u].apply(t[0], t[1]) === !1 && e.stopOnFalse) { n = !1; break } i = !1, a && (f ? f.length && l(f.shift()) : n ? a = [] : c.disable()) }, c = { add: function () { if (a) { var t = a.length; (function r(t) { v.each(t, function (t, n) { var i = v.type(n); i === "function" ? (!e.unique || !c.has(n)) && a.push(n) : n && n.length && i !== "string" && r(n) }) })(arguments), i ? o = a.length : n && (s = t, l(n)) } return this }, remove: function () { return a && v.each(arguments, function (e, t) { var n; while ((n = v.inArray(t, a, n)) > -1) a.splice(n, 1), i && (n <= o && o--, n <= u && u--) }), this }, has: function (e) { return v.inArray(e, a) > -1 }, empty: function () { return a = [], this }, disable: function () { return a = f = n = t, this }, disabled: function () { return !a }, lock: function () { return f = t, n || c.disable(), this }, locked: function () { return !f }, fireWith: function (e, t) { return t = t || [], t = [e, t.slice ? t.slice() : t], a && (!r || f) && (i ? f.push(t) : l(t)), this }, fire: function () { return c.fireWith(this, arguments), this }, fired: function () { return !!r } }; return c }, v.extend({ Deferred: function (e) { var t = [["resolve", "done", v.Callbacks("once memory"), "resolved"], ["reject", "fail", v.Callbacks("once memory"), "rejected"], ["notify", "progress", v.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return v.Deferred(function (n) { v.each(t, function (t, r) { var s = r[0], o = e[t]; i[r[1]](v.isFunction(o) ? function () { var e = o.apply(this, arguments); e && v.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === i ? n : this, [e]) } : n[s]) }), e = null }).promise() }, promise: function (e) { return e != null ? v.extend(e, r) : r } }, i = {}; return r.pipe = r.then, v.each(t, function (e, s) { var o = s[2], u = s[3]; r[s[1]] = o.add, u && o.add(function () { n = u }, t[e ^ 1][2].disable, t[2][2].lock), i[s[0]] = o.fire, i[s[0] + "With"] = o.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t = 0, n = l.call(arguments), r = n.length, i = r !== 1 || e && v.isFunction(e.promise) ? r : 0, s = i === 1 ? e : v.Deferred(), o = function (e, t, n) { return function (r) { t[e] = this, n[e] = arguments.length > 1 ? l.call(arguments) : r, n === u ? s.notifyWith(t, n) : --i || s.resolveWith(t, n) } }, u, a, f; if (r > 1) { u = new Array(r), a = new Array(r), f = new Array(r); for (; t < r; t++) n[t] && v.isFunction(n[t].promise) ? n[t].promise().done(o(t, f, n)).fail(s.reject).progress(o(t, a, u)) : --i } return i || s.resolveWith(f, n), s.promise() } }), v.support = function () { var t, n, r, s, o, u, a, f, l, c, h, p = i.createElement("div"); p.setAttribute("className", "t"), p.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = p.getElementsByTagName("*"), r = p.getElementsByTagName("a")[0]; if (!n || !r || !n.length) return {}; s = i.createElement("select"), o = s.appendChild(i.createElement("option")), u = p.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t = { leadingWhitespace: p.firstChild.nodeType === 3, tbody: !p.getElementsByTagName("tbody").length, htmlSerialize: !!p.getElementsByTagName("link").length, style: /top/.test(r.getAttribute("style")), hrefNormalized: r.getAttribute("href") === "/a", opacity: /^0.5/.test(r.style.opacity), cssFloat: !!r.style.cssFloat, checkOn: u.value === "on", optSelected: o.selected, getSetAttribute: p.className !== "t", enctype: !!i.createElement("form").enctype, html5Clone: i.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>", boxModel: i.compatMode === "CSS1Compat", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, boxSizingReliable: !0, pixelPosition: !1 }, u.checked = !0, t.noCloneChecked = u.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !o.disabled; try { delete p.test } catch (d) { t.deleteExpando = !1 } !p.addEventListener && p.attachEvent && p.fireEvent && (p.attachEvent("onclick", h = function () { t.noCloneEvent = !1 }), p.cloneNode(!0).fireEvent("onclick"), p.detachEvent("onclick", h)), u = i.createElement("input"), u.value = "t", u.setAttribute("type", "radio"), t.radioValue = u.value === "t", u.setAttribute("checked", "checked"), u.setAttribute("name", "t"), p.appendChild(u), a = i.createDocumentFragment(), a.appendChild(p.lastChild), t.checkClone = a.cloneNode(!0).cloneNode(!0).lastChild.checked, t.appendChecked = u.checked, a.removeChild(u), a.appendChild(p); if (p.attachEvent) for (l in { submit: !0, change: !0, focusin: !0 }) f = "on" + l, c = f in p, c || (p.setAttribute(f, "return;"), c = typeof p[f] == "function"), t[l + "Bubbles"] = c; return v(function () { var n, r, s, o, u = "padding:0;margin:0;border:0;display:block;overflow:hidden;", a = i.getElementsByTagName("body")[0]; if (!a) return; n = i.createElement("div"), n.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", a.insertBefore(n, a.firstChild), r = i.createElement("div"), n.appendChild(r), r.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", s = r.getElementsByTagName("td"), s[0].style.cssText = "padding:0;margin:0;border:0;display:none", c = s[0].offsetHeight === 0, s[0].style.display = "", s[1].style.display = "none", t.reliableHiddenOffsets = c && s[0].offsetHeight === 0, r.innerHTML = "", r.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", t.boxSizing = r.offsetWidth === 4, t.doesNotIncludeMarginInBodyOffset = a.offsetTop !== 1, e.getComputedStyle && (t.pixelPosition = (e.getComputedStyle(r, null) || {}).top !== "1%", t.boxSizingReliable = (e.getComputedStyle(r, null) || { width: "4px" }).width === "4px", o = i.createElement("div"), o.style.cssText = r.style.cssText = u, o.style.marginRight = o.style.width = "0", r.style.width = "1px", r.appendChild(o), t.reliableMarginRight = !parseFloat((e.getComputedStyle(o, null) || {}).marginRight)), typeof r.style.zoom != "undefined" && (r.innerHTML = "", r.style.cssText = u + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = r.offsetWidth === 3, r.style.display = "block", r.style.overflow = "visible", r.innerHTML = "<div></div>", r.firstChild.style.width = "5px", t.shrinkWrapBlocks = r.offsetWidth !== 3, n.style.zoom = 1), a.removeChild(n), n = r = s = o = null }), a.removeChild(p), n = r = s = o = u = a = p = null, t }(); var D = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, P = /([A-Z])/g; v.extend({ cache: {}, deletedIds: [], uuid: 0, expando: "jQuery" + (v.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (e) { return e = e.nodeType ? v.cache[e[v.expando]] : e[v.expando], !!e && !B(e) }, data: function (e, n, r, i) { if (!v.acceptData(e)) return; var s, o, u = v.expando, a = typeof n == "string", f = e.nodeType, l = f ? v.cache : e, c = f ? e[u] : e[u] && u; if ((!c || !l[c] || !i && !l[c].data) && a && r === t) return; c || (f ? e[u] = c = v.deletedIds.pop() || v.guid++ : c = u), l[c] || (l[c] = {}, f || (l[c].toJSON = v.noop)); if (typeof n == "object" || typeof n == "function") i ? l[c] = v.extend(l[c], n) : l[c].data = v.extend(l[c].data, n); return s = l[c], i || (s.data || (s.data = {}), s = s.data), r !== t && (s[v.camelCase(n)] = r), a ? (o = s[n], o == null && (o = s[v.camelCase(n)])) : o = s, o }, removeData: function (e, t, n) { if (!v.acceptData(e)) return; var r, i, s, o = e.nodeType, u = o ? v.cache : e, a = o ? e[v.expando] : v.expando; if (!u[a]) return; if (t) { r = n ? u[a] : u[a].data; if (r) { v.isArray(t) || (t in r ? t = [t] : (t = v.camelCase(t), t in r ? t = [t] : t = t.split(" "))); for (i = 0, s = t.length; i < s; i++) delete r[t[i]]; if (!(n ? B : v.isEmptyObject)(r)) return } } if (!n) { delete u[a].data; if (!B(u[a])) return } o ? v.cleanData([e], !0) : v.support.deleteExpando || u != u.window ? delete u[a] : u[a] = null }, _data: function (e, t, n) { return v.data(e, t, n, !0) }, acceptData: function (e) { var t = e.nodeName && v.noData[e.nodeName.toLowerCase()]; return !t || t !== !0 && e.getAttribute("classid") === t } }), v.fn.extend({ data: function (e, n) { var r, i, s, o, u, a = this[0], f = 0, l = null; if (e === t) { if (this.length) { l = v.data(a); if (a.nodeType === 1 && !v._data(a, "parsedAttrs")) { s = a.attributes; for (u = s.length; f < u; f++) o = s[f].name, o.indexOf("data-") || (o = v.camelCase(o.substring(5)), H(a, o, l[o])); v._data(a, "parsedAttrs", !0) } } return l } return typeof e == "object" ? this.each(function () { v.data(this, e) }) : (r = e.split(".", 2), r[1] = r[1] ? "." + r[1] : "", i = r[1] + "!", v.access(this, function (n) { if (n === t) return l = this.triggerHandler("getData" + i, [r[0]]), l === t && a && (l = v.data(a, e), l = H(a, e, l)), l === t && r[1] ? this.data(r[0]) : l; r[1] = n, this.each(function () { var t = v(this); t.triggerHandler("setData" + i, r), v.data(this, e, n), t.triggerHandler("changeData" + i, r) }) }, null, n, arguments.length > 1, null, !1)) }, removeData: function (e) { return this.each(function () { v.removeData(this, e) }) } }), v.extend({ queue: function (e, t, n) { var r; if (e) return t = (t || "fx") + "queue", r = v._data(e, t), n && (!r || v.isArray(n) ? r = v._data(e, t, v.makeArray(n)) : r.push(n)), r || [] }, dequeue: function (e, t) { t = t || "fx"; var n = v.queue(e, t), r = n.length, i = n.shift(), s = v._queueHooks(e, t), o = function () { v.dequeue(e, t) }; i === "inprogress" && (i = n.shift(), r--), i && (t === "fx" && n.unshift("inprogress"), delete s.stop, i.call(e, o, s)), !r && s && s.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return v._data(e, n) || v._data(e, n, { empty: v.Callbacks("once memory").add(function () { v.removeData(e, t + "queue", !0), v.removeData(e, n, !0) }) }) } }), v.fn.extend({ queue: function (e, n) { var r = 2; return typeof e != "string" && (n = e, e = "fx", r--), arguments.length < r ? v.queue(this[0], e) : n === t ? this : this.each(function () { var t = v.queue(this, e, n); v._queueHooks(this, e), e === "fx" && t[0] !== "inprogress" && v.dequeue(this, e) }) }, dequeue: function (e) { return this.each(function () { v.dequeue(this, e) }) }, delay: function (e, t) { return e = v.fx ? v.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) { var r = setTimeout(t, e); n.stop = function () { clearTimeout(r) } }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, n) { var r, i = 1, s = v.Deferred(), o = this, u = this.length, a = function () { --i || s.resolveWith(o, [o]) }; typeof e != "string" && (n = e, e = t), e = e || "fx"; while (u--) r = v._data(o[u], e + "queueHooks"), r && r.empty && (i++, r.empty.add(a)); return a(), s.promise(n) } }); var j, F, I, q = /[\t\r\n]/g, R = /\r/g, U = /^(?:button|input)$/i, z = /^(?:button|input|object|select|textarea)$/i, W = /^a(?:rea|)$/i, X = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, V = v.support.getSetAttribute; v.fn.extend({ attr: function (e, t) { return v.access(this, v.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each(function () { v.removeAttr(this, e) }) }, prop: function (e, t) { return v.access(this, v.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return e = v.propFix[e] || e, this.each(function () { try { this[e] = t, delete this[e] } catch (n) { } }) }, addClass: function (e) { var t, n, r, i, s, o, u; if (v.isFunction(e)) return this.each(function (t) { v(this).addClass(e.call(this, t, this.className)) }); if (e && typeof e == "string") { t = e.split(y); for (n = 0, r = this.length; n < r; n++) { i = this[n]; if (i.nodeType === 1) if (!i.className && t.length === 1) i.className = e; else { s = " " + i.className + " "; for (o = 0, u = t.length; o < u; o++) s.indexOf(" " + t[o] + " ") < 0 && (s += t[o] + " "); i.className = v.trim(s) } } } return this }, removeClass: function (e) { var n, r, i, s, o, u, a; if (v.isFunction(e)) return this.each(function (t) { v(this).removeClass(e.call(this, t, this.className)) }); if (e && typeof e == "string" || e === t) { n = (e || "").split(y); for (u = 0, a = this.length; u < a; u++) { i = this[u]; if (i.nodeType === 1 && i.className) { r = (" " + i.className + " ").replace(q, " "); for (s = 0, o = n.length; s < o; s++) while (r.indexOf(" " + n[s] + " ") >= 0) r = r.replace(" " + n[s] + " ", " "); i.className = e ? v.trim(r) : "" } } } return this }, toggleClass: function (e, t) { var n = typeof e, r = typeof t == "boolean"; return v.isFunction(e) ? this.each(function (n) { v(this).toggleClass(e.call(this, n, this.className, t), t) }) : this.each(function () { if (n === "string") { var i, s = 0, o = v(this), u = t, a = e.split(y); while (i = a[s++]) u = r ? u : !o.hasClass(i), o[u ? "addClass" : "removeClass"](i) } else if (n === "undefined" || n === "boolean") this.className && v._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : v._data(this, "__className__") || "" }) }, hasClass: function (e) { var t = " " + e + " ", n = 0, r = this.length; for (; n < r; n++) if (this[n].nodeType === 1 && (" " + this[n].className + " ").replace(q, " ").indexOf(t) >= 0) return !0; return !1 }, val: function (e) { var n, r, i, s = this[0]; if (!arguments.length) { if (s) return n = v.valHooks[s.type] || v.valHooks[s.nodeName.toLowerCase()], n && "get" in n && (r = n.get(s, "value")) !== t ? r : (r = s.value, typeof r == "string" ? r.replace(R, "") : r == null ? "" : r); return } return i = v.isFunction(e), this.each(function (r) { var s, o = v(this); if (this.nodeType !== 1) return; i ? s = e.call(this, r, o.val()) : s = e, s == null ? s = "" : typeof s == "number" ? s += "" : v.isArray(s) && (s = v.map(s, function (e) { return e == null ? "" : e + "" })), n = v.valHooks[this.type] || v.valHooks[this.nodeName.toLowerCase()]; if (!n || !("set" in n) || n.set(this, s, "value") === t) this.value = s }) } }), v.extend({ valHooks: { option: { get: function (e) { var t = e.attributes.value; return !t || t.specified ? e.value : e.text } }, select: { get: function (e) { var t, n, r = e.options, i = e.selectedIndex, s = e.type === "select-one" || i < 0, o = s ? null : [], u = s ? i + 1 : r.length, a = i < 0 ? u : s ? i : 0; for (; a < u; a++) { n = r[a]; if ((n.selected || a === i) && (v.support.optDisabled ? !n.disabled : n.getAttribute("disabled") === null) && (!n.parentNode.disabled || !v.nodeName(n.parentNode, "optgroup"))) { t = v(n).val(); if (s) return t; o.push(t) } } return o }, set: function (e, t) { var n = v.makeArray(t); return v(e).find("option").each(function () { this.selected = v.inArray(v(this).val(), n) >= 0 }), n.length || (e.selectedIndex = -1), n } } }, attrFn: {}, attr: function (e, n, r, i) { var s, o, u, a = e.nodeType; if (!e || a === 3 || a === 8 || a === 2) return; if (i && v.isFunction(v.fn[n])) return v(e)[n](r); if (typeof e.getAttribute == "undefined") return v.prop(e, n, r); u = a !== 1 || !v.isXMLDoc(e), u && (n = n.toLowerCase(), o = v.attrHooks[n] || (X.test(n) ? F : j)); if (r !== t) { if (r === null) { v.removeAttr(e, n); return } return o && "set" in o && u && (s = o.set(e, r, n)) !== t ? s : (e.setAttribute(n, r + ""), r) } return o && "get" in o && u && (s = o.get(e, n)) !== null ? s : (s = e.getAttribute(n), s === null ? t : s) }, removeAttr: function (e, t) { var n, r, i, s, o = 0; if (t && e.nodeType === 1) { r = t.split(y); for (; o < r.length; o++) i = r[o], i && (n = v.propFix[i] || i, s = X.test(i), s || v.attr(e, i, ""), e.removeAttribute(V ? i : n), s && n in e && (e[n] = !1)) } }, attrHooks: { type: { set: function (e, t) { if (U.test(e.nodeName) && e.parentNode) v.error("type property can't be changed"); else if (!v.support.radioValue && t === "radio" && v.nodeName(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } }, value: { get: function (e, t) { return j && v.nodeName(e, "button") ? j.get(e, t) : t in e ? e.value : null }, set: function (e, t, n) { if (j && v.nodeName(e, "button")) return j.set(e, t, n); e.value = t } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (e, n, r) { var i, s, o, u = e.nodeType; if (!e || u === 3 || u === 8 || u === 2) return; return o = u !== 1 || !v.isXMLDoc(e), o && (n = v.propFix[n] || n, s = v.propHooks[n]), r !== t ? s && "set" in s && (i = s.set(e, r, n)) !== t ? i : e[n] = r : s && "get" in s && (i = s.get(e, n)) !== null ? i : e[n] }, propHooks: { tabIndex: { get: function (e) { var n = e.getAttributeNode("tabindex"); return n && n.specified ? parseInt(n.value, 10) : z.test(e.nodeName) || W.test(e.nodeName) && e.href ? 0 : t } } } }), F = { get: function (e, n) { var r, i = v.prop(e, n); return i === !0 || typeof i != "boolean" && (r = e.getAttributeNode(n)) && r.nodeValue !== !1 ? n.toLowerCase() : t }, set: function (e, t, n) { var r; return t === !1 ? v.removeAttr(e, n) : (r = v.propFix[n] || n, r in e && (e[r] = !0), e.setAttribute(n, n.toLowerCase())), n } }, V || (I = { name: !0, id: !0, coords: !0 }, j = v.valHooks.button = { get: function (e, n) { var r; return r = e.getAttributeNode(n), r && (I[n] ? r.value !== "" : r.specified) ? r.value : t }, set: function (e, t, n) { var r = e.getAttributeNode(n); return r || (r = i.createAttribute(n), e.setAttributeNode(r)), r.value = t + "" } }, v.each(["width", "height"], function (e, t) { v.attrHooks[t] = v.extend(v.attrHooks[t], { set: function (e, n) { if (n === "") return e.setAttribute(t, "auto"), n } }) }), v.attrHooks.contenteditable = { get: j.get, set: function (e, t, n) { t === "" && (t = "false"), j.set(e, t, n) } }), v.support.hrefNormalized || v.each(["href", "src", "width", "height"], function (e, n) { v.attrHooks[n] = v.extend(v.attrHooks[n], { get: function (e) { var r = e.getAttribute(n, 2); return r === null ? t : r } }) }), v.support.style || (v.attrHooks.style = { get: function (e) { return e.style.cssText.toLowerCase() || t }, set: function (e, t) { return e.style.cssText = t + "" } }), v.support.optSelected || (v.propHooks.selected = v.extend(v.propHooks.selected, { get: function (e) { var t = e.parentNode; return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null } })), v.support.enctype || (v.propFix.enctype = "encoding"), v.support.checkOn || v.each(["radio", "checkbox"], function () { v.valHooks[this] = { get: function (e) { return e.getAttribute("value") === null ? "on" : e.value } } }), v.each(["radio", "checkbox"], function () { v.valHooks[this] = v.extend(v.valHooks[this], { set: function (e, t) { if (v.isArray(t)) return e.checked = v.inArray(v(e).val(), t) >= 0 } }) }); var $ = /^(?:textarea|input|select)$/i, J = /^([^\.]*|)(?:\.(.+)|)$/, K = /(?:^|\s)hover(\.\S+|)\b/, Q = /^key/, G = /^(?:mouse|contextmenu)|click/, Y = /^(?:focusinfocus|focusoutblur)$/, Z = function (e) { return v.event.special.hover ? e : e.replace(K, "mouseenter$1 mouseleave$1") }; v.event = { add: function (e, n, r, i, s) { var o, u, a, f, l, c, h, p, d, m, g; if (e.nodeType === 3 || e.nodeType === 8 || !n || !r || !(o = v._data(e))) return; r.handler && (d = r, r = d.handler, s = d.selector), r.guid || (r.guid = v.guid++), a = o.events, a || (o.events = a = {}), u = o.handle, u || (o.handle = u = function (e) { return typeof v == "undefined" || !!e && v.event.triggered === e.type ? t : v.event.dispatch.apply(u.elem, arguments) }, u.elem = e), n = v.trim(Z(n)).split(" "); for (f = 0; f < n.length; f++) { l = J.exec(n[f]) || [], c = l[1], h = (l[2] || "").split(".").sort(), g = v.event.special[c] || {}, c = (s ? g.delegateType : g.bindType) || c, g = v.event.special[c] || {}, p = v.extend({ type: c, origType: l[1], data: i, handler: r, guid: r.guid, selector: s, needsContext: s && v.expr.match.needsContext.test(s), namespace: h.join(".") }, d), m = a[c]; if (!m) { m = a[c] = [], m.delegateCount = 0; if (!g.setup || g.setup.call(e, i, h, u) === !1) e.addEventListener ? e.addEventListener(c, u, !1) : e.attachEvent && e.attachEvent("on" + c, u) } g.add && (g.add.call(e, p), p.handler.guid || (p.handler.guid = r.guid)), s ? m.splice(m.delegateCount++, 0, p) : m.push(p), v.event.global[c] = !0 } e = null }, global: {}, remove: function (e, t, n, r, i) { var s, o, u, a, f, l, c, h, p, d, m, g = v.hasData(e) && v._data(e); if (!g || !(h = g.events)) return; t = v.trim(Z(t || "")).split(" "); for (s = 0; s < t.length; s++) { o = J.exec(t[s]) || [], u = a = o[1], f = o[2]; if (!u) { for (u in h) v.event.remove(e, u + t[s], n, r, !0); continue } p = v.event.special[u] || {}, u = (r ? p.delegateType : p.bindType) || u, d = h[u] || [], l = d.length, f = f ? new RegExp("(^|\\.)" + f.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; for (c = 0; c < d.length; c++) m = d[c], (i || a === m.origType) && (!n || n.guid === m.guid) && (!f || f.test(m.namespace)) && (!r || r === m.selector || r === "**" && m.selector) && (d.splice(c--, 1), m.selector && d.delegateCount--, p.remove && p.remove.call(e, m)); d.length === 0 && l !== d.length && ((!p.teardown || p.teardown.call(e, f, g.handle) === !1) && v.removeEvent(e, u, g.handle), delete h[u]) } v.isEmptyObject(h) && (delete g.handle, v.removeData(e, "events", !0)) }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (n, r, s, o) { if (!s || s.nodeType !== 3 && s.nodeType !== 8) { var u, a, f, l, c, h, p, d, m, g, y = n.type || n, b = []; if (Y.test(y + v.event.triggered)) return; y.indexOf("!") >= 0 && (y = y.slice(0, -1), a = !0), y.indexOf(".") >= 0 && (b = y.split("."), y = b.shift(), b.sort()); if ((!s || v.event.customEvent[y]) && !v.event.global[y]) return; n = typeof n == "object" ? n[v.expando] ? n : new v.Event(y, n) : new v.Event(y), n.type = y, n.isTrigger = !0, n.exclusive = a, n.namespace = b.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, h = y.indexOf(":") < 0 ? "on" + y : ""; if (!s) { u = v.cache; for (f in u) u[f].events && u[f].events[y] && v.event.trigger(n, r, u[f].handle.elem, !0); return } n.result = t, n.target || (n.target = s), r = r != null ? v.makeArray(r) : [], r.unshift(n), p = v.event.special[y] || {}; if (p.trigger && p.trigger.apply(s, r) === !1) return; m = [[s, p.bindType || y]]; if (!o && !p.noBubble && !v.isWindow(s)) { g = p.delegateType || y, l = Y.test(g + y) ? s : s.parentNode; for (c = s; l; l = l.parentNode) m.push([l, g]), c = l; c === (s.ownerDocument || i) && m.push([c.defaultView || c.parentWindow || e, g]) } for (f = 0; f < m.length && !n.isPropagationStopped() ; f++) l = m[f][0], n.type = m[f][1], d = (v._data(l, "events") || {})[n.type] && v._data(l, "handle"), d && d.apply(l, r), d = h && l[h], d && v.acceptData(l) && d.apply && d.apply(l, r) === !1 && n.preventDefault(); return n.type = y, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(s.ownerDocument, r) === !1) && (y !== "click" || !v.nodeName(s, "a")) && v.acceptData(s) && h && s[y] && (y !== "focus" && y !== "blur" || n.target.offsetWidth !== 0) && !v.isWindow(s) && (c = s[h], c && (s[h] = null), v.event.triggered = y, s[y](), v.event.triggered = t, c && (s[h] = c)), n.result } return }, dispatch: function (n) { n = v.event.fix(n || e.event); var r, i, s, o, u, a, f, c, h, p, d = (v._data(this, "events") || {})[n.type] || [], m = d.delegateCount, g = l.call(arguments), y = !n.exclusive && !n.namespace, b = v.event.special[n.type] || {}, w = []; g[0] = n, n.delegateTarget = this; if (b.preDispatch && b.preDispatch.call(this, n) === !1) return; if (m && (!n.button || n.type !== "click")) for (s = n.target; s != this; s = s.parentNode || this) if (s.disabled !== !0 || n.type !== "click") { u = {}, f = []; for (r = 0; r < m; r++) c = d[r], h = c.selector, u[h] === t && (u[h] = c.needsContext ? v(h, this).index(s) >= 0 : v.find(h, this, null, [s]).length), u[h] && f.push(c); f.length && w.push({ elem: s, matches: f }) } d.length > m && w.push({ elem: this, matches: d.slice(m) }); for (r = 0; r < w.length && !n.isPropagationStopped() ; r++) { a = w[r], n.currentTarget = a.elem; for (i = 0; i < a.matches.length && !n.isImmediatePropagationStopped() ; i++) { c = a.matches[i]; if (y || !n.namespace && !c.namespace || n.namespace_re && n.namespace_re.test(c.namespace)) n.data = c.data, n.handleObj = c, o = ((v.event.special[c.origType] || {}).handle || c.handler).apply(a.elem, g), o !== t && (n.result = o, o === !1 && (n.preventDefault(), n.stopPropagation())) } } return b.postDispatch && b.postDispatch.call(this, n), n.result }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return e.which == null && (e.which = t.charCode != null ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, n) { var r, s, o, u = n.button, a = n.fromElement; return e.pageX == null && n.clientX != null && (r = e.target.ownerDocument || i, s = r.documentElement, o = r.body, e.pageX = n.clientX + (s && s.scrollLeft || o && o.scrollLeft || 0) - (s && s.clientLeft || o && o.clientLeft || 0), e.pageY = n.clientY + (s && s.scrollTop || o && o.scrollTop || 0) - (s && s.clientTop || o && o.clientTop || 0)), !e.relatedTarget && a && (e.relatedTarget = a === e.target ? n.toElement : a), !e.which && u !== t && (e.which = u & 1 ? 1 : u & 2 ? 3 : u & 4 ? 2 : 0), e } }, fix: function (e) { if (e[v.expando]) return e; var t, n, r = e, s = v.event.fixHooks[e.type] || {}, o = s.props ? this.props.concat(s.props) : this.props; e = v.Event(r); for (t = o.length; t;) n = o[--t], e[n] = r[n]; return e.target || (e.target = r.srcElement || i), e.target.nodeType === 3 && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, s.filter ? s.filter(e, r) : e }, special: { load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (e, t, n) { v.isWindow(this) && (this.onbeforeunload = n) }, teardown: function (e, t) { this.onbeforeunload === t && (this.onbeforeunload = null) } } }, simulate: function (e, t, n, r) { var i = v.extend(new v.Event, n, { type: e, isSimulated: !0, originalEvent: {} }); r ? v.event.trigger(i, null, t) : v.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault() } }, v.event.handle = v.event.dispatch, v.removeEvent = i.removeEventListener ? function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1) } : function (e, t, n) { var r = "on" + t; e.detachEvent && (typeof e[r] == "undefined" && (e[r] = null), e.detachEvent(r, n)) }, v.Event = function (e, t) { if (!(this instanceof v.Event)) return new v.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? tt : et) : this.type = e, t && v.extend(this, t), this.timeStamp = e && e.timeStamp || v.now(), this[v.expando] = !0 }, v.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = tt; var e = this.originalEvent; if (!e) return; e.preventDefault ? e.preventDefault() : e.returnValue = !1 }, stopPropagation: function () { this.isPropagationStopped = tt; var e = this.originalEvent; if (!e) return; e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0 }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = tt, this.stopPropagation() }, isDefaultPrevented: et, isPropagationStopped: et, isImmediatePropagationStopped: et }, v.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (e, t) { v.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var n, r = this, i = e.relatedTarget, s = e.handleObj, o = s.selector; if (!i || i !== r && !v.contains(r, i)) e.type = s.origType, n = s.handler.apply(this, arguments), e.type = t; return n } } }), v.support.submitBubbles || (v.event.special.submit = { setup: function () { if (v.nodeName(this, "form")) return !1; v.event.add(this, "click._submit keypress._submit", function (e) { var n = e.target, r = v.nodeName(n, "input") || v.nodeName(n, "button") ? n.form : t; r && !v._data(r, "_submit_attached") && (v.event.add(r, "submit._submit", function (e) { e._submit_bubble = !0 }), v._data(r, "_submit_attached", !0)) }) }, postDispatch: function (e) { e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && v.event.simulate("submit", this.parentNode, e, !0)) }, teardown: function () { if (v.nodeName(this, "form")) return !1; v.event.remove(this, "._submit") } }), v.support.changeBubbles || (v.event.special.change = { setup: function () { if ($.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") v.event.add(this, "propertychange._change", function (e) { e.originalEvent.propertyName === "checked" && (this._just_changed = !0) }), v.event.add(this, "click._change", function (e) { this._just_changed && !e.isTrigger && (this._just_changed = !1), v.event.simulate("change", this, e, !0) }); return !1 } v.event.add(this, "beforeactivate._change", function (e) { var t = e.target; $.test(t.nodeName) && !v._data(t, "_change_attached") && (v.event.add(t, "change._change", function (e) { this.parentNode && !e.isSimulated && !e.isTrigger && v.event.simulate("change", this.parentNode, e, !0) }), v._data(t, "_change_attached", !0)) }) }, handle: function (e) { var t = e.target; if (this !== t || e.isSimulated || e.isTrigger || t.type !== "radio" && t.type !== "checkbox") return e.handleObj.handler.apply(this, arguments) }, teardown: function () { return v.event.remove(this, "._change"), !$.test(this.nodeName) } }), v.support.focusinBubbles || v.each({ focus: "focusin", blur: "focusout" }, function (e, t) { var n = 0, r = function (e) { v.event.simulate(t, e.target, v.event.fix(e), !0) }; v.event.special[t] = { setup: function () { n++ === 0 && i.addEventListener(e, r, !0) }, teardown: function () { --n === 0 && i.removeEventListener(e, r, !0) } } }), v.fn.extend({ on: function (e, n, r, i, s) { var o, u; if (typeof e == "object") { typeof n != "string" && (r = r || n, n = t); for (u in e) this.on(u, n, r, e[u], s); return this } r == null && i == null ? (i = n, r = n = t) : i == null && (typeof n == "string" ? (i = r, r = t) : (i = r, r = n, n = t)); if (i === !1) i = et; else if (!i) return this; return s === 1 && (o = i, i = function (e) { return v().off(e), o.apply(this, arguments) }, i.guid = o.guid || (o.guid = v.guid++)), this.each(function () { v.event.add(this, e, i, r, n) }) }, one: function (e, t, n, r) { return this.on(e, t, n, r, 1) }, off: function (e, n, r) { var i, s; if (e && e.preventDefault && e.handleObj) return i = e.handleObj, v(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this; if (typeof e == "object") { for (s in e) this.off(s, n, e[s]); return this } if (n === !1 || typeof n == "function") r = n, n = t; return r === !1 && (r = et), this.each(function () { v.event.remove(this, e, r, n) }) }, bind: function (e, t, n) { return this.on(e, null, t, n) }, unbind: function (e, t) { return this.off(e, null, t) }, live: function (e, t, n) { return v(this.context).on(e, this.selector, t, n), this }, die: function (e, t) { return v(this.context).off(e, this.selector || "**", t), this }, delegate: function (e, t, n, r) { return this.on(t, e, n, r) }, undelegate: function (e, t, n) { return arguments.length === 1 ? this.off(e, "**") : this.off(t, e || "**", n) }, trigger: function (e, t) { return this.each(function () { v.event.trigger(e, t, this) }) }, triggerHandler: function (e, t) { if (this[0]) return v.event.trigger(e, t, this[0], !0) }, toggle: function (e) { var t = arguments, n = e.guid || v.guid++, r = 0, i = function (n) { var i = (v._data(this, "lastToggle" + e.guid) || 0) % r; return v._data(this, "lastToggle" + e.guid, i + 1), n.preventDefault(), t[i].apply(this, arguments) || !1 }; i.guid = n; while (r < t.length) t[r++].guid = n; return this.click(i) }, hover: function (e, t) { return this.mouseenter(e).mouseleave(t || e) } }), v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) { v.fn[t] = function (e, n) { return n == null && (n = e, e = null), arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t) }, Q.test(t) && (v.event.fixHooks[t] = v.event.keyHooks), G.test(t) && (v.event.fixHooks[t] = v.event.mouseHooks) }), function (e, t) { function nt(e, t, n, r) { n = n || [], t = t || g; var i, s, a, f, l = t.nodeType; if (!e || typeof e != "string") return n; if (l !== 1 && l !== 9) return []; a = o(t); if (!a && !r) if (i = R.exec(e)) if (f = i[1]) { if (l === 9) { s = t.getElementById(f); if (!s || !s.parentNode) return n; if (s.id === f) return n.push(s), n } else if (t.ownerDocument && (s = t.ownerDocument.getElementById(f)) && u(t, s) && s.id === f) return n.push(s), n } else { if (i[2]) return S.apply(n, x.call(t.getElementsByTagName(e), 0)), n; if ((f = i[3]) && Z && t.getElementsByClassName) return S.apply(n, x.call(t.getElementsByClassName(f), 0)), n } return vt(e.replace(j, "$1"), t, n, r, a) } function rt(e) { return function (t) { var n = t.nodeName.toLowerCase(); return n === "input" && t.type === e } } function it(e) { return function (t) { var n = t.nodeName.toLowerCase(); return (n === "input" || n === "button") && t.type === e } } function st(e) { return N(function (t) { return t = +t, N(function (n, r) { var i, s = e([], n.length, t), o = s.length; while (o--) n[i = s[o]] && (n[i] = !(r[i] = n[i])) }) }) } function ot(e, t, n) { if (e === t) return n; var r = e.nextSibling; while (r) { if (r === t) return -1; r = r.nextSibling } return 1 } function ut(e, t) { var n, r, s, o, u, a, f, l = L[d][e + " "]; if (l) return t ? 0 : l.slice(0); u = e, a = [], f = i.preFilter; while (u) { if (!n || (r = F.exec(u))) r && (u = u.slice(r[0].length) || u), a.push(s = []); n = !1; if (r = I.exec(u)) s.push(n = new m(r.shift())), u = u.slice(n.length), n.type = r[0].replace(j, " "); for (o in i.filter) (r = J[o].exec(u)) && (!f[o] || (r = f[o](r))) && (s.push(n = new m(r.shift())), u = u.slice(n.length), n.type = o, n.matches = r); if (!n) break } return t ? u.length : u ? nt.error(e) : L(e, a).slice(0) } function at(e, t, r) { var i = t.dir, s = r && t.dir === "parentNode", o = w++; return t.first ? function (t, n, r) { while (t = t[i]) if (s || t.nodeType === 1) return e(t, n, r) } : function (t, r, u) { if (!u) { var a, f = b + " " + o + " ", l = f + n; while (t = t[i]) if (s || t.nodeType === 1) { if ((a = t[d]) === l) return t.sizset; if (typeof a == "string" && a.indexOf(f) === 0) { if (t.sizset) return t } else { t[d] = l; if (e(t, r, u)) return t.sizset = !0, t; t.sizset = !1 } } } else while (t = t[i]) if (s || t.nodeType === 1) if (e(t, r, u)) return t } } function ft(e) { return e.length > 1 ? function (t, n, r) { var i = e.length; while (i--) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function lt(e, t, n, r, i) { var s, o = [], u = 0, a = e.length, f = t != null; for (; u < a; u++) if (s = e[u]) if (!n || n(s, r, i)) o.push(s), f && t.push(u); return o } function ct(e, t, n, r, i, s) { return r && !r[d] && (r = ct(r)), i && !i[d] && (i = ct(i, s)), N(function (s, o, u, a) { var f, l, c, h = [], p = [], d = o.length, v = s || dt(t || "*", u.nodeType ? [u] : u, []), m = e && (s || !t) ? lt(v, h, e, u, a) : v, g = n ? i || (s ? e : d || r) ? [] : o : m; n && n(m, g, u, a); if (r) { f = lt(g, p), r(f, [], u, a), l = f.length; while (l--) if (c = f[l]) g[p[l]] = !(m[p[l]] = c) } if (s) { if (i || e) { if (i) { f = [], l = g.length; while (l--) (c = g[l]) && f.push(m[l] = c); i(null, g = [], f, a) } l = g.length; while (l--) (c = g[l]) && (f = i ? T.call(s, c) : h[l]) > -1 && (s[f] = !(o[f] = c)) } } else g = lt(g === o ? g.splice(d, g.length) : g), i ? i(null, o, g, a) : S.apply(o, g) }) } function ht(e) { var t, n, r, s = e.length, o = i.relative[e[0].type], u = o || i.relative[" "], a = o ? 1 : 0, f = at(function (e) { return e === t }, u, !0), l = at(function (e) { return T.call(t, e) > -1 }, u, !0), h = [function (e, n, r) { return !o && (r || n !== c) || ((t = n).nodeType ? f(e, n, r) : l(e, n, r)) }]; for (; a < s; a++) if (n = i.relative[e[a].type]) h = [at(ft(h), n)]; else { n = i.filter[e[a].type].apply(null, e[a].matches); if (n[d]) { r = ++a; for (; r < s; r++) if (i.relative[e[r].type]) break; return ct(a > 1 && ft(h), a > 1 && e.slice(0, a - 1).join("").replace(j, "$1"), n, a < r && ht(e.slice(a, r)), r < s && ht(e = e.slice(r)), r < s && e.join("")) } h.push(n) } return ft(h) } function pt(e, t) { var r = t.length > 0, s = e.length > 0, o = function (u, a, f, l, h) { var p, d, v, m = [], y = 0, w = "0", x = u && [], T = h != null, N = c, C = u || s && i.find.TAG("*", h && a.parentNode || a), k = b += N == null ? 1 : Math.E; T && (c = a !== g && a, n = o.el); for (; (p = C[w]) != null; w++) { if (s && p) { for (d = 0; v = e[d]; d++) if (v(p, a, f)) { l.push(p); break } T && (b = k, n = ++o.el) } r && ((p = !v && p) && y--, u && x.push(p)) } y += w; if (r && w !== y) { for (d = 0; v = t[d]; d++) v(x, m, a, f); if (u) { if (y > 0) while (w--) !x[w] && !m[w] && (m[w] = E.call(l)); m = lt(m) } S.apply(l, m), T && !u && m.length > 0 && y + t.length > 1 && nt.uniqueSort(l) } return T && (b = k, c = N), x }; return o.el = 0, r ? N(o) : o } function dt(e, t, n) { var r = 0, i = t.length; for (; r < i; r++) nt(e, t[r], n); return n } function vt(e, t, n, r, s) { var o, u, f, l, c, h = ut(e), p = h.length; if (!r && h.length === 1) { u = h[0] = h[0].slice(0); if (u.length > 2 && (f = u[0]).type === "ID" && t.nodeType === 9 && !s && i.relative[u[1].type]) { t = i.find.ID(f.matches[0].replace($, ""), t, s)[0]; if (!t) return n; e = e.slice(u.shift().length) } for (o = J.POS.test(e) ? -1 : u.length - 1; o >= 0; o--) { f = u[o]; if (i.relative[l = f.type]) break; if (c = i.find[l]) if (r = c(f.matches[0].replace($, ""), z.test(u[0].type) && t.parentNode || t, s)) { u.splice(o, 1), e = r.length && u.join(""); if (!e) return S.apply(n, x.call(r, 0)), n; break } } } return a(e, h)(r, t, s, n, z.test(e)), n } function mt() { } var n, r, i, s, o, u, a, f, l, c, h = !0, p = "undefined", d = ("sizcache" + Math.random()).replace(".", ""), m = String, g = e.document, y = g.documentElement, b = 0, w = 0, E = [].pop, S = [].push, x = [].slice, T = [].indexOf || function (e) { var t = 0, n = this.length; for (; t < n; t++) if (this[t] === e) return t; return -1 }, N = function (e, t) { return e[d] = t == null || t, e }, C = function () { var e = {}, t = []; return N(function (n, r) { return t.push(n) > i.cacheLength && delete e[t.shift()], e[n + " "] = r }, e) }, k = C(), L = C(), A = C(), O = "[\\x20\\t\\r\\n\\f]", M = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", _ = M.replace("w", "w#"), D = "([*^$|!~]?=)", P = "\\[" + O + "*(" + M + ")" + O + "*(?:" + D + O + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + _ + ")|)|)" + O + "*\\]", H = ":(" + M + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + P + ")|[^:]|\\\\.)*|.*))\\)|)", B = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + O + "*((?:-\\d)?\\d*)" + O + "*\\)|)(?=[^-]|$)", j = new RegExp("^" + O + "+|((?:^|[^\\\\])(?:\\\\.)*)" + O + "+$", "g"), F = new RegExp("^" + O + "*," + O + "*"), I = new RegExp("^" + O + "*([\\x20\\t\\r\\n\\f>+~])" + O + "*"), q = new RegExp(H), R = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, U = /^:not/, z = /[\x20\t\r\n\f]*[+~]/, W = /:not\($/, X = /h\d/i, V = /input|select|textarea|button/i, $ = /\\(?!\\)/g, J = { ID: new RegExp("^#(" + M + ")"), CLASS: new RegExp("^\\.(" + M + ")"), NAME: new RegExp("^\\[name=['\"]?(" + M + ")['\"]?\\]"), TAG: new RegExp("^(" + M.replace("w", "w*") + ")"), ATTR: new RegExp("^" + P), PSEUDO: new RegExp("^" + H), POS: new RegExp(B, "i"), CHILD: new RegExp("^:(only|nth|first|last)-child(?:\\(" + O + "*(even|odd|(([+-]|)(\\d*)n|)" + O + "*(?:([+-]|)" + O + "*(\\d+)|))" + O + "*\\)|)", "i"), needsContext: new RegExp("^" + O + "*[>+~]|" + B, "i") }, K = function (e) { var t = g.createElement("div"); try { return e(t) } catch (n) { return !1 } finally { t = null } }, Q = K(function (e) { return e.appendChild(g.createComment("")), !e.getElementsByTagName("*").length }), G = K(function (e) { return e.innerHTML = "<a href='#'></a>", e.firstChild && typeof e.firstChild.getAttribute !== p && e.firstChild.getAttribute("href") === "#" }), Y = K(function (e) { e.innerHTML = "<select></select>"; var t = typeof e.lastChild.getAttribute("multiple"); return t !== "boolean" && t !== "string" }), Z = K(function (e) { return e.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !e.getElementsByClassName || !e.getElementsByClassName("e").length ? !1 : (e.lastChild.className = "e", e.getElementsByClassName("e").length === 2) }), et = K(function (e) { e.id = d + 0, e.innerHTML = "<a name='" + d + "'></a><div name='" + d + "'></div>", y.insertBefore(e, y.firstChild); var t = g.getElementsByName && g.getElementsByName(d).length === 2 + g.getElementsByName(d + 0).length; return r = !g.getElementById(d), y.removeChild(e), t }); try { x.call(y.childNodes, 0)[0].nodeType } catch (tt) { x = function (e) { var t, n = []; for (; t = this[e]; e++) n.push(t); return n } } nt.matches = function (e, t) { return nt(e, null, null, t) }, nt.matchesSelector = function (e, t) { return nt(t, null, null, [e]).length > 0 }, s = nt.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (i === 1 || i === 9 || i === 11) { if (typeof e.textContent == "string") return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += s(e) } else if (i === 3 || i === 4) return e.nodeValue } else for (; t = e[r]; r++) n += s(t); return n }, o = nt.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return t ? t.nodeName !== "HTML" : !1 }, u = nt.contains = y.contains ? function (e, t) { var n = e.nodeType === 9 ? e.documentElement : e, r = t && t.parentNode; return e === r || !!(r && r.nodeType === 1 && n.contains && n.contains(r)) } : y.compareDocumentPosition ? function (e, t) { return t && !!(e.compareDocumentPosition(t) & 16) } : function (e, t) { while (t = t.parentNode) if (t === e) return !0; return !1 }, nt.attr = function (e, t) { var n, r = o(e); return r || (t = t.toLowerCase()), (n = i.attrHandle[t]) ? n(e) : r || Y ? e.getAttribute(t) : (n = e.getAttributeNode(t), n ? typeof e[t] == "boolean" ? e[t] ? t : null : n.specified ? n.value : null : null) }, i = nt.selectors = { cacheLength: 50, createPseudo: N, match: J, attrHandle: G ? {} : { href: function (e) { return e.getAttribute("href", 2) }, type: function (e) { return e.getAttribute("type") } }, find: { ID: r ? function (e, t, n) { if (typeof t.getElementById !== p && !n) { var r = t.getElementById(e); return r && r.parentNode ? [r] : [] } } : function (e, n, r) { if (typeof n.getElementById !== p && !r) { var i = n.getElementById(e); return i ? i.id === e || typeof i.getAttributeNode !== p && i.getAttributeNode("id").value === e ? [i] : t : [] } }, TAG: Q ? function (e, t) { if (typeof t.getElementsByTagName !== p) return t.getElementsByTagName(e) } : function (e, t) { var n = t.getElementsByTagName(e); if (e === "*") { var r, i = [], s = 0; for (; r = n[s]; s++) r.nodeType === 1 && i.push(r); return i } return n }, NAME: et && function (e, t) { if (typeof t.getElementsByName !== p) return t.getElementsByName(name) }, CLASS: Z && function (e, t, n) { if (typeof t.getElementsByClassName !== p && !n) return t.getElementsByClassName(e) } }, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace($, ""), e[3] = (e[4] || e[5] || "").replace($, ""), e[2] === "~=" && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), e[1] === "nth" ? (e[2] || nt.error(e[0]), e[3] = +(e[3] ? e[4] + (e[5] || 1) : 2 * (e[2] === "even" || e[2] === "odd")), e[4] = +(e[6] + e[7] || e[2] === "odd")) : e[2] && nt.error(e[0]), e }, PSEUDO: function (e) { var t, n; if (J.CHILD.test(e[0])) return null; if (e[3]) e[2] = e[3]; else if (t = e[4]) q.test(t) && (n = ut(t, !0)) && (n = t.indexOf(")", t.length - n) - t.length) && (t = t.slice(0, n), e[0] = e[0].slice(0, n)), e[2] = t; return e.slice(0, 3) } }, filter: { ID: r ? function (e) { return e = e.replace($, ""), function (t) { return t.getAttribute("id") === e } } : function (e) { return e = e.replace($, ""), function (t) { var n = typeof t.getAttributeNode !== p && t.getAttributeNode("id"); return n && n.value === e } }, TAG: function (e) { return e === "*" ? function () { return !0 } : (e = e.replace($, "").toLowerCase(), function (t) { return t.nodeName && t.nodeName.toLowerCase() === e }) }, CLASS: function (e) { var t = k[d][e + " "]; return t || (t = new RegExp("(^|" + O + ")" + e + "(" + O + "|$)")) && k(e, function (e) { return t.test(e.className || typeof e.getAttribute !== p && e.getAttribute("class") || "") }) }, ATTR: function (e, t, n) { return function (r, i) { var s = nt.attr(r, e); return s == null ? t === "!=" : t ? (s += "", t === "=" ? s === n : t === "!=" ? s !== n : t === "^=" ? n && s.indexOf(n) === 0 : t === "*=" ? n && s.indexOf(n) > -1 : t === "$=" ? n && s.substr(s.length - n.length) === n : t === "~=" ? (" " + s + " ").indexOf(n) > -1 : t === "|=" ? s === n || s.substr(0, n.length + 1) === n + "-" : !1) : !0 } }, CHILD: function (e, t, n, r) { return e === "nth" ? function (e) { var t, i, s = e.parentNode; if (n === 1 && r === 0) return !0; if (s) { i = 0; for (t = s.firstChild; t; t = t.nextSibling) if (t.nodeType === 1) { i++; if (e === t) break } } return i -= r, i === n || i % n === 0 && i / n >= 0 } : function (t) { var n = t; switch (e) { case "only": case "first": while (n = n.previousSibling) if (n.nodeType === 1) return !1; if (e === "first") return !0; n = t; case "last": while (n = n.nextSibling) if (n.nodeType === 1) return !1; return !0 } } }, PSEUDO: function (e, t) { var n, r = i.pseudos[e] || i.setFilters[e.toLowerCase()] || nt.error("unsupported pseudo: " + e); return r[d] ? r(t) : r.length > 1 ? (n = [e, e, "", t], i.setFilters.hasOwnProperty(e.toLowerCase()) ? N(function (e, n) { var i, s = r(e, t), o = s.length; while (o--) i = T.call(e, s[o]), e[i] = !(n[i] = s[o]) }) : function (e) { return r(e, 0, n) }) : r } }, pseudos: { not: N(function (e) { var t = [], n = [], r = a(e.replace(j, "$1")); return r[d] ? N(function (e, t, n, i) { var s, o = r(e, null, i, []), u = e.length; while (u--) if (s = o[u]) e[u] = !(t[u] = s) }) : function (e, i, s) { return t[0] = e, r(t, null, s, n), !n.pop() } }), has: N(function (e) { return function (t) { return nt(e, t).length > 0 } }), contains: N(function (e) { return function (t) { return (t.textContent || t.innerText || s(t)).indexOf(e) > -1 } }), enabled: function (e) { return e.disabled === !1 }, disabled: function (e) { return e.disabled === !0 }, checked: function (e) { var t = e.nodeName.toLowerCase(); return t === "input" && !!e.checked || t === "option" && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, e.selected === !0 }, parent: function (e) { return !i.pseudos.empty(e) }, empty: function (e) { var t; e = e.firstChild; while (e) { if (e.nodeName > "@" || (t = e.nodeType) === 3 || t === 4) return !1; e = e.nextSibling } return !0 }, header: function (e) { return X.test(e.nodeName) }, text: function (e) { var t, n; return e.nodeName.toLowerCase() === "input" && (t = e.type) === "text" && ((n = e.getAttribute("type")) == null || n.toLowerCase() === t) }, radio: rt("radio"), checkbox: rt("checkbox"), file: rt("file"), password: rt("password"), image: rt("image"), submit: it("submit"), reset: it("reset"), button: function (e) { var t = e.nodeName.toLowerCase(); return t === "input" && e.type === "button" || t === "button" }, input: function (e) { return V.test(e.nodeName) }, focus: function (e) { var t = e.ownerDocument; return e === t.activeElement && (!t.hasFocus || t.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, active: function (e) { return e === e.ownerDocument.activeElement }, first: st(function () { return [0] }), last: st(function (e, t) { return [t - 1] }), eq: st(function (e, t, n) { return [n < 0 ? n + t : n] }), even: st(function (e, t) { for (var n = 0; n < t; n += 2) e.push(n); return e }), odd: st(function (e, t) { for (var n = 1; n < t; n += 2) e.push(n); return e }), lt: st(function (e, t, n) { for (var r = n < 0 ? n + t : n; --r >= 0;) e.push(r); return e }), gt: st(function (e, t, n) { for (var r = n < 0 ? n + t : n; ++r < t;) e.push(r); return e }) } }, f = y.compareDocumentPosition ? function (e, t) { return e === t ? (l = !0, 0) : (!e.compareDocumentPosition || !t.compareDocumentPosition ? e.compareDocumentPosition : e.compareDocumentPosition(t) & 4) ? -1 : 1 } : function (e, t) { if (e === t) return l = !0, 0; if (e.sourceIndex && t.sourceIndex) return e.sourceIndex - t.sourceIndex; var n, r, i = [], s = [], o = e.parentNode, u = t.parentNode, a = o; if (o === u) return ot(e, t); if (!o) return -1; if (!u) return 1; while (a) i.unshift(a), a = a.parentNode; a = u; while (a) s.unshift(a), a = a.parentNode; n = i.length, r = s.length; for (var f = 0; f < n && f < r; f++) if (i[f] !== s[f]) return ot(i[f], s[f]); return f === n ? ot(e, s[f], -1) : ot(i[f], t, 1) }, [0, 0].sort(f), h = !l, nt.uniqueSort = function (e) { var t, n = [], r = 1, i = 0; l = h, e.sort(f); if (l) { for (; t = e[r]; r++) t === e[r - 1] && (i = n.push(r)); while (i--) e.splice(n[i], 1) } return e }, nt.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, a = nt.compile = function (e, t) { var n, r = [], i = [], s = A[d][e + " "]; if (!s) { t || (t = ut(e)), n = t.length; while (n--) s = ht(t[n]), s[d] ? r.push(s) : i.push(s); s = A(e, pt(i, r)) } return s }, g.querySelectorAll && function () { var e, t = vt, n = /'|\\/g, r = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, i = [":focus"], s = [":active"], u = y.matchesSelector || y.mozMatchesSelector || y.webkitMatchesSelector || y.oMatchesSelector || y.msMatchesSelector; K(function (e) { e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || i.push("\\[" + O + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), e.querySelectorAll(":checked").length || i.push(":checked") }), K(function (e) { e.innerHTML = "<p test=''></p>", e.querySelectorAll("[test^='']").length && i.push("[*^$]=" + O + "*(?:\"\"|'')"), e.innerHTML = "<input type='hidden'/>", e.querySelectorAll(":enabled").length || i.push(":enabled", ":disabled") }), i = new RegExp(i.join("|")), vt = function (e, r, s, o, u) { if (!o && !u && !i.test(e)) { var a, f, l = !0, c = d, h = r, p = r.nodeType === 9 && e; if (r.nodeType === 1 && r.nodeName.toLowerCase() !== "object") { a = ut(e), (l = r.getAttribute("id")) ? c = l.replace(n, "\\$&") : r.setAttribute("id", c), c = "[id='" + c + "'] ", f = a.length; while (f--) a[f] = c + a[f].join(""); h = z.test(e) && r.parentNode || r, p = a.join(",") } if (p) try { return S.apply(s, x.call(h.querySelectorAll(p), 0)), s } catch (v) { } finally { l || r.removeAttribute("id") } } return t(e, r, s, o, u) }, u && (K(function (t) { e = u.call(t, "div"); try { u.call(t, "[test!='']:sizzle"), s.push("!=", H) } catch (n) { } }), s = new RegExp(s.join("|")), nt.matchesSelector = function (t, n) { n = n.replace(r, "='$1']"); if (!o(t) && !s.test(n) && !i.test(n)) try { var a = u.call(t, n); if (a || e || t.document && t.document.nodeType !== 11) return a } catch (f) { } return nt(n, null, null, [t]).length > 0 }) }(), i.pseudos.nth = i.pseudos.eq, i.filters = mt.prototype = i.pseudos, i.setFilters = new mt, nt.attr = v.attr, v.find = nt, v.expr = nt.selectors, v.expr[":"] = v.expr.pseudos, v.unique = nt.uniqueSort, v.text = nt.getText, v.isXMLDoc = nt.isXML, v.contains = nt.contains }(e); var nt = /Until$/, rt = /^(?:parents|prev(?:Until|All))/, it = /^.[^:#\[\.,]*$/, st = v.expr.match.needsContext, ot = { children: !0, contents: !0, next: !0, prev: !0 }; v.fn.extend({ find: function (e) { var t, n, r, i, s, o, u = this; if (typeof e != "string") return v(e).filter(function () { for (t = 0, n = u.length; t < n; t++) if (v.contains(u[t], this)) return !0 }); o = this.pushStack("", "find", e); for (t = 0, n = this.length; t < n; t++) { r = o.length, v.find(e, this[t], o); if (t > 0) for (i = r; i < o.length; i++) for (s = 0; s < r; s++) if (o[s] === o[i]) { o.splice(i--, 1); break } } return o }, has: function (e) { var t, n = v(e, this), r = n.length; return this.filter(function () { for (t = 0; t < r; t++) if (v.contains(this, n[t])) return !0 }) }, not: function (e) { return this.pushStack(ft(this, e, !1), "not", e) }, filter: function (e) { return this.pushStack(ft(this, e, !0), "filter", e) }, is: function (e) { return !!e && (typeof e == "string" ? st.test(e) ? v(e, this.context).index(this[0]) >= 0 : v.filter(e, this).length > 0 : this.filter(e).length > 0) }, closest: function (e, t) { var n, r = 0, i = this.length, s = [], o = st.test(e) || typeof e != "string" ? v(e, t || this.context) : 0; for (; r < i; r++) { n = this[r]; while (n && n.ownerDocument && n !== t && n.nodeType !== 11) { if (o ? o.index(n) > -1 : v.find.matchesSelector(n, e)) { s.push(n); break } n = n.parentNode } } return s = s.length > 1 ? v.unique(s) : s, this.pushStack(s, "closest", e) }, index: function (e) { return e ? typeof e == "string" ? v.inArray(this[0], v(e)) : v.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1 }, add: function (e, t) { var n = typeof e == "string" ? v(e, t) : v.makeArray(e && e.nodeType ? [e] : e), r = v.merge(this.get(), n); return this.pushStack(ut(n[0]) || ut(r[0]) ? r : v.unique(r)) }, addBack: function (e) { return this.add(e == null ? this.prevObject : this.prevObject.filter(e)) } }), v.fn.andSelf = v.fn.addBack, v.each({ parent: function (e) { var t = e.parentNode; return t && t.nodeType !== 11 ? t : null }, parents: function (e) { return v.dir(e, "parentNode") }, parentsUntil: function (e, t, n) { return v.dir(e, "parentNode", n) }, next: function (e) { return at(e, "nextSibling") }, prev: function (e) { return at(e, "previousSibling") }, nextAll: function (e) { return v.dir(e, "nextSibling") }, prevAll: function (e) { return v.dir(e, "previousSibling") }, nextUntil: function (e, t, n) { return v.dir(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return v.dir(e, "previousSibling", n) }, siblings: function (e) { return v.sibling((e.parentNode || {}).firstChild, e) }, children: function (e) { return v.sibling(e.firstChild) }, contents: function (e) { return v.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : v.merge([], e.childNodes) } }, function (e, t) { v.fn[e] = function (n, r) { var i = v.map(this, t, n); return nt.test(e) || (r = n), r && typeof r == "string" && (i = v.filter(r, i)), i = this.length > 1 && !ot[e] ? v.unique(i) : i, this.length > 1 && rt.test(e) && (i = i.reverse()), this.pushStack(i, e, l.call(arguments).join(",")) } }), v.extend({ filter: function (e, t, n) { return n && (e = ":not(" + e + ")"), t.length === 1 ? v.find.matchesSelector(t[0], e) ? [t[0]] : [] : v.find.matches(e, t) }, dir: function (e, n, r) { var i = [], s = e[n]; while (s && s.nodeType !== 9 && (r === t || s.nodeType !== 1 || !v(s).is(r))) s.nodeType === 1 && i.push(s), s = s[n]; return i }, sibling: function (e, t) { var n = []; for (; e; e = e.nextSibling) e.nodeType === 1 && e !== t && n.push(e); return n } }); var ct = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", ht = / jQuery\d+="(?:null|\d+)"/g, pt = /^\s+/, dt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, vt = /<([\w:]+)/, mt = /<tbody/i, gt = /<|&#?\w+;/, yt = /<(?:script|style|link)/i, bt = /<(?:script|object|embed|option|style)/i, wt = new RegExp("<(?:" + ct + ")[\\s/>]", "i"), Et = /^(?:checkbox|radio)$/, St = /checked\s*(?:[^=]|=\s*.checked.)/i, xt = /\/(java|ecma)script/i, Tt = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, Nt = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], area: [1, "<map>", "</map>"], _default: [0, "", ""] }, Ct = lt(i), kt = Ct.appendChild(i.createElement("div")); Nt.optgroup = Nt.option, Nt.tbody = Nt.tfoot = Nt.colgroup = Nt.caption = Nt.thead, Nt.th = Nt.td, v.support.htmlSerialize || (Nt._default = [1, "X<div>", "</div>"]), v.fn.extend({ text: function (e) { return v.access(this, function (e) { return e === t ? v.text(this) : this.empty().append((this[0] && this[0].ownerDocument || i).createTextNode(e)) }, null, e, arguments.length) }, wrapAll: function (e) { if (v.isFunction(e)) return this.each(function (t) { v(this).wrapAll(e.call(this, t)) }); if (this[0]) { var t = v(e, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstChild && e.firstChild.nodeType === 1) e = e.firstChild; return e }).append(this) } return this }, wrapInner: function (e) { return v.isFunction(e) ? this.each(function (t) { v(this).wrapInner(e.call(this, t)) }) : this.each(function () { var t = v(this), n = t.contents(); n.length ? n.wrapAll(e) : t.append(e) }) }, wrap: function (e) { var t = v.isFunction(e); return this.each(function (n) { v(this).wrapAll(t ? e.call(this, n) : e) }) }, unwrap: function () { return this.parent().each(function () { v.nodeName(this, "body") || v(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (e) { (this.nodeType === 1 || this.nodeType === 11) && this.appendChild(e) }) }, prepend: function () { return this.domManip(arguments, !0, function (e) { (this.nodeType === 1 || this.nodeType === 11) && this.insertBefore(e, this.firstChild) }) }, before: function () { if (!ut(this[0])) return this.domManip(arguments, !1, function (e) { this.parentNode.insertBefore(e, this) }); if (arguments.length) { var e = v.clean(arguments); return this.pushStack(v.merge(e, this), "before", this.selector) } }, after: function () { if (!ut(this[0])) return this.domManip(arguments, !1, function (e) { this.parentNode.insertBefore(e, this.nextSibling) }); if (arguments.length) { var e = v.clean(arguments); return this.pushStack(v.merge(this, e), "after", this.selector) } }, remove: function (e, t) { var n, r = 0; for (; (n = this[r]) != null; r++) if (!e || v.filter(e, [n]).length) !t && n.nodeType === 1 && (v.cleanData(n.getElementsByTagName("*")), v.cleanData([n])), n.parentNode && n.parentNode.removeChild(n); return this }, empty: function () { var e, t = 0; for (; (e = this[t]) != null; t++) { e.nodeType === 1 && v.cleanData(e.getElementsByTagName("*")); while (e.firstChild) e.removeChild(e.firstChild) } return this }, clone: function (e, t) { return e = e == null ? !1 : e, t = t == null ? e : t, this.map(function () { return v.clone(this, e, t) }) }, html: function (e) { return v.access(this, function (e) { var n = this[0] || {}, r = 0, i = this.length; if (e === t) return n.nodeType === 1 ? n.innerHTML.replace(ht, "") : t; if (typeof e == "string" && !yt.test(e) && (v.support.htmlSerialize || !wt.test(e)) && (v.support.leadingWhitespace || !pt.test(e)) && !Nt[(vt.exec(e) || ["", ""])[1].toLowerCase()]) { e = e.replace(dt, "<$1></$2>"); try { for (; r < i; r++) n = this[r] || {}, n.nodeType === 1 && (v.cleanData(n.getElementsByTagName("*")), n.innerHTML = e); n = 0 } catch (s) { } } n && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function (e) { return ut(this[0]) ? this.length ? this.pushStack(v(v.isFunction(e) ? e() : e), "replaceWith", e) : this : v.isFunction(e) ? this.each(function (t) { var n = v(this), r = n.html(); n.replaceWith(e.call(this, t, r)) }) : (typeof e != "string" && (e = v(e).detach()), this.each(function () { var t = this.nextSibling, n = this.parentNode; v(this).remove(), t ? v(t).before(e) : v(n).append(e) })) }, detach: function (e) { return this.remove(e, !0) }, domManip: function (e, n, r) { e = [].concat.apply([], e); var i, s, o, u, a = 0, f = e[0], l = [], c = this.length; if (!v.support.checkClone && c > 1 && typeof f == "string" && St.test(f)) return this.each(function () { v(this).domManip(e, n, r) }); if (v.isFunction(f)) return this.each(function (i) { var s = v(this); e[0] = f.call(this, i, n ? s.html() : t), s.domManip(e, n, r) }); if (this[0]) { i = v.buildFragment(e, this, l), o = i.fragment, s = o.firstChild, o.childNodes.length === 1 && (o = s); if (s) { n = n && v.nodeName(s, "tr"); for (u = i.cacheable || c - 1; a < c; a++) r.call(n && v.nodeName(this[a], "table") ? Lt(this[a], "tbody") : this[a], a === u ? o : v.clone(o, !0, !0)) } o = s = null, l.length && v.each(l, function (e, t) { t.src ? v.ajax ? v.ajax({ url: t.src, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) : v.error("no ajax") : v.globalEval((t.text || t.textContent || t.innerHTML || "").replace(Tt, "")), t.parentNode && t.parentNode.removeChild(t) }) } return this } }), v.buildFragment = function (e, n, r) { var s, o, u, a = e[0]; return n = n || i, n = !n.nodeType && n[0] || n, n = n.ownerDocument || n, e.length === 1 && typeof a == "string" && a.length < 512 && n === i && a.charAt(0) === "<" && !bt.test(a) && (v.support.checkClone || !St.test(a)) && (v.support.html5Clone || !wt.test(a)) && (o = !0, s = v.fragments[a], u = s !== t), s || (s = n.createDocumentFragment(), v.clean(e, n, s, r), o && (v.fragments[a] = u && s)), { fragment: s, cacheable: o } }, v.fragments = {}, v.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, t) { v.fn[e] = function (n) { var r, i = 0, s = [], o = v(n), u = o.length, a = this.length === 1 && this[0].parentNode; if ((a == null || a && a.nodeType === 11 && a.childNodes.length === 1) && u === 1) return o[t](this[0]), this; for (; i < u; i++) r = (i > 0 ? this.clone(!0) : this).get(), v(o[i])[t](r), s = s.concat(r); return this.pushStack(s, e, o.selector) } }), v.extend({ clone: function (e, t, n) { var r, i, s, o; v.support.html5Clone || v.isXMLDoc(e) || !wt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (kt.innerHTML = e.outerHTML, kt.removeChild(o = kt.firstChild)); if ((!v.support.noCloneEvent || !v.support.noCloneChecked) && (e.nodeType === 1 || e.nodeType === 11) && !v.isXMLDoc(e)) { Ot(e, o), r = Mt(e), i = Mt(o); for (s = 0; r[s]; ++s) i[s] && Ot(r[s], i[s]) } if (t) { At(e, o); if (n) { r = Mt(e), i = Mt(o); for (s = 0; r[s]; ++s) At(r[s], i[s]) } } return r = i = null, o }, clean: function (e, t, n, r) { var s, o, u, a, f, l, c, h, p, d, m, g, y = t === i && Ct, b = []; if (!t || typeof t.createDocumentFragment == "undefined") t = i; for (s = 0; (u = e[s]) != null; s++) { typeof u == "number" && (u += ""); if (!u) continue; if (typeof u == "string") if (!gt.test(u)) u = t.createTextNode(u); else { y = y || lt(t), c = t.createElement("div"), y.appendChild(c), u = u.replace(dt, "<$1></$2>"), a = (vt.exec(u) || ["", ""])[1].toLowerCase(), f = Nt[a] || Nt._default, l = f[0], c.innerHTML = f[1] + u + f[2]; while (l--) c = c.lastChild; if (!v.support.tbody) { h = mt.test(u), p = a === "table" && !h ? c.firstChild && c.firstChild.childNodes : f[1] === "<table>" && !h ? c.childNodes : []; for (o = p.length - 1; o >= 0; --o) v.nodeName(p[o], "tbody") && !p[o].childNodes.length && p[o].parentNode.removeChild(p[o]) } !v.support.leadingWhitespace && pt.test(u) && c.insertBefore(t.createTextNode(pt.exec(u)[0]), c.firstChild), u = c.childNodes, c.parentNode.removeChild(c) } u.nodeType ? b.push(u) : v.merge(b, u) } c && (u = c = y = null); if (!v.support.appendChecked) for (s = 0; (u = b[s]) != null; s++) v.nodeName(u, "input") ? _t(u) : typeof u.getElementsByTagName != "undefined" && v.grep(u.getElementsByTagName("input"), _t); if (n) { m = function (e) { if (!e.type || xt.test(e.type)) return r ? r.push(e.parentNode ? e.parentNode.removeChild(e) : e) : n.appendChild(e) }; for (s = 0; (u = b[s]) != null; s++) if (!v.nodeName(u, "script") || !m(u)) n.appendChild(u), typeof u.getElementsByTagName != "undefined" && (g = v.grep(v.merge([], u.getElementsByTagName("script")), m), b.splice.apply(b, [s + 1, 0].concat(g)), s += g.length) } return b }, cleanData: function (e, t) { var n, r, i, s, o = 0, u = v.expando, a = v.cache, f = v.support.deleteExpando, l = v.event.special; for (; (i = e[o]) != null; o++) if (t || v.acceptData(i)) { r = i[u], n = r && a[r]; if (n) { if (n.events) for (s in n.events) l[s] ? v.event.remove(i, s) : v.removeEvent(i, s, n.handle); a[r] && (delete a[r], f ? delete i[u] : i.removeAttribute ? i.removeAttribute(u) : i[u] = null, v.deletedIds.push(r)) } } } }), function () { var e, t; v.uaMatch = function (e) { e = e.toLowerCase(); var t = /(chrome)[ \/]([\w.]+)/.exec(e) || /(webkit)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || []; return { browser: t[1] || "", version: t[2] || "0" } }, e = v.uaMatch(o.userAgent), t = {}, e.browser && (t[e.browser] = !0, t.version = e.version), t.chrome ? t.webkit = !0 : t.webkit && (t.safari = !0), v.browser = t, v.sub = function () { function e(t, n) { return new e.fn.init(t, n) } v.extend(!0, e, this), e.superclass = this, e.fn = e.prototype = this(), e.fn.constructor = e, e.sub = this.sub, e.fn.init = function (r, i) { return i && i instanceof v && !(i instanceof e) && (i = e(i)), v.fn.init.call(this, r, i, t) }, e.fn.init.prototype = e.fn; var t = e(i); return e } }(); var Dt, Pt, Ht, Bt = /alpha\([^)]*\)/i, jt = /opacity=([^)]*)/, Ft = /^(top|right|bottom|left)$/, It = /^(none|table(?!-c[ea]).+)/, qt = /^margin/, Rt = new RegExp("^(" + m + ")(.*)$", "i"), Ut = new RegExp("^(" + m + ")(?!px)[a-z%]+$", "i"), zt = new RegExp("^([-+])=(" + m + ")", "i"), Wt = { BODY: "block" }, Xt = { position: "absolute", visibility: "hidden", display: "block" }, Vt = { letterSpacing: 0, fontWeight: 400 }, $t = ["Top", "Right", "Bottom", "Left"], Jt = ["Webkit", "O", "Moz", "ms"], Kt = v.fn.toggle; v.fn.extend({ css: function (e, n) { return v.access(this, function (e, n, r) { return r !== t ? v.style(e, n, r) : v.css(e, n) }, e, n, arguments.length > 1) }, show: function () { return Yt(this, !0) }, hide: function () { return Yt(this) }, toggle: function (e, t) { var n = typeof e == "boolean"; return v.isFunction(e) && v.isFunction(t) ? Kt.apply(this, arguments) : this.each(function () { (n ? e : Gt(this)) ? v(this).show() : v(this).hide() }) } }), v.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = Dt(e, "opacity"); return n === "" ? "1" : n } } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": v.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (e, n, r, i) { if (!e || e.nodeType === 3 || e.nodeType === 8 || !e.style) return; var s, o, u, a = v.camelCase(n), f = e.style; n = v.cssProps[a] || (v.cssProps[a] = Qt(f, a)), u = v.cssHooks[n] || v.cssHooks[a]; if (r === t) return u && "get" in u && (s = u.get(e, !1, i)) !== t ? s : f[n]; o = typeof r, o === "string" && (s = zt.exec(r)) && (r = (s[1] + 1) * s[2] + parseFloat(v.css(e, n)), o = "number"); if (r == null || o === "number" && isNaN(r)) return; o === "number" && !v.cssNumber[a] && (r += "px"); if (!u || !("set" in u) || (r = u.set(e, r, i)) !== t) try { f[n] = r } catch (l) { } }, css: function (e, n, r, i) { var s, o, u, a = v.camelCase(n); return n = v.cssProps[a] || (v.cssProps[a] = Qt(e.style, a)), u = v.cssHooks[n] || v.cssHooks[a], u && "get" in u && (s = u.get(e, !0, i)), s === t && (s = Dt(e, n)), s === "normal" && n in Vt && (s = Vt[n]), r || i !== t ? (o = parseFloat(s), r || v.isNumeric(o) ? o || 0 : s) : s }, swap: function (e, t, n) { var r, i, s = {}; for (i in t) s[i] = e.style[i], e.style[i] = t[i]; r = n.call(e); for (i in t) e.style[i] = s[i]; return r } }), e.getComputedStyle ? Dt = function (t, n) { var r, i, s, o, u = e.getComputedStyle(t, null), a = t.style; return u && (r = u.getPropertyValue(n) || u[n], r === "" && !v.contains(t.ownerDocument, t) && (r = v.style(t, n)), Ut.test(r) && qt.test(n) && (i = a.width, s = a.minWidth, o = a.maxWidth, a.minWidth = a.maxWidth = a.width = r, r = u.width, a.width = i, a.minWidth = s, a.maxWidth = o)), r } : i.documentElement.currentStyle && (Dt = function (e, t) { var n, r, i = e.currentStyle && e.currentStyle[t], s = e.style; return i == null && s && s[t] && (i = s[t]), Ut.test(i) && !Ft.test(t) && (n = s.left, r = e.runtimeStyle && e.runtimeStyle.left, r && (e.runtimeStyle.left = e.currentStyle.left), s.left = t === "fontSize" ? "1em" : i, i = s.pixelLeft + "px", s.left = n, r && (e.runtimeStyle.left = r)), i === "" ? "auto" : i }), v.each(["height", "width"], function (e, t) { v.cssHooks[t] = { get: function (e, n, r) { if (n) return e.offsetWidth === 0 && It.test(Dt(e, "display")) ? v.swap(e, Xt, function () { return tn(e, t, r) }) : tn(e, t, r) }, set: function (e, n, r) { return Zt(e, n, r ? en(e, t, r, v.support.boxSizing && v.css(e, "boxSizing") === "border-box") : 0) } } }), v.support.opacity || (v.cssHooks.opacity = { get: function (e, t) { return jt.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : "" }, set: function (e, t) { var n = e.style, r = e.currentStyle, i = v.isNumeric(t) ? "alpha(opacity=" + t * 100 + ")" : "", s = r && r.filter || n.filter || ""; n.zoom = 1; if (t >= 1 && v.trim(s.replace(Bt, "")) === "" && n.removeAttribute) { n.removeAttribute("filter"); if (r && !r.filter) return } n.filter = Bt.test(s) ? s.replace(Bt, i) : s + " " + i } }), v(function () { v.support.reliableMarginRight || (v.cssHooks.marginRight = { get: function (e, t) { return v.swap(e, { display: "inline-block" }, function () { if (t) return Dt(e, "marginRight") }) } }), !v.support.pixelPosition && v.fn.position && v.each(["top", "left"], function (e, t) { v.cssHooks[t] = { get: function (e, n) { if (n) { var r = Dt(e, t); return Ut.test(r) ? v(e).position()[t] + "px" : r } } } }) }), v.expr && v.expr.filters && (v.expr.filters.hidden = function (e) { return e.offsetWidth === 0 && e.offsetHeight === 0 || !v.support.reliableHiddenOffsets && (e.style && e.style.display || Dt(e, "display")) === "none" }, v.expr.filters.visible = function (e) { return !v.expr.filters.hidden(e) }), v.each({ margin: "", padding: "", border: "Width" }, function (e, t) { v.cssHooks[e + t] = { expand: function (n) { var r, i = typeof n == "string" ? n.split(" ") : [n], s = {}; for (r = 0; r < 4; r++) s[e + $t[r] + t] = i[r] || i[r - 2] || i[0]; return s } }, qt.test(e) || (v.cssHooks[e + t].set = Zt) }); var rn = /%20/g, sn = /\[\]$/, on = /\r?\n/g, un = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, an = /^(?:select|textarea)/i; v.fn.extend({ serialize: function () { return v.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { return this.elements ? v.makeArray(this.elements) : this }).filter(function () { return this.name && !this.disabled && (this.checked || an.test(this.nodeName) || un.test(this.type)) }).map(function (e, t) { var n = v(this).val(); return n == null ? null : v.isArray(n) ? v.map(n, function (e, n) { return { name: t.name, value: e.replace(on, "\r\n") } }) : { name: t.name, value: n.replace(on, "\r\n") } }).get() } }), v.param = function (e, n) { var r, i = [], s = function (e, t) { t = v.isFunction(t) ? t() : t == null ? "" : t, i[i.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t) }; n === t && (n = v.ajaxSettings && v.ajaxSettings.traditional); if (v.isArray(e) || e.jquery && !v.isPlainObject(e)) v.each(e, function () { s(this.name, this.value) }); else for (r in e) fn(r, e[r], n, s); return i.join("&").replace(rn, "+") }; var ln, cn, hn = /#.*$/, pn = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, dn = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, vn = /^(?:GET|HEAD)$/, mn = /^\/\//, gn = /\?/, yn = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, bn = /([?&])_=[^&]*/, wn = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, En = v.fn.load, Sn = {}, xn = {}, Tn = ["*/"] + ["*"]; try { cn = s.href } catch (Nn) { cn = i.createElement("a"), cn.href = "", cn = cn.href } ln = wn.exec(cn.toLowerCase()) || [], v.fn.load = function (e, n, r) { if (typeof e != "string" && En) return En.apply(this, arguments); if (!this.length) return this; var i, s, o, u = this, a = e.indexOf(" "); return a >= 0 && (i = e.slice(a, e.length), e = e.slice(0, a)), v.isFunction(n) ? (r = n, n = t) : n && typeof n == "object" && (s = "POST"), v.ajax({ url: e, type: s, dataType: "html", data: n, complete: function (e, t) { r && u.each(r, o || [e.responseText, t, e]) } }).done(function (e) { o = arguments, u.html(i ? v("<div>").append(e.replace(yn, "")).find(i) : e) }), this }, v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (e, t) { v.fn[t] = function (e) { return this.on(t, e) } }), v.each(["get", "post"], function (e, n) { v[n] = function (e, r, i, s) { return v.isFunction(r) && (s = s || i, i = r, r = t), v.ajax({ type: n, url: e, data: r, success: i, dataType: s }) } }), v.extend({ getScript: function (e, n) { return v.get(e, t, n, "script") }, getJSON: function (e, t, n) { return v.get(e, t, n, "json") }, ajaxSetup: function (e, t) { return t ? Ln(e, v.ajaxSettings) : (t = e, e = v.ajaxSettings), Ln(e, t), e }, ajaxSettings: { url: cn, isLocal: dn.test(ln[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": Tn }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": e.String, "text html": !0, "text json": v.parseJSON, "text xml": v.parseXML }, flatOptions: { context: !0, url: !0 } }, ajaxPrefilter: Cn(Sn), ajaxTransport: Cn(xn), ajax: function (e, n) { function T(e, n, s, a) { var l, y, b, w, S, T = n; if (E === 2) return; E = 2, u && clearTimeout(u), o = t, i = a || "", x.readyState = e > 0 ? 4 : 0, s && (w = An(c, x, s)); if (e >= 200 && e < 300 || e === 304) c.ifModified && (S = x.getResponseHeader("Last-Modified"), S && (v.lastModified[r] = S), S = x.getResponseHeader("Etag"), S && (v.etag[r] = S)), e === 304 ? (T = "notmodified", l = !0) : (l = On(c, w), T = l.state, y = l.data, b = l.error, l = !b); else { b = T; if (!T || e) T = "error", e < 0 && (e = 0) } x.status = e, x.statusText = (n || T) + "", l ? d.resolveWith(h, [y, T, x]) : d.rejectWith(h, [x, T, b]), x.statusCode(g), g = t, f && p.trigger("ajax" + (l ? "Success" : "Error"), [x, c, l ? y : b]), m.fireWith(h, [x, T]), f && (p.trigger("ajaxComplete", [x, c]), --v.active || v.event.trigger("ajaxStop")) } typeof e == "object" && (n = e, e = t), n = n || {}; var r, i, s, o, u, a, f, l, c = v.ajaxSetup({}, n), h = c.context || c, p = h !== c && (h.nodeType || h instanceof v) ? v(h) : v.event, d = v.Deferred(), m = v.Callbacks("once memory"), g = c.statusCode || {}, b = {}, w = {}, E = 0, S = "canceled", x = { readyState: 0, setRequestHeader: function (e, t) { if (!E) { var n = e.toLowerCase(); e = w[n] = w[n] || e, b[e] = t } return this }, getAllResponseHeaders: function () { return E === 2 ? i : null }, getResponseHeader: function (e) { var n; if (E === 2) { if (!s) { s = {}; while (n = pn.exec(i)) s[n[1].toLowerCase()] = n[2] } n = s[e.toLowerCase()] } return n === t ? null : n }, overrideMimeType: function (e) { return E || (c.mimeType = e), this }, abort: function (e) { return e = e || S, o && o.abort(e), T(0, e), this } }; d.promise(x), x.success = x.done, x.error = x.fail, x.complete = m.add, x.statusCode = function (e) { if (e) { var t; if (E < 2) for (t in e) g[t] = [g[t], e[t]]; else t = e[x.status], x.always(t) } return this }, c.url = ((e || c.url) + "").replace(hn, "").replace(mn, ln[1] + "//"), c.dataTypes = v.trim(c.dataType || "*").toLowerCase().split(y), c.crossDomain == null && (a = wn.exec(c.url.toLowerCase()), c.crossDomain = !(!a || a[1] === ln[1] && a[2] === ln[2] && (a[3] || (a[1] === "http:" ? 80 : 443)) == (ln[3] || (ln[1] === "http:" ? 80 : 443)))), c.data && c.processData && typeof c.data != "string" && (c.data = v.param(c.data, c.traditional)), kn(Sn, c, n, x); if (E === 2) return x; f = c.global, c.type = c.type.toUpperCase(), c.hasContent = !vn.test(c.type), f && v.active++ === 0 && v.event.trigger("ajaxStart"); if (!c.hasContent) { c.data && (c.url += (gn.test(c.url) ? "&" : "?") + c.data, delete c.data), r = c.url; if (c.cache === !1) { var N = v.now(), C = c.url.replace(bn, "$1_=" + N); c.url = C + (C === c.url ? (gn.test(c.url) ? "&" : "?") + "_=" + N : "") } } (c.data && c.hasContent && c.contentType !== !1 || n.contentType) && x.setRequestHeader("Content-Type", c.contentType), c.ifModified && (r = r || c.url, v.lastModified[r] && x.setRequestHeader("If-Modified-Since", v.lastModified[r]), v.etag[r] && x.setRequestHeader("If-None-Match", v.etag[r])), x.setRequestHeader("Accept", c.dataTypes[0] && c.accepts[c.dataTypes[0]] ? c.accepts[c.dataTypes[0]] + (c.dataTypes[0] !== "*" ? ", " + Tn + "; q=0.01" : "") : c.accepts["*"]); for (l in c.headers) x.setRequestHeader(l, c.headers[l]); if (!c.beforeSend || c.beforeSend.call(h, x, c) !== !1 && E !== 2) { S = "abort"; for (l in { success: 1, error: 1, complete: 1 }) x[l](c[l]); o = kn(xn, c, n, x); if (!o) T(-1, "No Transport"); else { x.readyState = 1, f && p.trigger("ajaxSend", [x, c]), c.async && c.timeout > 0 && (u = setTimeout(function () { x.abort("timeout") }, c.timeout)); try { E = 1, o.send(b, T) } catch (k) { if (!(E < 2)) throw k; T(-1, k) } } return x } return x.abort() }, active: 0, lastModified: {}, etag: {} }); var Mn = [], _n = /\?/, Dn = /(=)\?(?=&|$)|\?\?/, Pn = v.now(); v.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var e = Mn.pop() || v.expando + "_" + Pn++; return this[e] = !0, e } }), v.ajaxPrefilter("json jsonp", function (n, r, i) { var s, o, u, a = n.data, f = n.url, l = n.jsonp !== !1, c = l && Dn.test(f), h = l && !c && typeof a == "string" && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Dn.test(a); if (n.dataTypes[0] === "jsonp" || c || h) return s = n.jsonpCallback = v.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, o = e[s], c ? n.url = f.replace(Dn, "$1" + s) : h ? n.data = a.replace(Dn, "$1" + s) : l && (n.url += (_n.test(f) ? "&" : "?") + n.jsonp + "=" + s), n.converters["script json"] = function () { return u || v.error(s + " was not called"), u[0] }, n.dataTypes[0] = "json", e[s] = function () { u = arguments }, i.always(function () { e[s] = o, n[s] && (n.jsonpCallback = r.jsonpCallback, Mn.push(s)), u && v.isFunction(o) && o(u[0]), u = o = t }), "script" }), v.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (e) { return v.globalEval(e), e } } }), v.ajaxPrefilter("script", function (e) { e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1) }), v.ajaxTransport("script", function (e) { if (e.crossDomain) { var n, r = i.head || i.getElementsByTagName("head")[0] || i.documentElement; return { send: function (s, o) { n = i.createElement("script"), n.async = "async", e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, i) { if (i || !n.readyState || /loaded|complete/.test(n.readyState)) n.onload = n.onreadystatechange = null, r && n.parentNode && r.removeChild(n), n = t, i || o(200, "success") }, r.insertBefore(n, r.firstChild) }, abort: function () { n && n.onload(0, 1) } } } }); var Hn, Bn = e.ActiveXObject ? function () { for (var e in Hn) Hn[e](0, 1) } : !1, jn = 0; v.ajaxSettings.xhr = e.ActiveXObject ? function () { return !this.isLocal && Fn() || In() } : Fn, function (e) { v.extend(v.support, { ajax: !!e, cors: !!e && "withCredentials" in e }) }(v.ajaxSettings.xhr()), v.support.ajax && v.ajaxTransport(function (n) { if (!n.crossDomain || v.support.cors) { var r; return { send: function (i, s) { var o, u, a = n.xhr(); n.username ? a.open(n.type, n.url, n.async, n.username, n.password) : a.open(n.type, n.url, n.async); if (n.xhrFields) for (u in n.xhrFields) a[u] = n.xhrFields[u]; n.mimeType && a.overrideMimeType && a.overrideMimeType(n.mimeType), !n.crossDomain && !i["X-Requested-With"] && (i["X-Requested-With"] = "XMLHttpRequest"); try { for (u in i) a.setRequestHeader(u, i[u]) } catch (f) { } a.send(n.hasContent && n.data || null), r = function (e, i) { var u, f, l, c, h; try { if (r && (i || a.readyState === 4)) { r = t, o && (a.onreadystatechange = v.noop, Bn && delete Hn[o]); if (i) a.readyState !== 4 && a.abort(); else { u = a.status, l = a.getAllResponseHeaders(), c = {}, h = a.responseXML, h && h.documentElement && (c.xml = h); try { c.text = a.responseText } catch (p) { } try { f = a.statusText } catch (p) { f = "" } !u && n.isLocal && !n.crossDomain ? u = c.text ? 200 : 404 : u === 1223 && (u = 204) } } } catch (d) { i || s(-1, d) } c && s(u, f, c, l) }, n.async ? a.readyState === 4 ? setTimeout(r, 0) : (o = ++jn, Bn && (Hn || (Hn = {}, v(e).unload(Bn)), Hn[o] = r), a.onreadystatechange = r) : r() }, abort: function () { r && r(0, 1) } } } }); var qn, Rn, Un = /^(?:toggle|show|hide)$/, zn = new RegExp("^(?:([-+])=|)(" + m + ")([a-z%]*)$", "i"), Wn = /queueHooks$/, Xn = [Gn], Vn = { "*": [function (e, t) { var n, r, i = this.createTween(e, t), s = zn.exec(t), o = i.cur(), u = +o || 0, a = 1, f = 20; if (s) { n = +s[2], r = s[3] || (v.cssNumber[e] ? "" : "px"); if (r !== "px" && u) { u = v.css(i.elem, e, !0) || n || 1; do a = a || ".5", u /= a, v.style(i.elem, e, u + r); while (a !== (a = i.cur() / o) && a !== 1 && --f) } i.unit = r, i.start = u, i.end = s[1] ? u + (s[1] + 1) * n : n } return i }] }; v.Animation = v.extend(Kn, { tweener: function (e, t) { v.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" "); var n, r = 0, i = e.length; for (; r < i; r++) n = e[r], Vn[n] = Vn[n] || [], Vn[n].unshift(t) }, prefilter: function (e, t) { t ? Xn.unshift(e) : Xn.push(e) } }), v.Tween = Yn, Yn.prototype = { constructor: Yn, init: function (e, t, n, r, i, s) { this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = s || (v.cssNumber[n] ? "" : "px") }, cur: function () { var e = Yn.propHooks[this.prop]; return e && e.get ? e.get(this) : Yn.propHooks._default.get(this) }, run: function (e) { var t, n = Yn.propHooks[this.prop]; return this.options.duration ? this.pos = t = v.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : Yn.propHooks._default.set(this), this } }, Yn.prototype.init.prototype = Yn.prototype, Yn.propHooks = { _default: { get: function (e) { var t; return e.elem[e.prop] == null || !!e.elem.style && e.elem.style[e.prop] != null ? (t = v.css(e.elem, e.prop, !1, ""), !t || t === "auto" ? 0 : t) : e.elem[e.prop] }, set: function (e) { v.fx.step[e.prop] ? v.fx.step[e.prop](e) : e.elem.style && (e.elem.style[v.cssProps[e.prop]] != null || v.cssHooks[e.prop]) ? v.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now } } }, Yn.propHooks.scrollTop = Yn.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, v.each(["toggle", "show", "hide"], function (e, t) { var n = v.fn[t]; v.fn[t] = function (r, i, s) { return r == null || typeof r == "boolean" || !e && v.isFunction(r) && v.isFunction(i) ? n.apply(this, arguments) : this.animate(Zn(t, !0), r, i, s) } }), v.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(Gt).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r) }, animate: function (e, t, n, r) { var i = v.isEmptyObject(e), s = v.speed(t, n, r), o = function () { var t = Kn(this, v.extend({}, e), s); i && t.stop(!0) }; return i || s.queue === !1 ? this.each(o) : this.queue(s.queue, o) }, stop: function (e, n, r) { var i = function (e) { var t = e.stop; delete e.stop, t(r) }; return typeof e != "string" && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () { var t = !0, n = e != null && e + "queueHooks", s = v.timers, o = v._data(this); if (n) o[n] && o[n].stop && i(o[n]); else for (n in o) o[n] && o[n].stop && Wn.test(n) && i(o[n]); for (n = s.length; n--;) s[n].elem === this && (e == null || s[n].queue === e) && (s[n].anim.stop(r), t = !1, s.splice(n, 1)); (t || !r) && v.dequeue(this, e) }) } }), v.each({ slideDown: Zn("show"), slideUp: Zn("hide"), slideToggle: Zn("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, t) { v.fn[e] = function (e, n, r) { return this.animate(t, e, n, r) } }), v.speed = function (e, t, n) { var r = e && typeof e == "object" ? v.extend({}, e) : { complete: n || !n && t || v.isFunction(e) && e, duration: e, easing: n && t || t && !v.isFunction(t) && t }; r.duration = v.fx.off ? 0 : typeof r.duration == "number" ? r.duration : r.duration in v.fx.speeds ? v.fx.speeds[r.duration] : v.fx.speeds._default; if (r.queue == null || r.queue === !0) r.queue = "fx"; return r.old = r.complete, r.complete = function () { v.isFunction(r.old) && r.old.call(this), r.queue && v.dequeue(this, r.queue) }, r }, v.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 } }, v.timers = [], v.fx = Yn.prototype.init, v.fx.tick = function () { var e, n = v.timers, r = 0; qn = v.now(); for (; r < n.length; r++) e = n[r], !e() && n[r] === e && n.splice(r--, 1); n.length || v.fx.stop(), qn = t }, v.fx.timer = function (e) { e() && v.timers.push(e) && !Rn && (Rn = setInterval(v.fx.tick, v.fx.interval)) }, v.fx.interval = 13, v.fx.stop = function () { clearInterval(Rn), Rn = null }, v.fx.speeds = { slow: 600, fast: 200, _default: 400 }, v.fx.step = {}, v.expr && v.expr.filters && (v.expr.filters.animated = function (e) { return v.grep(v.timers, function (t) { return e === t.elem }).length }); var er = /^(?:body|html)$/i; v.fn.offset = function (e) { if (arguments.length) return e === t ? this : this.each(function (t) { v.offset.setOffset(this, e, t) }); var n, r, i, s, o, u, a, f = { top: 0, left: 0 }, l = this[0], c = l && l.ownerDocument; if (!c) return; return (r = c.body) === l ? v.offset.bodyOffset(l) : (n = c.documentElement, v.contains(n, l) ? (typeof l.getBoundingClientRect != "undefined" && (f = l.getBoundingClientRect()), i = tr(c), s = n.clientTop || r.clientTop || 0, o = n.clientLeft || r.clientLeft || 0, u = i.pageYOffset || n.scrollTop, a = i.pageXOffset || n.scrollLeft, { top: f.top + u - s, left: f.left + a - o }) : f) }, v.offset = { bodyOffset: function (e) { var t = e.offsetTop, n = e.offsetLeft; return v.support.doesNotIncludeMarginInBodyOffset && (t += parseFloat(v.css(e, "marginTop")) || 0, n += parseFloat(v.css(e, "marginLeft")) || 0), { top: t, left: n } }, setOffset: function (e, t, n) { var r = v.css(e, "position"); r === "static" && (e.style.position = "relative"); var i = v(e), s = i.offset(), o = v.css(e, "top"), u = v.css(e, "left"), a = (r === "absolute" || r === "fixed") && v.inArray("auto", [o, u]) > -1, f = {}, l = {}, c, h; a ? (l = i.position(), c = l.top, h = l.left) : (c = parseFloat(o) || 0, h = parseFloat(u) || 0), v.isFunction(t) && (t = t.call(e, n, s)), t.top != null && (f.top = t.top - s.top + c), t.left != null && (f.left = t.left - s.left + h), "using" in t ? t.using.call(e, f) : i.css(f) } }, v.fn.extend({ position: function () { if (!this[0]) return; var e = this[0], t = this.offsetParent(), n = this.offset(), r = er.test(t[0].nodeName) ? { top: 0, left: 0 } : t.offset(); return n.top -= parseFloat(v.css(e, "marginTop")) || 0, n.left -= parseFloat(v.css(e, "marginLeft")) || 0, r.top += parseFloat(v.css(t[0], "borderTopWidth")) || 0, r.left += parseFloat(v.css(t[0], "borderLeftWidth")) || 0, { top: n.top - r.top, left: n.left - r.left } }, offsetParent: function () { return this.map(function () { var e = this.offsetParent || i.body; while (e && !er.test(e.nodeName) && v.css(e, "position") === "static") e = e.offsetParent; return e || i.body }) } }), v.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (e, n) { var r = /Y/.test(n); v.fn[e] = function (i) { return v.access(this, function (e, i, s) { var o = tr(e); if (s === t) return o ? n in o ? o[n] : o.document.documentElement[i] : e[i]; o ? o.scrollTo(r ? v(o).scrollLeft() : s, r ? s : v(o).scrollTop()) : e[i] = s }, e, i, arguments.length, null) } }), v.each({ Height: "height", Width: "width" }, function (e, n) { v.each({ padding: "inner" + e, content: n, "": "outer" + e }, function (r, i) { v.fn[i] = function (i, s) { var o = arguments.length && (r || typeof i != "boolean"), u = r || (i === !0 || s === !0 ? "margin" : "border"); return v.access(this, function (n, r, i) { var s; return v.isWindow(n) ? n.document.documentElement["client" + e] : n.nodeType === 9 ? (s = n.documentElement, Math.max(n.body["scroll" + e], s["scroll" + e], n.body["offset" + e], s["offset" + e], s["client" + e])) : i === t ? v.css(n, r, i, u) : v.style(n, r, i, u) }, n, o ? i : t, o, null) } }) }), e.jQuery = e.$ = v, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function () { return v }) })(window); jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{},t===null&&(t="",i=$.extend({},i),i.expires=-1),f="",i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",encodeURIComponent(t),f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=decodeURIComponent(s.substring(n.length+1));break}return e}}
src/ui/components/views/PageLoading.js
Anup-Allamsetty/pure
/* @flow */ import React, { Component } from 'react'; import shallowEqual from 'shallowequal'; import LoadingItem from './LoadingItem'; import Page from './Page'; export default class PageLoading extends Component<void, any, void> { shouldComponentUpdate(nextProps: any): boolean { return !shallowEqual(this.props, nextProps); } render() { return ( <Page {...this.props}> <LoadingItem /> </Page> ); } }
ajax/libs/js-data/1.1.0/js-data.js
dlueth/cdnjs
/** * @author Jason Dobry <jason.dobry@gmail.com> * @file dist/js-data.js * @version 1.1.0 - Homepage <http://www.js-data.io/> * @copyright (c) 2014 Jason Dobry * @license MIT <https://github.com/js-data/js-data/blob/master/LICENSE> * * @overview Data store. */ !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.JSData=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<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ // Copyright 2012 Google Inc. // // 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 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Modifications // Copyright 2014-2015 Jason Dobry // // Summary of modifications: // Fixed use of "delete" keyword for IE8 compatibility // Exposed diffObjectFromOldObject on the exported object // Added the "equals" argument to diffObjectFromOldObject to be used to check equality // Added a way to to define a default equality operator for diffObjectFromOldObject // Added a way in diffObjectFromOldObject to ignore changes to certain properties // Removed all code related to: // - ArrayObserver // - ArraySplice // - PathObserver // - CompoundObserver // - Path // - ObserverTransform (function(global) { 'use strict'; var equalityFn = function (a, b) { return a === b; }; var blacklist = []; // Detect and do basic sanity checking on Object/Array.observe. function detectObjectObserve() { if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { return false; } var records = []; function callback(recs) { records = recs; } var test = {}; var arr = []; Object.observe(test, callback); Array.observe(arr, callback); test.id = 1; test.id = 2; delete test.id; arr.push(1, 2); arr.length = 0; Object.deliverChangeRecords(callback); if (records.length !== 5) return false; if (records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice') { return false; } Object.unobserve(test, callback); Array.unobserve(arr, callback); return true; } var hasObserve = detectObjectObserve(); function detectEval() { // Don't test for eval if we're running in a Chrome App environment. // We check for APIs set that only exist in a Chrome App context. if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) { return false; } try { var f = new Function('', 'return true;'); return f(); } catch (ex) { return false; } } var hasEval = detectEval(); var createObject = ('__proto__' in {}) ? function(obj) { return obj; } : function(obj) { var proto = obj.__proto__; if (!proto) return obj; var newObject = Object.create(proto); Object.getOwnPropertyNames(obj).forEach(function(name) { Object.defineProperty(newObject, name, Object.getOwnPropertyDescriptor(obj, name)); }); return newObject; }; var MAX_DIRTY_CHECK_CYCLES = 1000; function dirtyCheck(observer) { var cycles = 0; while (cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) { cycles++; } if (global.testingExposeCycleCount) global.dirtyCheckCycleCount = cycles; return cycles > 0; } function objectIsEmpty(object) { for (var prop in object) return false; return true; } function diffIsEmpty(diff) { return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed); } function isBlacklisted(prop, bl) { if (!bl || !bl.length) { return false; } var matches; for (var i = 0; i < bl.length; i++) { if ((Object.prototype.toString.call(bl[i]) === '[object RegExp]' && bl[i].test(prop)) || bl[i] === prop) { return matches = prop; } } return !!matches; } function diffObjectFromOldObject(object, oldObject, equals, bl) { var added = {}; var removed = {}; var changed = {}; for (var prop in oldObject) { var newValue = object[prop]; if (isBlacklisted(prop, bl)) continue; if (newValue !== undefined && (equals ? equals(newValue, oldObject[prop]) : newValue === oldObject[prop])) continue; if (!(prop in object)) { removed[prop] = undefined; continue; } if (equals ? !equals(newValue, oldObject[prop]) : newValue !== oldObject[prop]) changed[prop] = newValue; } for (var prop in object) { if (prop in oldObject) continue; if (isBlacklisted(prop, bl)) continue; added[prop] = object[prop]; } if (Array.isArray(object) && object.length !== oldObject.length) changed.length = object.length; return { added: added, removed: removed, changed: changed }; } var eomTasks = []; function runEOMTasks() { if (!eomTasks.length) return false; for (var i = 0; i < eomTasks.length; i++) { eomTasks[i](); } eomTasks.length = 0; return true; } var runEOM = hasObserve ? (function(){ var eomObj = { pingPong: true }; var eomRunScheduled = false; Object.observe(eomObj, function() { runEOMTasks(); eomRunScheduled = false; }); return function(fn) { eomTasks.push(fn); if (!eomRunScheduled) { eomRunScheduled = true; eomObj.pingPong = !eomObj.pingPong; } }; })() : (function() { return function(fn) { eomTasks.push(fn); }; })(); var observedObjectCache = []; function newObservedObject() { var observer; var object; var discardRecords = false; var first = true; function callback(records) { if (observer && observer.state_ === OPENED && !discardRecords) observer.check_(records); } return { open: function(obs) { if (observer) throw Error('ObservedObject in use'); if (!first) Object.deliverChangeRecords(callback); observer = obs; first = false; }, observe: function(obj, arrayObserve) { object = obj; if (arrayObserve) Array.observe(object, callback); else Object.observe(object, callback); }, deliver: function(discard) { discardRecords = discard; Object.deliverChangeRecords(callback); discardRecords = false; }, close: function() { observer = undefined; Object.unobserve(object, callback); observedObjectCache.push(this); } }; } /* * The observedSet abstraction is a perf optimization which reduces the total * number of Object.observe observations of a set of objects. The idea is that * groups of Observers will have some object dependencies in common and this * observed set ensures that each object in the transitive closure of * dependencies is only observed once. The observedSet acts as a write barrier * such that whenever any change comes through, all Observers are checked for * changed values. * * Note that this optimization is explicitly moving work from setup-time to * change-time. * * TODO(rafaelw): Implement "garbage collection". In order to move work off * the critical path, when Observers are closed, their observed objects are * not Object.unobserve(d). As a result, it's possible that if the observedSet * is kept open, but some Observers have been closed, it could cause "leaks" * (prevent otherwise collectable objects from being collected). At some * point, we should implement incremental "gc" which keeps a list of * observedSets which may need clean-up and does small amounts of cleanup on a * timeout until all is clean. */ function getObservedObject(observer, object, arrayObserve) { var dir = observedObjectCache.pop() || newObservedObject(); dir.open(observer); dir.observe(object, arrayObserve); return dir; } var UNOPENED = 0; var OPENED = 1; var CLOSED = 2; var nextObserverId = 1; function Observer() { this.state_ = UNOPENED; this.callback_ = undefined; this.target_ = undefined; // TODO(rafaelw): Should be WeakRef this.directObserver_ = undefined; this.value_ = undefined; this.id_ = nextObserverId++; } Observer.prototype = { open: function(callback, target) { if (this.state_ != UNOPENED) throw Error('Observer has already been opened.'); addToAll(this); this.callback_ = callback; this.target_ = target; this.connect_(); this.state_ = OPENED; return this.value_; }, close: function() { if (this.state_ != OPENED) return; removeFromAll(this); this.disconnect_(); this.value_ = undefined; this.callback_ = undefined; this.target_ = undefined; this.state_ = CLOSED; }, deliver: function() { if (this.state_ != OPENED) return; dirtyCheck(this); }, report_: function(changes) { try { this.callback_.apply(this.target_, changes); } catch (ex) { Observer._errorThrownDuringCallback = true; console.error('Exception caught during observer callback: ' + (ex.stack || ex)); } }, discardChanges: function() { this.check_(undefined, true); return this.value_; } } var collectObservers = !hasObserve; var allObservers; Observer._allObserversCount = 0; if (collectObservers) { allObservers = []; } function addToAll(observer) { Observer._allObserversCount++; if (!collectObservers) return; allObservers.push(observer); } function removeFromAll(observer) { Observer._allObserversCount--; } var runningMicrotaskCheckpoint = false; var hasDebugForceFullDelivery = hasObserve && hasEval && (function() { try { eval('%RunMicrotasks()'); return true; } catch (ex) { return false; } })(); global.Platform = global.Platform || {}; global.Platform.performMicrotaskCheckpoint = function() { if (runningMicrotaskCheckpoint) return; if (hasDebugForceFullDelivery) { eval('%RunMicrotasks()'); return; } if (!collectObservers) return; runningMicrotaskCheckpoint = true; var cycles = 0; var anyChanged, toCheck; do { cycles++; toCheck = allObservers; allObservers = []; anyChanged = false; for (var i = 0; i < toCheck.length; i++) { var observer = toCheck[i]; if (observer.state_ != OPENED) continue; if (observer.check_()) anyChanged = true; allObservers.push(observer); } if (runEOMTasks()) anyChanged = true; } while (cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged); if (global.testingExposeCycleCount) global.dirtyCheckCycleCount = cycles; runningMicrotaskCheckpoint = false; }; if (collectObservers) { global.Platform.clearObservers = function() { allObservers = []; }; } function ObjectObserver(object) { Observer.call(this); this.value_ = object; this.oldObject_ = undefined; } ObjectObserver.prototype = createObject({ __proto__: Observer.prototype, arrayObserve: false, connect_: function(callback, target) { if (hasObserve) { this.directObserver_ = getObservedObject(this, this.value_, this.arrayObserve); } else { this.oldObject_ = this.copyObject(this.value_); } }, copyObject: function(object) { var copy = Array.isArray(object) ? [] : {}; for (var prop in object) { copy[prop] = object[prop]; }; if (Array.isArray(object)) copy.length = object.length; return copy; }, check_: function(changeRecords, skipChanges) { var diff; var oldValues; if (hasObserve) { if (!changeRecords) return false; oldValues = {}; diff = diffObjectFromChangeRecords(this.value_, changeRecords, oldValues); } else { oldValues = this.oldObject_; diff = diffObjectFromOldObject(this.value_, this.oldObject_); } if (diffIsEmpty(diff)) return false; if (!hasObserve) this.oldObject_ = this.copyObject(this.value_); this.report_([ diff.added || {}, diff.removed || {}, diff.changed || {}, function(property) { return oldValues[property]; } ]); return true; }, disconnect_: function() { if (hasObserve) { this.directObserver_.close(); this.directObserver_ = undefined; } else { this.oldObject_ = undefined; } }, deliver: function() { if (this.state_ != OPENED) return; if (hasObserve) this.directObserver_.deliver(false); else dirtyCheck(this); }, discardChanges: function() { if (this.directObserver_) this.directObserver_.deliver(true); else this.oldObject_ = this.copyObject(this.value_); return this.value_; } }); var observerSentinel = {}; var expectedRecordTypes = { add: true, update: true, delete: true }; function diffObjectFromChangeRecords(object, changeRecords, oldValues) { var added = {}; var removed = {}; for (var i = 0; i < changeRecords.length; i++) { var record = changeRecords[i]; if (!expectedRecordTypes[record.type]) { console.error('Unknown changeRecord type: ' + record.type); console.error(record); continue; } if (!(record.name in oldValues)) oldValues[record.name] = record.oldValue; if (record.type == 'update') continue; if (record.type == 'add') { if (record.name in removed) delete removed[record.name]; else added[record.name] = true; continue; } // type = 'delete' if (record.name in added) { delete added[record.name]; delete oldValues[record.name]; } else { removed[record.name] = true; } } for (var prop in added) added[prop] = object[prop]; for (var prop in removed) removed[prop] = undefined; var changed = {}; for (var prop in oldValues) { if (prop in added || prop in removed) continue; var newValue = object[prop]; if (oldValues[prop] !== newValue) changed[prop] = newValue; } return { added: added, removed: removed, changed: changed }; } global.Observer = Observer; global.diffObjectFromOldObject = diffObjectFromOldObject; global.setEqualityFn = function (fn) { equalityFn = fn; }; global.setBlacklist = function (bl) { blacklist = bl; }; global.Observer.runEOM_ = runEOM; global.Observer.observerSentinel_ = observerSentinel; // for testing. global.Observer.hasObjectObserve = hasObserve; global.ObjectObserver = ObjectObserver; })(exports); },{}],2:[function(require,module,exports){ (function (process,global){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE * @version 2.0.1 */ (function() { "use strict"; function $$utils$$objectOrFunction(x) { return typeof x === 'function' || (typeof x === 'object' && x !== null); } function $$utils$$isFunction(x) { return typeof x === 'function'; } function $$utils$$isMaybeThenable(x) { return typeof x === 'object' && x !== null; } var $$utils$$_isArray; if (!Array.isArray) { $$utils$$_isArray = function (x) { return Object.prototype.toString.call(x) === '[object Array]'; }; } else { $$utils$$_isArray = Array.isArray; } var $$utils$$isArray = $$utils$$_isArray; var $$utils$$now = Date.now || function() { return new Date().getTime(); }; function $$utils$$F() { } var $$utils$$o_create = (Object.create || function (o) { if (arguments.length > 1) { throw new Error('Second argument not supported'); } if (typeof o !== 'object') { throw new TypeError('Argument must be an object'); } $$utils$$F.prototype = o; return new $$utils$$F(); }); var $$asap$$len = 0; var $$asap$$default = function asap(callback, arg) { $$asap$$queue[$$asap$$len] = callback; $$asap$$queue[$$asap$$len + 1] = arg; $$asap$$len += 2; if ($$asap$$len === 2) { // If len is 1, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. $$asap$$scheduleFlush(); } }; var $$asap$$browserGlobal = (typeof window !== 'undefined') ? window : {}; var $$asap$$BrowserMutationObserver = $$asap$$browserGlobal.MutationObserver || $$asap$$browserGlobal.WebKitMutationObserver; // test for web worker but not in IE10 var $$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function $$asap$$useNextTick() { return function() { process.nextTick($$asap$$flush); }; } function $$asap$$useMutationObserver() { var iterations = 0; var observer = new $$asap$$BrowserMutationObserver($$asap$$flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function() { node.data = (iterations = ++iterations % 2); }; } // web worker function $$asap$$useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = $$asap$$flush; return function () { channel.port2.postMessage(0); }; } function $$asap$$useSetTimeout() { return function() { setTimeout($$asap$$flush, 1); }; } var $$asap$$queue = new Array(1000); function $$asap$$flush() { for (var i = 0; i < $$asap$$len; i+=2) { var callback = $$asap$$queue[i]; var arg = $$asap$$queue[i+1]; callback(arg); $$asap$$queue[i] = undefined; $$asap$$queue[i+1] = undefined; } $$asap$$len = 0; } var $$asap$$scheduleFlush; // Decide what async method to use to triggering processing of queued callbacks: if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { $$asap$$scheduleFlush = $$asap$$useNextTick(); } else if ($$asap$$BrowserMutationObserver) { $$asap$$scheduleFlush = $$asap$$useMutationObserver(); } else if ($$asap$$isWorker) { $$asap$$scheduleFlush = $$asap$$useMessageChannel(); } else { $$asap$$scheduleFlush = $$asap$$useSetTimeout(); } function $$$internal$$noop() {} var $$$internal$$PENDING = void 0; var $$$internal$$FULFILLED = 1; var $$$internal$$REJECTED = 2; var $$$internal$$GET_THEN_ERROR = new $$$internal$$ErrorObject(); function $$$internal$$selfFullfillment() { return new TypeError("You cannot resolve a promise with itself"); } function $$$internal$$cannotReturnOwn() { return new TypeError('A promises callback cannot return that same promise.') } function $$$internal$$getThen(promise) { try { return promise.then; } catch(error) { $$$internal$$GET_THEN_ERROR.error = error; return $$$internal$$GET_THEN_ERROR; } } function $$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { try { then.call(value, fulfillmentHandler, rejectionHandler); } catch(e) { return e; } } function $$$internal$$handleForeignThenable(promise, thenable, then) { $$asap$$default(function(promise) { var sealed = false; var error = $$$internal$$tryThen(then, thenable, function(value) { if (sealed) { return; } sealed = true; if (thenable !== value) { $$$internal$$resolve(promise, value); } else { $$$internal$$fulfill(promise, value); } }, function(reason) { if (sealed) { return; } sealed = true; $$$internal$$reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; $$$internal$$reject(promise, error); } }, promise); } function $$$internal$$handleOwnThenable(promise, thenable) { if (thenable._state === $$$internal$$FULFILLED) { $$$internal$$fulfill(promise, thenable._result); } else if (promise._state === $$$internal$$REJECTED) { $$$internal$$reject(promise, thenable._result); } else { $$$internal$$subscribe(thenable, undefined, function(value) { $$$internal$$resolve(promise, value); }, function(reason) { $$$internal$$reject(promise, reason); }); } } function $$$internal$$handleMaybeThenable(promise, maybeThenable) { if (maybeThenable.constructor === promise.constructor) { $$$internal$$handleOwnThenable(promise, maybeThenable); } else { var then = $$$internal$$getThen(maybeThenable); if (then === $$$internal$$GET_THEN_ERROR) { $$$internal$$reject(promise, $$$internal$$GET_THEN_ERROR.error); } else if (then === undefined) { $$$internal$$fulfill(promise, maybeThenable); } else if ($$utils$$isFunction(then)) { $$$internal$$handleForeignThenable(promise, maybeThenable, then); } else { $$$internal$$fulfill(promise, maybeThenable); } } } function $$$internal$$resolve(promise, value) { if (promise === value) { $$$internal$$reject(promise, $$$internal$$selfFullfillment()); } else if ($$utils$$objectOrFunction(value)) { $$$internal$$handleMaybeThenable(promise, value); } else { $$$internal$$fulfill(promise, value); } } function $$$internal$$publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result); } $$$internal$$publish(promise); } function $$$internal$$fulfill(promise, value) { if (promise._state !== $$$internal$$PENDING) { return; } promise._result = value; promise._state = $$$internal$$FULFILLED; if (promise._subscribers.length === 0) { } else { $$asap$$default($$$internal$$publish, promise); } } function $$$internal$$reject(promise, reason) { if (promise._state !== $$$internal$$PENDING) { return; } promise._state = $$$internal$$REJECTED; promise._result = reason; $$asap$$default($$$internal$$publishRejection, promise); } function $$$internal$$subscribe(parent, child, onFulfillment, onRejection) { var subscribers = parent._subscribers; var length = subscribers.length; parent._onerror = null; subscribers[length] = child; subscribers[length + $$$internal$$FULFILLED] = onFulfillment; subscribers[length + $$$internal$$REJECTED] = onRejection; if (length === 0 && parent._state) { $$asap$$default($$$internal$$publish, parent); } } function $$$internal$$publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return; } var child, callback, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { $$$internal$$invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function $$$internal$$ErrorObject() { this.error = null; } var $$$internal$$TRY_CATCH_ERROR = new $$$internal$$ErrorObject(); function $$$internal$$tryCatch(callback, detail) { try { return callback(detail); } catch(e) { $$$internal$$TRY_CATCH_ERROR.error = e; return $$$internal$$TRY_CATCH_ERROR; } } function $$$internal$$invokeCallback(settled, promise, callback, detail) { var hasCallback = $$utils$$isFunction(callback), value, error, succeeded, failed; if (hasCallback) { value = $$$internal$$tryCatch(callback, detail); if (value === $$$internal$$TRY_CATCH_ERROR) { failed = true; error = value.error; value = null; } else { succeeded = true; } if (promise === value) { $$$internal$$reject(promise, $$$internal$$cannotReturnOwn()); return; } } else { value = detail; succeeded = true; } if (promise._state !== $$$internal$$PENDING) { // noop } else if (hasCallback && succeeded) { $$$internal$$resolve(promise, value); } else if (failed) { $$$internal$$reject(promise, error); } else if (settled === $$$internal$$FULFILLED) { $$$internal$$fulfill(promise, value); } else if (settled === $$$internal$$REJECTED) { $$$internal$$reject(promise, value); } } function $$$internal$$initializePromise(promise, resolver) { try { resolver(function resolvePromise(value){ $$$internal$$resolve(promise, value); }, function rejectPromise(reason) { $$$internal$$reject(promise, reason); }); } catch(e) { $$$internal$$reject(promise, e); } } function $$$enumerator$$makeSettledResult(state, position, value) { if (state === $$$internal$$FULFILLED) { return { state: 'fulfilled', value: value }; } else { return { state: 'rejected', reason: value }; } } function $$$enumerator$$Enumerator(Constructor, input, abortOnReject, label) { this._instanceConstructor = Constructor; this.promise = new Constructor($$$internal$$noop, label); this._abortOnReject = abortOnReject; if (this._validateInput(input)) { this._input = input; this.length = input.length; this._remaining = input.length; this._init(); if (this.length === 0) { $$$internal$$fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(); if (this._remaining === 0) { $$$internal$$fulfill(this.promise, this._result); } } } else { $$$internal$$reject(this.promise, this._validationError()); } } $$$enumerator$$Enumerator.prototype._validateInput = function(input) { return $$utils$$isArray(input); }; $$$enumerator$$Enumerator.prototype._validationError = function() { return new Error('Array Methods must be provided an Array'); }; $$$enumerator$$Enumerator.prototype._init = function() { this._result = new Array(this.length); }; var $$$enumerator$$default = $$$enumerator$$Enumerator; $$$enumerator$$Enumerator.prototype._enumerate = function() { var length = this.length; var promise = this.promise; var input = this._input; for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) { this._eachEntry(input[i], i); } }; $$$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { var c = this._instanceConstructor; if ($$utils$$isMaybeThenable(entry)) { if (entry.constructor === c && entry._state !== $$$internal$$PENDING) { entry._onerror = null; this._settledAt(entry._state, i, entry._result); } else { this._willSettleAt(c.resolve(entry), i); } } else { this._remaining--; this._result[i] = this._makeResult($$$internal$$FULFILLED, i, entry); } }; $$$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { var promise = this.promise; if (promise._state === $$$internal$$PENDING) { this._remaining--; if (this._abortOnReject && state === $$$internal$$REJECTED) { $$$internal$$reject(promise, value); } else { this._result[i] = this._makeResult(state, i, value); } } if (this._remaining === 0) { $$$internal$$fulfill(promise, this._result); } }; $$$enumerator$$Enumerator.prototype._makeResult = function(state, i, value) { return value; }; $$$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { var enumerator = this; $$$internal$$subscribe(promise, undefined, function(value) { enumerator._settledAt($$$internal$$FULFILLED, i, value); }, function(reason) { enumerator._settledAt($$$internal$$REJECTED, i, reason); }); }; var $$promise$all$$default = function all(entries, label) { return new $$$enumerator$$default(this, entries, true /* abort on reject */, label).promise; }; var $$promise$race$$default = function race(entries, label) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor($$$internal$$noop, label); if (!$$utils$$isArray(entries)) { $$$internal$$reject(promise, new TypeError('You must pass an array to race.')); return promise; } var length = entries.length; function onFulfillment(value) { $$$internal$$resolve(promise, value); } function onRejection(reason) { $$$internal$$reject(promise, reason); } for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) { $$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); } return promise; }; var $$promise$resolve$$default = function resolve(object, label) { /*jshint validthis:true */ var Constructor = this; if (object && typeof object === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor($$$internal$$noop, label); $$$internal$$resolve(promise, object); return promise; }; var $$promise$reject$$default = function reject(reason, label) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor($$$internal$$noop, label); $$$internal$$reject(promise, reason); return promise; }; var $$es6$promise$promise$$counter = 0; function $$es6$promise$promise$$needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function $$es6$promise$promise$$needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } var $$es6$promise$promise$$default = $$es6$promise$promise$$Promise; /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js var promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class Promise @param {function} resolver Useful for tooling. @constructor */ function $$es6$promise$promise$$Promise(resolver) { this._id = $$es6$promise$promise$$counter++; this._state = undefined; this._result = undefined; this._subscribers = []; if ($$$internal$$noop !== resolver) { if (!$$utils$$isFunction(resolver)) { $$es6$promise$promise$$needsResolver(); } if (!(this instanceof $$es6$promise$promise$$Promise)) { $$es6$promise$promise$$needsNew(); } $$$internal$$initializePromise(this, resolver); } } $$es6$promise$promise$$Promise.all = $$promise$all$$default; $$es6$promise$promise$$Promise.race = $$promise$race$$default; $$es6$promise$promise$$Promise.resolve = $$promise$resolve$$default; $$es6$promise$promise$$Promise.reject = $$promise$reject$$default; $$es6$promise$promise$$Promise.prototype = { constructor: $$es6$promise$promise$$Promise, /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript var result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript var author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfilled @param {Function} onRejected Useful for tooling. @return {Promise} */ then: function(onFulfillment, onRejection) { var parent = this; var state = parent._state; if (state === $$$internal$$FULFILLED && !onFulfillment || state === $$$internal$$REJECTED && !onRejection) { return this; } var child = new this.constructor($$$internal$$noop); var result = parent._result; if (state) { var callback = arguments[state - 1]; $$asap$$default(function(){ $$$internal$$invokeCallback(state, child, callback, result); }); } else { $$$internal$$subscribe(parent, child, onFulfillment, onRejection); } return child; }, /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection Useful for tooling. @return {Promise} */ 'catch': function(onRejection) { return this.then(null, onRejection); } }; var $$es6$promise$polyfill$$default = function polyfill() { var local; if (typeof global !== 'undefined') { local = global; } else if (typeof window !== 'undefined' && window.document) { local = window; } else { local = self; } var es6PromiseSupport = "Promise" in local && // Some of these methods are missing from // Firefox/Chrome experimental implementations "resolve" in local.Promise && "reject" in local.Promise && "all" in local.Promise && "race" in local.Promise && // Older version of the spec had a resolver object // as the arg rather than a function (function() { var resolve; new local.Promise(function(r) { resolve = r; }); return $$utils$$isFunction(resolve); }()); if (!es6PromiseSupport) { local.Promise = $$es6$promise$promise$$default; } }; var es6$promise$umd$$ES6Promise = { 'Promise': $$es6$promise$promise$$default, 'polyfill': $$es6$promise$polyfill$$default }; /* global define:true module:true window: true */ if (typeof define === 'function' && define['amd']) { define(function() { return es6$promise$umd$$ES6Promise; }); } else if (typeof module !== 'undefined' && module['exports']) { module['exports'] = es6$promise$umd$$ES6Promise; } else if (typeof this !== 'undefined') { this['ES6Promise'] = es6$promise$umd$$ES6Promise; } }).call(this); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"_process":3}],3:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; var queue = []; var draining = false; function drainQueue() { if (draining) { return; } draining = true; var currentQueue; var len = queue.length; while(len) { currentQueue = queue; queue = []; var i = -1; while (++i < len) { currentQueue[i](); } len = queue.length; } draining = false; } process.nextTick = function (fun) { queue.push(fun); if (!draining) { setTimeout(drainQueue, 0); } }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues 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'); }; process.umask = function() { return 0; }; },{}],4:[function(require,module,exports){ var indexOf = require('./indexOf'); /** * If array contains values. */ function contains(arr, val) { return indexOf(arr, val) !== -1; } module.exports = contains; },{"./indexOf":6}],5:[function(require,module,exports){ /** * Array forEach */ function forEach(arr, callback, thisObj) { if (arr == null) { return; } var i = -1, len = arr.length; while (++i < len) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 if ( callback.call(thisObj, arr[i], i, arr) === false ) { break; } } } module.exports = forEach; },{}],6:[function(require,module,exports){ /** * Array.indexOf */ function indexOf(arr, item, fromIndex) { fromIndex = fromIndex || 0; if (arr == null) { return -1; } var len = arr.length, i = fromIndex < 0 ? len + fromIndex : fromIndex; while (i < len) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 if (arr[i] === item) { return i; } i++; } return -1; } module.exports = indexOf; },{}],7:[function(require,module,exports){ var indexOf = require('./indexOf'); /** * Remove a single item from the array. * (it won't remove duplicates, just a single item) */ function remove(arr, item){ var idx = indexOf(arr, item); if (idx !== -1) arr.splice(idx, 1); } module.exports = remove; },{"./indexOf":6}],8:[function(require,module,exports){ /** * Create slice of source array or array-like object */ function slice(arr, start, end){ var len = arr.length; if (start == null) { start = 0; } else if (start < 0) { start = Math.max(len + start, 0); } else { start = Math.min(start, len); } if (end == null) { end = len; } else if (end < 0) { end = Math.max(len + end, 0); } else { end = Math.min(end, len); } var result = []; while (start < end) { result.push(arr[start++]); } return result; } module.exports = slice; },{}],9:[function(require,module,exports){ /** * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) */ function mergeSort(arr, compareFn) { if (arr == null) { return []; } else if (arr.length < 2) { return arr; } if (compareFn == null) { compareFn = defaultCompare; } var mid, left, right; mid = ~~(arr.length / 2); left = mergeSort( arr.slice(0, mid), compareFn ); right = mergeSort( arr.slice(mid, arr.length), compareFn ); return merge(left, right, compareFn); } function defaultCompare(a, b) { return a < b ? -1 : (a > b? 1 : 0); } function merge(left, right, compareFn) { var result = []; while (left.length && right.length) { if (compareFn(left[0], right[0]) <= 0) { // if 0 it should preserve same order (stable) result.push(left.shift()); } else { result.push(right.shift()); } } if (left.length) { result.push.apply(result, left); } if (right.length) { result.push.apply(result, right); } return result; } module.exports = mergeSort; },{}],10:[function(require,module,exports){ /** * Checks if the value is created by the `Object` constructor. */ function isPlainObject(value) { return (!!value && typeof value === 'object' && value.constructor === Object); } module.exports = isPlainObject; },{}],11:[function(require,module,exports){ /** * Checks if the object is a primitive */ function isPrimitive(value) { // Using switch fallthrough because it's simple to read and is // generally fast: http://jsperf.com/testing-value-is-primitive/5 switch (typeof value) { case "string": case "number": case "boolean": return true; } return value == null; } module.exports = isPrimitive; },{}],12:[function(require,module,exports){ /** * Typecast a value to a String, using an empty string value for null or * undefined. */ function toString(val){ return val == null ? '' : val.toString(); } module.exports = toString; },{}],13:[function(require,module,exports){ var forOwn = require('./forOwn'); var isPlainObject = require('../lang/isPlainObject'); /** * Mixes objects into the target object, recursively mixing existing child * objects. */ function deepMixIn(target, objects) { var i = 0, n = arguments.length, obj; while(++i < n){ obj = arguments[i]; if (obj) { forOwn(obj, copyProp, target); } } return target; } function copyProp(val, key) { var existing = this[key]; if (isPlainObject(val) && isPlainObject(existing)) { deepMixIn(existing, val); } else { this[key] = val; } } module.exports = deepMixIn; },{"../lang/isPlainObject":10,"./forOwn":15}],14:[function(require,module,exports){ var hasOwn = require('./hasOwn'); var _hasDontEnumBug, _dontEnums; function checkDontEnum(){ _dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; _hasDontEnumBug = true; for (var key in {'toString': null}) { _hasDontEnumBug = false; } } /** * Similar to Array/forEach but works over object properties and fixes Don't * Enum bug on IE. * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation */ function forIn(obj, fn, thisObj){ var key, i = 0; // no need to check if argument is a real object that way we can use // it for arrays, functions, date, etc. //post-pone check till needed if (_hasDontEnumBug == null) checkDontEnum(); for (key in obj) { if (exec(fn, obj, key, thisObj) === false) { break; } } if (_hasDontEnumBug) { var ctor = obj.constructor, isProto = !!ctor && obj === ctor.prototype; while (key = _dontEnums[i++]) { // For constructor, if it is a prototype object the constructor // is always non-enumerable unless defined otherwise (and // enumerated above). For non-prototype objects, it will have // to be defined on this object, since it cannot be defined on // any prototype objects. // // For other [[DontEnum]] properties, check if the value is // different than Object prototype value. if ( (key !== 'constructor' || (!isProto && hasOwn(obj, key))) && obj[key] !== Object.prototype[key] ) { if (exec(fn, obj, key, thisObj) === false) { break; } } } } } function exec(fn, obj, key, thisObj){ return fn.call(thisObj, obj[key], key, obj); } module.exports = forIn; },{"./hasOwn":17}],15:[function(require,module,exports){ var hasOwn = require('./hasOwn'); var forIn = require('./forIn'); /** * Similar to Array/forEach but works over object properties and fixes Don't * Enum bug on IE. * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation */ function forOwn(obj, fn, thisObj){ forIn(obj, function(val, key){ if (hasOwn(obj, key)) { return fn.call(thisObj, obj[key], key, obj); } }); } module.exports = forOwn; },{"./forIn":14,"./hasOwn":17}],16:[function(require,module,exports){ var isPrimitive = require('../lang/isPrimitive'); /** * get "nested" object property */ function get(obj, prop){ var parts = prop.split('.'), last = parts.pop(); while (prop = parts.shift()) { obj = obj[prop]; if (obj == null) return; } return obj[last]; } module.exports = get; },{"../lang/isPrimitive":11}],17:[function(require,module,exports){ /** * Safer Object.hasOwnProperty */ function hasOwn(obj, prop){ return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = hasOwn; },{}],18:[function(require,module,exports){ var forEach = require('../array/forEach'); /** * Create nested object if non-existent */ function namespace(obj, path){ if (!path) return obj; forEach(path.split('.'), function(key){ if (!obj[key]) { obj[key] = {}; } obj = obj[key]; }); return obj; } module.exports = namespace; },{"../array/forEach":5}],19:[function(require,module,exports){ var slice = require('../array/slice'); /** * Return a copy of the object, filtered to only have values for the whitelisted keys. */ function pick(obj, var_keys){ var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), out = {}, i = 0, key; while (key = keys[i++]) { out[key] = obj[key]; } return out; } module.exports = pick; },{"../array/slice":8}],20:[function(require,module,exports){ var namespace = require('./namespace'); /** * set "nested" object property */ function set(obj, prop, val){ var parts = (/^(.+)\.(.+)$/).exec(prop); if (parts){ namespace(obj, parts[1])[parts[2]] = val; } else { obj[prop] = val; } } module.exports = set; },{"./namespace":18}],21:[function(require,module,exports){ var toString = require('../lang/toString'); var replaceAccents = require('./replaceAccents'); var removeNonWord = require('./removeNonWord'); var upperCase = require('./upperCase'); var lowerCase = require('./lowerCase'); /** * Convert string to camelCase text. */ function camelCase(str){ str = toString(str); str = replaceAccents(str); str = removeNonWord(str) .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE .replace(/\s+/g, '') //remove spaces .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase return str; } module.exports = camelCase; },{"../lang/toString":12,"./lowerCase":22,"./removeNonWord":24,"./replaceAccents":25,"./upperCase":26}],22:[function(require,module,exports){ var toString = require('../lang/toString'); /** * "Safer" String.toLowerCase() */ function lowerCase(str){ str = toString(str); return str.toLowerCase(); } module.exports = lowerCase; },{"../lang/toString":12}],23:[function(require,module,exports){ var toString = require('../lang/toString'); var camelCase = require('./camelCase'); var upperCase = require('./upperCase'); /** * camelCase + UPPERCASE first char */ function pascalCase(str){ str = toString(str); return camelCase(str).replace(/^[a-z]/, upperCase); } module.exports = pascalCase; },{"../lang/toString":12,"./camelCase":21,"./upperCase":26}],24:[function(require,module,exports){ var toString = require('../lang/toString'); // This pattern is generated by the _build/pattern-removeNonWord.js script var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; /** * Remove non-word chars. */ function removeNonWord(str){ str = toString(str); return str.replace(PATTERN, ''); } module.exports = removeNonWord; },{"../lang/toString":12}],25:[function(require,module,exports){ var toString = require('../lang/toString'); /** * Replaces all accented chars with regular ones */ function replaceAccents(str){ str = toString(str); // verifies if the String has accents and replace them if (str.search(/[\xC0-\xFF]/g) > -1) { str = str .replace(/[\xC0-\xC5]/g, "A") .replace(/[\xC6]/g, "AE") .replace(/[\xC7]/g, "C") .replace(/[\xC8-\xCB]/g, "E") .replace(/[\xCC-\xCF]/g, "I") .replace(/[\xD0]/g, "D") .replace(/[\xD1]/g, "N") .replace(/[\xD2-\xD6\xD8]/g, "O") .replace(/[\xD9-\xDC]/g, "U") .replace(/[\xDD]/g, "Y") .replace(/[\xDE]/g, "P") .replace(/[\xE0-\xE5]/g, "a") .replace(/[\xE6]/g, "ae") .replace(/[\xE7]/g, "c") .replace(/[\xE8-\xEB]/g, "e") .replace(/[\xEC-\xEF]/g, "i") .replace(/[\xF1]/g, "n") .replace(/[\xF2-\xF6\xF8]/g, "o") .replace(/[\xF9-\xFC]/g, "u") .replace(/[\xFE]/g, "p") .replace(/[\xFD\xFF]/g, "y"); } return str; } module.exports = replaceAccents; },{"../lang/toString":12}],26:[function(require,module,exports){ var toString = require('../lang/toString'); /** * "Safer" String.toUpperCase() */ function upperCase(str){ str = toString(str); return str.toUpperCase(); } module.exports = upperCase; },{"../lang/toString":12}],27:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function create(resourceName, attrs, options) { var _this = this; var definition = _this.definitions[resourceName]; options = options || {}; attrs = attrs || {}; var rejectionError; if (!definition) { rejectionError = new DSErrors.NER(resourceName); } else if (!DSUtils.isObject(attrs)) { rejectionError = new DSErrors.IA('"attrs" must be an object!'); } else { options = DSUtils._(definition, options); if (options.upsert && (DSUtils.isString(attrs[definition.idAttribute]) || DSUtils.isNumber(attrs[definition.idAttribute]))) { return _this.update(resourceName, attrs[definition.idAttribute], attrs, options); } } return new DSUtils.Promise(function (resolve, reject) { if (rejectionError) { reject(rejectionError); } else { resolve(attrs); } }) .then(function (attrs) { return options.beforeValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.validate.call(attrs, options, attrs); }) .then(function (attrs) { return options.afterValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.beforeCreate.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'beforeCreate', DSUtils.copy(attrs)); } return _this.getAdapter(options).create(definition, attrs, options); }) .then(function (attrs) { return options.afterCreate.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'afterCreate', DSUtils.copy(attrs)); } if (options.cacheResponse) { var created = _this.inject(definition.name, attrs, options); var id = created[definition.idAttribute]; _this.store[resourceName].completedQueries[id] = new Date().getTime(); return created; } else { return _this.createInstance(resourceName, attrs, options); } }); } module.exports = create; },{"../../errors":48,"../../utils":50}],28:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function destroy(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; var item; return new DSUtils.Promise(function (resolve, reject) { id = DSUtils.resolveId(definition, id); if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { reject(new DSErrors.IA('"id" must be a string or a number!')); } else { item = _this.get(resourceName, id) || { id: id }; options = DSUtils._(definition, options); resolve(item); } }) .then(function (attrs) { return options.beforeDestroy.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'beforeDestroy', DSUtils.copy(attrs)); } if (options.eagerEject) { _this.eject(resourceName, id); } return _this.getAdapter(options).destroy(definition, id, options); }) .then(function () { return options.afterDestroy.call(item, options, item); }) .then(function (item) { if (options.notify) { _this.emit(options, 'afterDestroy', DSUtils.copy(item)); } _this.eject(resourceName, id); return id; })['catch'](function (err) { if (options && options.eagerEject && item) { _this.inject(resourceName, item, { notify: false }); } throw err; }); } module.exports = destroy; },{"../../errors":48,"../../utils":50}],29:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function destroyAll(resourceName, params, options) { var _this = this; var definition = _this.definitions[resourceName]; var ejected, toEject; params = params || {}; return new DSUtils.Promise(function (resolve, reject) { if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isObject(params)) { reject(new DSErrors.IA('"params" must be an object!')); } else { options = DSUtils._(definition, options); resolve(); } }).then(function () { toEject = _this.defaults.defaultFilter.call(_this, resourceName, params); return options.beforeDestroy(options, toEject); }).then(function () { if (options.notify) { _this.emit(options, 'beforeDestroy', DSUtils.copy(toEject)); } if (options.eagerEject) { ejected = _this.ejectAll(resourceName, params); } return _this.getAdapter(options).destroyAll(definition, params, options); }).then(function () { return options.afterDestroy(options, toEject); }).then(function () { if (options.notify) { _this.emit(options, 'afterDestroy', DSUtils.copy(toEject)); } return ejected || _this.ejectAll(resourceName, params); })['catch'](function (err) { if (options && options.eagerEject && ejected) { _this.inject(resourceName, ejected, { notify: false }); } throw err; }); } module.exports = destroyAll; },{"../../errors":48,"../../utils":50}],30:[function(require,module,exports){ /* jshint -W082 */ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function find(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; return new DSUtils.Promise(function (resolve, reject) { if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { reject(new DSErrors.IA('"id" must be a string or a number!')); } else { options = DSUtils._(definition, options); if (options.params) { options.params = DSUtils.copy(options.params); } if (options.bypassCache || !options.cacheResponse) { delete resource.completedQueries[id]; } if (id in resource.completedQueries) { resolve(_this.get(resourceName, id)); } else { resolve(); } } }).then(function (item) { if (!(id in resource.completedQueries)) { if (!(id in resource.pendingQueries)) { var promise; var strategy = options.findStrategy || options.strategy; if (strategy === 'fallback') { function makeFallbackCall(index) { return _this.getAdapter((options.findFallbackAdapters || options.fallbackAdapters)[index]).find(definition, id, options)['catch'](function (err) { index++; if (index < options.fallbackAdapters.length) { return makeFallbackCall(index); } else { return Promise.reject(err); } }); } promise = makeFallbackCall(0); } else { promise = _this.getAdapter(options).find(definition, id, options); } resource.pendingQueries[id] = promise.then(function (data) { // Query is no longer pending delete resource.pendingQueries[id]; if (options.cacheResponse) { resource.completedQueries[id] = new Date().getTime(); return _this.inject(resourceName, data, options); } else { return _this.createInstance(resourceName, data, options); } }); } return resource.pendingQueries[id]; } else { return item; } })['catch'](function (err) { if (resource) { delete resource.pendingQueries[id]; } throw err; }); } module.exports = find; },{"../../errors":48,"../../utils":50}],31:[function(require,module,exports){ /* jshint -W082 */ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function processResults(data, resourceName, queryHash, options) { var _this = this; var resource = _this.store[resourceName]; var idAttribute = _this.definitions[resourceName].idAttribute; var date = new Date().getTime(); data = data || []; // Query is no longer pending delete resource.pendingQueries[queryHash]; resource.completedQueries[queryHash] = date; // Update modified timestamp of collection resource.collectionModified = DSUtils.updateTimestamp(resource.collectionModified); // Merge the new values into the cache var injected = _this.inject(resourceName, data, options); // Make sure each object is added to completedQueries if (DSUtils.isArray(injected)) { DSUtils.forEach(injected, function (item) { if (item && item[idAttribute]) { resource.completedQueries[item[idAttribute]] = date; } }); } else { options.errorFn('response is expected to be an array!'); resource.completedQueries[injected[idAttribute]] = date; } return injected; } function findAll(resourceName, params, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; var queryHash; return new DSUtils.Promise(function (resolve, reject) { params = params || {}; if (!_this.definitions[resourceName]) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isObject(params)) { reject(new DSErrors.IA('"params" must be an object!')); } else { options = DSUtils._(definition, options); queryHash = DSUtils.toJson(params); if (options.params) { options.params = DSUtils.copy(options.params); } if (options.bypassCache || !options.cacheResponse) { delete resource.completedQueries[queryHash]; delete resource.queryData[queryHash]; } if (queryHash in resource.completedQueries) { if (options.useFilter) { resolve(_this.filter(resourceName, params, options)); } else { resolve(resource.queryData[queryHash]); } } else { resolve(); } } }).then(function (items) { if (!(queryHash in resource.completedQueries)) { if (!(queryHash in resource.pendingQueries)) { var promise; var strategy = options.findAllStrategy || options.strategy; if (strategy === 'fallback') { function makeFallbackCall(index) { return _this.getAdapter((options.findAllFallbackAdapters || options.fallbackAdapters)[index]).findAll(definition, params, options)['catch'](function (err) { index++; if (index < options.fallbackAdapters.length) { return makeFallbackCall(index); } else { return Promise.reject(err); } }); } promise = makeFallbackCall(0); } else { promise = _this.getAdapter(options).findAll(definition, params, options); } resource.pendingQueries[queryHash] = promise.then(function (data) { delete resource.pendingQueries[queryHash]; if (options.cacheResponse) { resource.queryData[queryHash] = processResults.call(_this, data, resourceName, queryHash, options); resource.queryData[queryHash].$$injected = true; return resource.queryData[queryHash]; } else { DSUtils.forEach(data, function (item, i) { data[i] = _this.createInstance(resourceName, item, options); }); return data; } }); } return resource.pendingQueries[queryHash]; } else { return items; } })['catch'](function (err) { if (resource) { delete resource.pendingQueries[queryHash]; } throw err; }); } module.exports = findAll; },{"../../errors":48,"../../utils":50}],32:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function reap(resourceName, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; return new DSUtils.Promise(function (resolve, reject) { if (!definition) { reject(new _this.errors.NER(resourceName)); } else { options = DSUtils._(definition, options); if (!options.hasOwnProperty('notify')) { options.notify = false; } var items = []; var now = new Date().getTime(); var expiredItem; while ((expiredItem = resource.expiresHeap.peek()) && expiredItem.expires < now) { items.push(expiredItem.item); delete expiredItem.item; resource.expiresHeap.pop(); } resolve(items); } }).then(function (items) { if (options.isInterval || options.notify) { definition.beforeReap(options, items); _this.emit(options, 'beforeReap', DSUtils.copy(items)); } if (options.reapAction === 'inject') { DSUtils.forEach(items, function (item) { var id = item[definition.idAttribute]; resource.expiresHeap.push({ item: item, timestamp: resource.saved[id], expires: definition.maxAge ? resource.saved[id] + definition.maxAge : Number.MAX_VALUE }); }); } else if (options.reapAction === 'eject') { DSUtils.forEach(items, function (item) { _this.eject(resourceName, item[definition.idAttribute]); }); } else if (options.reapAction === 'refresh') { var tasks = []; DSUtils.forEach(items, function (item) { tasks.push(_this.refresh(resourceName, item[definition.idAttribute])); }); return DSUtils.Promise.all(tasks); } return items; }).then(function (items) { if (options.isInterval || options.notify) { definition.afterReap(options, items); _this.emit(options, 'afterReap', DSUtils.copy(items)); } return items; }); } function refresh(resourceName, id, options) { var _this = this; return new DSUtils.Promise(function (resolve, reject) { var definition = _this.definitions[resourceName]; id = DSUtils.resolveId(_this.definitions[resourceName], id); if (!definition) { reject(new _this.errors.NER(resourceName)); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { reject(new DSErrors.IA('"id" must be a string or a number!')); } else { options = DSUtils._(definition, options); options.bypassCache = true; resolve(_this.get(resourceName, id)); } }).then(function (item) { if (item) { return _this.find(resourceName, id, options); } else { return item; } }); } module.exports = { create: require('./create'), destroy: require('./destroy'), destroyAll: require('./destroyAll'), find: require('./find'), findAll: require('./findAll'), loadRelations: require('./loadRelations'), reap: reap, refresh: refresh, save: require('./save'), update: require('./update'), updateAll: require('./updateAll') }; },{"../../errors":48,"../../utils":50,"./create":27,"./destroy":28,"./destroyAll":29,"./find":30,"./findAll":31,"./loadRelations":33,"./save":34,"./update":35,"./updateAll":36}],33:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function loadRelations(resourceName, instance, relations, options) { var _this = this; var definition = _this.definitions[resourceName]; var fields = []; return new DSUtils.Promise(function (resolve, reject) { if (DSUtils.isString(instance) || DSUtils.isNumber(instance)) { instance = _this.get(resourceName, instance); } if (DSUtils.isString(relations)) { relations = [relations]; } if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isObject(instance)) { reject(new DSErrors.IA('"instance(id)" must be a string, number or object!')); } else if (!DSUtils.isArray(relations)) { reject(new DSErrors.IA('"relations" must be a string or an array!')); } else { options = DSUtils._(definition, options); if (!options.hasOwnProperty('findBelongsTo')) { options.findBelongsTo = true; } if (!options.hasOwnProperty('findHasMany')) { options.findHasMany = true; } var tasks = []; DSUtils.forEach(definition.relationList, function (def) { var relationName = def.relation; if (DSUtils.contains(relations, relationName)) { var task; var params = {}; if (options.allowSimpleWhere) { params[def.foreignKey] = instance[definition.idAttribute]; } else { params.where = {}; params.where[def.foreignKey] = { '==': instance[definition.idAttribute] }; } if (def.type === 'hasMany' && params[def.foreignKey]) { task = _this.findAll(relationName, params, options); } else if (def.type === 'hasOne') { if (def.localKey && instance[def.localKey]) { task = _this.find(relationName, instance[def.localKey], options); } else if (def.foreignKey && params[def.foreignKey]) { task = _this.findAll(relationName, params, options).then(function (hasOnes) { return hasOnes.length ? hasOnes[0] : null; }); } } else if (instance[def.localKey]) { task = _this.find(relationName, instance[def.localKey], options); } if (task) { tasks.push(task); fields.push(def.localField); } } }); resolve(tasks); } }) .then(function (tasks) { return DSUtils.Promise.all(tasks); }) .then(function (loadedRelations) { DSUtils.forEach(fields, function (field, index) { instance[field] = loadedRelations[index]; }); return instance; }); } module.exports = loadRelations; },{"../../errors":48,"../../utils":50}],34:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function save(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; var item; return new DSUtils.Promise(function (resolve, reject) { id = DSUtils.resolveId(definition, id); if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { reject(new DSErrors.IA('"id" must be a string or a number!')); } else if (!_this.get(resourceName, id)) { reject(new DSErrors.R('id "' + id + '" not found in cache!')); } else { item = _this.get(resourceName, id); options = DSUtils._(definition, options); resolve(item); } }).then(function (attrs) { return options.beforeValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.validate.call(attrs, options, attrs); }) .then(function (attrs) { return options.afterValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.beforeUpdate.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'beforeUpdate', DSUtils.copy(attrs)); } if (options.changesOnly) { var resource = _this.store[resourceName]; if (DSUtils.w) { resource.observers[id].deliver(); } var toKeep = []; var changes = _this.changes(resourceName, id); for (var key in changes.added) { toKeep.push(key); } for (key in changes.changed) { toKeep.push(key); } changes = DSUtils.pick(attrs, toKeep); if (DSUtils.isEmpty(changes)) { // no changes, return return attrs; } else { attrs = changes; } } return _this.getAdapter(options).update(definition, id, attrs, options); }) .then(function (data) { return options.afterUpdate.call(data, options, data); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'afterUpdate', DSUtils.copy(attrs)); } if (options.cacheResponse) { return _this.inject(definition.name, attrs, options); } else { return _this.createInstance(resourceName, attrs, options); } }); } module.exports = save; },{"../../errors":48,"../../utils":50}],35:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function update(resourceName, id, attrs, options) { var _this = this; var definition = _this.definitions[resourceName]; return new DSUtils.Promise(function (resolve, reject) { id = DSUtils.resolveId(definition, id); if (!definition) { reject(new DSErrors.NER(resourceName)); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { reject(new DSErrors.IA('"id" must be a string or a number!')); } else { options = DSUtils._(definition, options); resolve(attrs); } }).then(function (attrs) { return options.beforeValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.validate.call(attrs, options, attrs); }) .then(function (attrs) { return options.afterValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.beforeUpdate.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'beforeUpdate', DSUtils.copy(attrs)); } return _this.getAdapter(options).update(definition, id, attrs, options); }) .then(function (data) { return options.afterUpdate.call(data, options, data); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'afterUpdate', DSUtils.copy(attrs)); } if (options.cacheResponse) { return _this.inject(definition.name, attrs, options); } else { return _this.createInstance(resourceName, attrs, options); } }); } module.exports = update; },{"../../errors":48,"../../utils":50}],36:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function updateAll(resourceName, attrs, params, options) { var _this = this; var definition = _this.definitions[resourceName]; return new DSUtils.Promise(function (resolve, reject) { if (!definition) { reject(new DSErrors.NER(resourceName)); } else { options = DSUtils._(definition, options); resolve(attrs); } }).then(function (attrs) { return options.beforeValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.validate.call(attrs, options, attrs); }) .then(function (attrs) { return options.afterValidate.call(attrs, options, attrs); }) .then(function (attrs) { return options.beforeUpdate.call(attrs, options, attrs); }) .then(function (attrs) { if (options.notify) { _this.emit(options, 'beforeUpdate', DSUtils.copy(attrs)); } return _this.getAdapter(options).updateAll(definition, attrs, params, options); }) .then(function (data) { return options.afterUpdate.call(data, options, data); }) .then(function (data) { if (options.notify) { _this.emit(options, 'afterUpdate', DSUtils.copy(attrs)); } if (options.cacheResponse) { return _this.inject(definition.name, data, options); } else { var instances = []; DSUtils.forEach(data, function (item) { instances.push(_this.createInstance(resourceName, item, options)); }); return instances; } }); } module.exports = updateAll; },{"../../errors":48,"../../utils":50}],37:[function(require,module,exports){ var DSUtils = require('../utils'); var DSErrors = require('../errors'); var syncMethods = require('./sync_methods'); var asyncMethods = require('./async_methods'); var Schemator; function lifecycleNoopCb(resource, attrs, cb) { cb(null, attrs); } function lifecycleNoop(resource, attrs) { return attrs; } function compare(orderBy, index, a, b) { var def = orderBy[index]; var cA = DSUtils.get(a, def[0]), cB = DSUtils.get(b, def[0]); if (DSUtils.isString(cA)) { cA = DSUtils.upperCase(cA); } if (DSUtils.isString(cB)) { cB = DSUtils.upperCase(cB); } if (def[1] === 'DESC') { if (cB < cA) { return -1; } else if (cB > cA) { return 1; } else { if (index < orderBy.length - 1) { return compare(orderBy, index + 1, a, b); } else { return 0; } } } else { if (cA < cB) { return -1; } else if (cA > cB) { return 1; } else { if (index < orderBy.length - 1) { return compare(orderBy, index + 1, a, b); } else { return 0; } } } } function Defaults() { } var defaultsPrototype = Defaults.prototype; defaultsPrototype.actions = {}; defaultsPrototype.afterCreate = lifecycleNoopCb; defaultsPrototype.afterCreateInstance = lifecycleNoop; defaultsPrototype.afterDestroy = lifecycleNoopCb; defaultsPrototype.afterEject = lifecycleNoop; defaultsPrototype.afterInject = lifecycleNoop; defaultsPrototype.afterReap = lifecycleNoop; defaultsPrototype.afterUpdate = lifecycleNoopCb; defaultsPrototype.afterValidate = lifecycleNoopCb; defaultsPrototype.allowSimpleWhere = true; defaultsPrototype.basePath = ''; defaultsPrototype.beforeCreate = lifecycleNoopCb; defaultsPrototype.beforeCreateInstance = lifecycleNoop; defaultsPrototype.beforeDestroy = lifecycleNoopCb; defaultsPrototype.beforeEject = lifecycleNoop; defaultsPrototype.beforeInject = lifecycleNoop; defaultsPrototype.beforeReap = lifecycleNoop; defaultsPrototype.beforeUpdate = lifecycleNoopCb; defaultsPrototype.beforeValidate = lifecycleNoopCb; defaultsPrototype.bypassCache = false; defaultsPrototype.cacheResponse = !!DSUtils.w; defaultsPrototype.defaultAdapter = 'http'; defaultsPrototype.debug = true; defaultsPrototype.eagerEject = false; // TODO: Implement eagerInject in DS#create defaultsPrototype.eagerInject = false; defaultsPrototype.endpoint = ''; defaultsPrototype.error = console ? function (a, b, c) { console[typeof console.error === 'function' ? 'error' : 'log'](a, b, c); } : false; defaultsPrototype.errorFn = function (a, b) { if (this.error && typeof this.error === 'function') { try { if (typeof a === 'string') { throw new Error(a); } else { throw a; } } catch (err) { a = err; } this.error(this.name || null, a || null, b || null); } }; defaultsPrototype.fallbackAdapters = ['http']; defaultsPrototype.findBelongsTo = true; defaultsPrototype.findHasOne = true; defaultsPrototype.findHasMany = true; defaultsPrototype.findInverseLinks = true; defaultsPrototype.idAttribute = 'id'; defaultsPrototype.ignoredChanges = [/\$/]; defaultsPrototype.ignoreMissing = false; defaultsPrototype.keepChangeHistory = false; defaultsPrototype.loadFromServer = false; defaultsPrototype.log = console ? function (a, b, c, d, e) { console[typeof console.info === 'function' ? 'info' : 'log'](a, b, c, d, e); } : false; defaultsPrototype.logFn = function (a, b, c, d) { if (this.debug && this.log && typeof this.log === 'function') { this.log(this.name || null, a || null, b || null, c || null, d || null); } }; defaultsPrototype.maxAge = false; defaultsPrototype.notify = !!DSUtils.w; defaultsPrototype.reapAction = !!DSUtils.w ? 'inject' : 'none'; defaultsPrototype.reapInterval = !!DSUtils.w ? 30000 : false; defaultsPrototype.resetHistoryOnInject = true; defaultsPrototype.strategy = 'single'; defaultsPrototype.upsert = !!DSUtils.w; defaultsPrototype.useClass = true; defaultsPrototype.useFilter = false; defaultsPrototype.validate = lifecycleNoopCb; defaultsPrototype.defaultFilter = function (collection, resourceName, params, options) { var _this = this; var filtered = collection; var where = null; var reserved = { skip: '', offset: '', where: '', limit: '', orderBy: '', sort: '' }; params = params || {}; options = options || {}; if (DSUtils.isObject(params.where)) { where = params.where; } else { where = {}; } if (options.allowSimpleWhere) { DSUtils.forOwn(params, function (value, key) { if (!(key in reserved) && !(key in where)) { where[key] = { '==': value }; } }); } if (DSUtils.isEmpty(where)) { where = null; } if (where) { filtered = DSUtils.filter(filtered, function (attrs) { var first = true; var keep = true; DSUtils.forOwn(where, function (clause, field) { if (DSUtils.isString(clause)) { clause = { '===': clause }; } else if (DSUtils.isNumber(clause) || DSUtils.isBoolean(clause)) { clause = { '==': clause }; } if (DSUtils.isObject(clause)) { DSUtils.forOwn(clause, function (term, op) { var expr; var isOr = op[0] === '|'; var val = attrs[field]; op = isOr ? op.substr(1) : op; if (op === '==') { expr = val == term; } else if (op === '===') { expr = val === term; } else if (op === '!=') { expr = val != term; } else if (op === '!==') { expr = val !== term; } else if (op === '>') { expr = val > term; } else if (op === '>=') { expr = val >= term; } else if (op === '<') { expr = val < term; } else if (op === '<=') { expr = val <= term; } else if (op === 'isectEmpty') { expr = !DSUtils.intersection((val || []), (term || [])).length; } else if (op === 'isectNotEmpty') { expr = DSUtils.intersection((val || []), (term || [])).length; } else if (op === 'in') { if (DSUtils.isString(term)) { expr = term.indexOf(val) !== -1; } else { expr = DSUtils.contains(term, val); } } else if (op === 'notIn') { if (DSUtils.isString(term)) { expr = term.indexOf(val) === -1; } else { expr = !DSUtils.contains(term, val); } } else if (op === 'contains') { if (DSUtils.isString(val)) { expr = val.indexOf(term) !== -1; } else { expr = DSUtils.contains(val, term); } } else if (op === 'notContains') { if (DSUtils.isString(val)) { expr = val.indexOf(term) === -1; } else { expr = !DSUtils.contains(val, term); } } if (expr !== undefined) { keep = first ? expr : (isOr ? keep || expr : keep && expr); } first = false; }); } }); return keep; }); } var orderBy = null; if (DSUtils.isString(params.orderBy)) { orderBy = [ [params.orderBy, 'ASC'] ]; } else if (DSUtils.isArray(params.orderBy)) { orderBy = params.orderBy; } if (!orderBy && DSUtils.isString(params.sort)) { orderBy = [ [params.sort, 'ASC'] ]; } else if (!orderBy && DSUtils.isArray(params.sort)) { orderBy = params.sort; } // Apply 'orderBy' if (orderBy) { var index = 0; DSUtils.forEach(orderBy, function (def, i) { if (DSUtils.isString(def)) { orderBy[i] = [def, 'ASC']; } else if (!DSUtils.isArray(def)) { throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + DSUtils.toJson(def) + ': Must be a string or an array!', { params: { 'orderBy[i]': { actual: typeof def, expected: 'string|array' } } }); } }); filtered = DSUtils.sort(filtered, function (a, b) { return compare(orderBy, index, a, b); }); } var limit = DSUtils.isNumber(params.limit) ? params.limit : null; var skip = null; if (DSUtils.isNumber(params.skip)) { skip = params.skip; } else if (DSUtils.isNumber(params.offset)) { skip = params.offset; } // Apply 'limit' and 'skip' if (limit && skip) { filtered = DSUtils.slice(filtered, skip, Math.min(filtered.length, skip + limit)); } else if (DSUtils.isNumber(limit)) { filtered = DSUtils.slice(filtered, 0, Math.min(filtered.length, limit)); } else if (DSUtils.isNumber(skip)) { if (skip < filtered.length) { filtered = DSUtils.slice(filtered, skip); } else { filtered = []; } } return filtered; }; function DS(options) { var _this = this; options = options || {}; try { Schemator = require('js-data-schema'); } catch (e) { } if (!Schemator) { try { Schemator = window.Schemator; } catch (e) { } } if (Schemator || options.schemator) { _this.schemator = options.schemator || new Schemator(); } _this.store = {}; _this.definitions = {}; _this.adapters = {}; _this.defaults = new Defaults(); _this.observe = DSUtils.observe; DSUtils.forOwn(options, function (v, k) { _this.defaults[k] = v; }); } var dsPrototype = DS.prototype; dsPrototype.getAdapter = function (options) { var errorIfNotExist = false; options = options || {}; if (DSUtils.isString(options)) { errorIfNotExist = true; options = { adapter: options }; } var adapter = this.adapters[options.adapter]; if (adapter) { return adapter; } else if (errorIfNotExist) { throw new Error(options.adapter + ' is not a registered adapter!'); } else { return this.adapters[options.defaultAdapter]; } }; dsPrototype.registerAdapter = function (name, Adapter, options) { var _this = this; options = options || {}; if (DSUtils.isFunction(Adapter)) { _this.adapters[name] = new Adapter(options); } else { _this.adapters[name] = Adapter; } if (options.default) { _this.defaults.defaultAdapter = name; } }; dsPrototype.emit = function (definition, event) { var args = Array.prototype.slice.call(arguments, 2); args.unshift(definition.name); args.unshift('DS.' + event); definition.emit.apply(definition, args); }; dsPrototype.errors = require('../errors'); dsPrototype.utils = DSUtils; DSUtils.deepMixIn(dsPrototype, syncMethods); DSUtils.deepMixIn(dsPrototype, asyncMethods); module.exports = DS; },{"../errors":48,"../utils":50,"./async_methods":32,"./sync_methods":42,"js-data-schema":"js-data-schema"}],38:[function(require,module,exports){ /*jshint evil:true, loopfunc:true*/ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function Resource(options) { DSUtils.deepMixIn(this, options); if ('endpoint' in options) { this.endpoint = options.endpoint; } else { this.endpoint = this.name; } } var instanceMethods = [ 'compute', 'refresh', 'save', 'update', 'destroy', 'loadRelations', 'changeHistory', 'changes', 'hasChanges', 'lastModified', 'lastSaved', 'link', 'linkInverse', 'previous', 'unlinkInverse' ]; function defineResource(definition) { var _this = this; var definitions = _this.definitions; if (DSUtils.isString(definition)) { definition = { name: definition.replace(/\s/gi, '') }; } if (!DSUtils.isObject(definition)) { throw new DSErrors.IA('"definition" must be an object!'); } else if (!DSUtils.isString(definition.name)) { throw new DSErrors.IA('"name" must be a string!'); } else if (_this.store[definition.name]) { throw new DSErrors.R(definition.name + ' is already registered!'); } try { // Inherit from global defaults Resource.prototype = _this.defaults; definitions[definition.name] = new Resource(definition); var def = definitions[definition.name]; if (!DSUtils.isString(def.idAttribute)) { throw new DSErrors.IA('"idAttribute" must be a string!'); } // Setup nested parent configuration if (def.relations) { def.relationList = []; def.relationFields = []; DSUtils.forOwn(def.relations, function (relatedModels, type) { DSUtils.forOwn(relatedModels, function (defs, relationName) { if (!DSUtils.isArray(defs)) { relatedModels[relationName] = [defs]; } DSUtils.forEach(relatedModels[relationName], function (d) { d.type = type; d.relation = relationName; d.name = def.name; def.relationList.push(d); def.relationFields.push(d.localField); }); }); }); if (def.relations.belongsTo) { DSUtils.forOwn(def.relations.belongsTo, function (relatedModel, modelName) { DSUtils.forEach(relatedModel, function (relation) { if (relation.parent) { def.parent = modelName; def.parentKey = relation.localKey; def.parentField = relation.localField; } }); }); } if (typeof Object.freeze === 'function') { Object.freeze(def.relations); Object.freeze(def.relationList); } } def.getEndpoint = function (id, options) { options.params = options.params || {}; var item; var parentKey = def.parentKey; var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : def.endpoint; var parentField = def.parentField; var parentDef = definitions[def.parent]; var parentId = options.params[parentKey]; if (parentId === false || !parentKey || !parentDef) { if (parentId === false) { delete options.params[parentKey]; } return endpoint; } else { delete options.params[parentKey]; if (DSUtils.isNumber(id) || DSUtils.isString(id)) { item = def.get(id); } else if (DSUtils.isObject(id)) { item = id; } if (item) { parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); } if (parentId) { delete options.endpoint; var _options = {}; DSUtils.forOwn(options, function (value, key) { _options[key] = value; }); return DSUtils.makePath(parentDef.getEndpoint(parentId, DSUtils._(parentDef, _options)), parentId, endpoint); } else { return endpoint; } } }; // Remove this in v0.11.0 and make a breaking change notice // the the `filter` option has been renamed to `defaultFilter` if (def.filter) { def.defaultFilter = def.filter; delete def.filter; } // Create the wrapper class for the new resource def['class'] = DSUtils.pascalCase(definition.name); try { eval('function ' + def['class'] + '() {}'); def[def['class']] = eval(def['class']); } catch (e) { def[def['class']] = function () { }; } // Apply developer-defined methods if (def.methods) { DSUtils.deepMixIn(def[def['class']].prototype, def.methods); } def[def['class']].prototype.set = function (key, value) { DSUtils.set(this, key, value); var observer = _this.store[def.name].observers[this[def.idAttribute]]; if (observer && !DSUtils.observe.hasObjectObserve) { observer.deliver(); } else { _this.compute(def.name, this); } return this; }; def[def['class']].prototype.get = function (key) { return DSUtils.get(this, key); }; // Prepare for computed properties if (def.computed) { DSUtils.forOwn(def.computed, function (fn, field) { if (DSUtils.isFunction(fn)) { def.computed[field] = [fn]; fn = def.computed[field]; } if (def.methods && field in def.methods) { def.errorFn('Computed property "' + field + '" conflicts with previously defined prototype method!'); } var deps; if (fn.length === 1) { var match = fn[0].toString().match(/function.*?\(([\s\S]*?)\)/); deps = match[1].split(','); def.computed[field] = deps.concat(fn); fn = def.computed[field]; if (deps.length) { def.errorFn('Use the computed property array syntax for compatibility with minified code!'); } } deps = fn.slice(0, fn.length - 1); DSUtils.forEach(deps, function (val, index) { deps[index] = val.trim(); }); fn.deps = DSUtils.filter(deps, function (dep) { return !!dep; }); }); } if (definition.schema && _this.schemator) { def.schema = _this.schemator.defineSchema(def.name, definition.schema); if (!definition.hasOwnProperty('validate')) { def.validate = function (resourceName, attrs, cb) { def.schema.validate(attrs, { ignoreMissing: def.ignoreMissing }, function (err) { if (err) { return cb(err); } else { return cb(null, attrs); } }); }; } } DSUtils.forEach(instanceMethods, function (name) { def[def['class']].prototype['DS' + DSUtils.pascalCase(name)] = function () { var args = Array.prototype.slice.call(arguments); args.unshift(this[def.idAttribute] || this); args.unshift(def.name); return _this[name].apply(_this, args); }; }); def[def['class']].prototype.DSCreate = function () { var args = Array.prototype.slice.call(arguments); args.unshift(this); args.unshift(def.name); return _this.create.apply(_this, args); }; // Initialize store data for the new resource _this.store[def.name] = { collection: [], expiresHeap: new DSUtils.DSBinaryHeap(function (x) { return x.expires; }, function (x, y) { return x.item === y; }), completedQueries: {}, queryData: {}, pendingQueries: {}, index: {}, modified: {}, saved: {}, previousAttributes: {}, observers: {}, changeHistories: {}, changeHistory: [], collectionModified: 0 }; if (def.reapInterval) { setInterval(function () { _this.reap(def.name, { isInterval: true }); }, def.reapInterval); } // Proxy DS methods with shorthand ones for (var key in _this) { if (typeof _this[key] === 'function' && key !== 'defineResource') { (function (k) { def[k] = function () { var args = Array.prototype.slice.call(arguments); args.unshift(def.name); return _this[k].apply(_this, args); }; })(key); } } def.beforeValidate = DSUtils.promisify(def.beforeValidate); def.validate = DSUtils.promisify(def.validate); def.afterValidate = DSUtils.promisify(def.afterValidate); def.beforeCreate = DSUtils.promisify(def.beforeCreate); def.afterCreate = DSUtils.promisify(def.afterCreate); def.beforeUpdate = DSUtils.promisify(def.beforeUpdate); def.afterUpdate = DSUtils.promisify(def.afterUpdate); def.beforeDestroy = DSUtils.promisify(def.beforeDestroy); def.afterDestroy = DSUtils.promisify(def.afterDestroy); DSUtils.forOwn(def.actions, function addAction(action, name) { if (def[name]) { throw new Error('Cannot override existing method "' + name + '"!'); } def[name] = function (options) { options = options || {}; var config = DSUtils.deepMixIn({}, action); if (!options.hasOwnProperty('endpoint') && config.endpoint) { options.endpoint = config.endpoint; } if (typeof options.getEndpoint === 'function') { config.url = options.getEndpoint(def, options); } else { config.url = DSUtils.makePath(def.getEndpoint(null, options), name); } config.method = config.method || 'GET'; DSUtils.deepMixIn(config, options); return _this.getAdapter(action.adapter || 'http').HTTP(config); }; }); // Mix-in events DSUtils.Events(def); return def; } catch (err) { delete definitions[definition.name]; delete _this.store[definition.name]; throw err; } } module.exports = defineResource; },{"../../errors":48,"../../utils":50}],39:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function eject(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; var item; var found = false; id = DSUtils.resolveId(definition, id); if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); } options = DSUtils._(definition, options); for (var i = 0; i < resource.collection.length; i++) { if (resource.collection[i][definition.idAttribute] == id) { item = resource.collection[i]; resource.expiresHeap.remove(item); found = true; break; } } if (found) { if (options.notify) { definition.beforeEject(options, item); _this.emit(options, 'beforeEject', DSUtils.copy(item)); } _this.unlinkInverse(definition.name, id); resource.collection.splice(i, 1); if (DSUtils.w) { resource.observers[id].close(); } delete resource.observers[id]; delete resource.index[id]; delete resource.previousAttributes[id]; delete resource.completedQueries[id]; delete resource.pendingQueries[id]; DSUtils.forEach(resource.changeHistories[id], function (changeRecord) { DSUtils.remove(resource.changeHistory, changeRecord); }); DSUtils.forOwn(resource.queryData, function (items) { if (items.$$injected) { DSUtils.remove(items, item); } }); delete resource.changeHistories[id]; delete resource.modified[id]; delete resource.saved[id]; resource.collectionModified = DSUtils.updateTimestamp(resource.collectionModified); if (options.notify) { definition.afterEject(options, item); _this.emit(options, 'afterEject', DSUtils.copy(item)); } return item; } } module.exports = eject; },{"../../errors":48,"../../utils":50}],40:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function ejectAll(resourceName, params, options) { var _this = this; var definition = _this.definitions[resourceName]; params = params || {}; if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isObject(params)) { throw new DSErrors.IA('"params" must be an object!'); } var resource = _this.store[resourceName]; if (DSUtils.isEmpty(params)) { resource.completedQueries = {}; } var queryHash = DSUtils.toJson(params); var items = _this.filter(definition.name, params); var ids = []; DSUtils.forEach(items, function (item) { if (item && item[definition.idAttribute]) { ids.push(item[definition.idAttribute]); } }); DSUtils.forEach(ids, function (id) { _this.eject(definition.name, id, options); }); delete resource.completedQueries[queryHash]; resource.collectionModified = DSUtils.updateTimestamp(resource.collectionModified); return items; } module.exports = ejectAll; },{"../../errors":48,"../../utils":50}],41:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function filter(resourceName, params, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; if (!definition) { throw new DSErrors.NER(resourceName); } else if (params && !DSUtils.isObject(params)) { throw new DSErrors.IA('"params" must be an object!'); } options = DSUtils._(definition, options); // Protect against null params = params || {}; var queryHash = DSUtils.toJson(params); if (!(queryHash in resource.completedQueries) && options.loadFromServer) { // This particular query has never been completed if (!resource.pendingQueries[queryHash]) { // This particular query has never even been started _this.findAll(resourceName, params, options); } } return definition.defaultFilter.call(_this, resource.collection, resourceName, params, options); } module.exports = filter; },{"../../errors":48,"../../utils":50}],42:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); var NER = DSErrors.NER; var IA = DSErrors.IA; var R = DSErrors.R; function changes(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; options = options || {}; id = DSUtils.resolveId(definition, id); if (!definition) { throw new NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new IA('"id" must be a string or a number!'); } options = DSUtils._(definition, options); var item = _this.get(resourceName, id); if (item) { if (DSUtils.w) { _this.store[resourceName].observers[id].deliver(); } var diff = DSUtils.diffObjectFromOldObject(item, _this.store[resourceName].previousAttributes[id], DSUtils.equals, options.ignoredChanges); DSUtils.forOwn(diff, function (changeset, name) { var toKeep = []; DSUtils.forOwn(changeset, function (value, field) { if (!DSUtils.isFunction(value)) { toKeep.push(field); } }); diff[name] = DSUtils.pick(diff[name], toKeep); }); DSUtils.forEach(definition.relationFields, function (field) { delete diff.added[field]; delete diff.removed[field]; delete diff.changed[field]; }); return diff; } } function changeHistory(resourceName, id) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; id = DSUtils.resolveId(definition, id); if (resourceName && !_this.definitions[resourceName]) { throw new NER(resourceName); } else if (id && !DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new IA('"id" must be a string or a number!'); } if (!definition.keepChangeHistory) { definition.errorFn('changeHistory is disabled for this resource!'); } else { if (resourceName) { var item = _this.get(resourceName, id); if (item) { return resource.changeHistories[id]; } } else { return resource.changeHistory; } } } function compute(resourceName, instance) { var _this = this; var definition = _this.definitions[resourceName]; instance = DSUtils.resolveItem(_this.store[resourceName], instance); if (!definition) { throw new NER(resourceName); } else if (!instance) { throw new R('Item not in the store!'); } else if (!DSUtils.isObject(instance) && !DSUtils.isString(instance) && !DSUtils.isNumber(instance)) { throw new IA('"instance" must be an object, string or number!'); } DSUtils.forOwn(definition.computed, function (fn, field) { DSUtils.compute.call(instance, fn, field); }); return instance; } function createInstance(resourceName, attrs, options) { var definition = this.definitions[resourceName]; var item; attrs = attrs || {}; if (!definition) { throw new NER(resourceName); } else if (attrs && !DSUtils.isObject(attrs)) { throw new IA('"attrs" must be an object!'); } options = DSUtils._(definition, options); if (options.notify) { options.beforeCreateInstance(options, attrs); } if (options.useClass) { var Constructor = definition[definition.class]; item = new Constructor(); } else { item = {}; } DSUtils.deepMixIn(item, attrs); if (options.notify) { options.afterCreateInstance(options, attrs); } return item; } function diffIsEmpty(diff) { return !(DSUtils.isEmpty(diff.added) && DSUtils.isEmpty(diff.removed) && DSUtils.isEmpty(diff.changed)); } function digest() { this.observe.Platform.performMicrotaskCheckpoint(); } function get(resourceName, id, options) { var _this = this; var definition = _this.definitions[resourceName]; if (!definition) { throw new NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new IA('"id" must be a string or a number!'); } options = DSUtils._(definition, options); // cache miss, request resource from server var item = _this.store[resourceName].index[id]; if (!item && options.loadFromServer) { _this.find(resourceName, id, options); } // return resource from cache return item; } function getAll(resourceName, ids) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; var collection = []; if (!definition) { throw new NER(resourceName); } else if (ids && !DSUtils.isArray(ids)) { throw new IA('"ids" must be an array!'); } if (DSUtils.isArray(ids)) { var length = ids.length; for (var i = 0; i < length; i++) { if (resource.index[ids[i]]) { collection.push(resource.index[ids[i]]); } } } else { collection = resource.collection.slice(); } return collection; } function hasChanges(resourceName, id) { var _this = this; var definition = _this.definitions[resourceName]; id = DSUtils.resolveId(definition, id); if (!definition) { throw new NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new IA('"id" must be a string or a number!'); } // return resource from cache if (_this.get(resourceName, id)) { return diffIsEmpty(_this.changes(resourceName, id)); } else { return false; } } function lastModified(resourceName, id) { var definition = this.definitions[resourceName]; var resource = this.store[resourceName]; id = DSUtils.resolveId(definition, id); if (!definition) { throw new NER(resourceName); } if (id) { if (!(id in resource.modified)) { resource.modified[id] = 0; } return resource.modified[id]; } return resource.collectionModified; } function lastSaved(resourceName, id) { var definition = this.definitions[resourceName]; var resource = this.store[resourceName]; id = DSUtils.resolveId(definition, id); if (!definition) { throw new NER(resourceName); } if (!(id in resource.saved)) { resource.saved[id] = 0; } return resource.saved[id]; } function previous(resourceName, id) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; id = DSUtils.resolveId(definition, id); if (!definition) { throw new NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new IA('"id" must be a string or a number!'); } // return resource from cache return resource.previousAttributes[id] ? DSUtils.copy(resource.previousAttributes[id]) : undefined; } module.exports = { changes: changes, changeHistory: changeHistory, compute: compute, createInstance: createInstance, defineResource: require('./defineResource'), digest: digest, eject: require('./eject'), ejectAll: require('./ejectAll'), filter: require('./filter'), get: get, getAll: getAll, hasChanges: hasChanges, inject: require('./inject'), lastModified: lastModified, lastSaved: lastSaved, link: require('./link'), linkAll: require('./linkAll'), linkInverse: require('./linkInverse'), previous: previous, unlinkInverse: require('./unlinkInverse') }; },{"../../errors":48,"../../utils":50,"./defineResource":38,"./eject":39,"./ejectAll":40,"./filter":41,"./inject":43,"./link":44,"./linkAll":45,"./linkInverse":46,"./unlinkInverse":47}],43:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function _getReactFunction(DS, definition, resource) { var name = definition.name; return function _react(added, removed, changed, oldValueFn, firstTime) { var target = this; var item; var innerId = (oldValueFn && oldValueFn(definition.idAttribute)) ? oldValueFn(definition.idAttribute) : target[definition.idAttribute]; DSUtils.forEach(definition.relationFields, function (field) { delete added[field]; delete removed[field]; delete changed[field]; }); if (!DSUtils.isEmpty(added) || !DSUtils.isEmpty(removed) || !DSUtils.isEmpty(changed) || firstTime) { item = DS.get(name, innerId); resource.modified[innerId] = DSUtils.updateTimestamp(resource.modified[innerId]); resource.collectionModified = DSUtils.updateTimestamp(resource.collectionModified); if (definition.keepChangeHistory) { var changeRecord = { resourceName: name, target: item, added: added, removed: removed, changed: changed, timestamp: resource.modified[innerId] }; resource.changeHistories[innerId].push(changeRecord); resource.changeHistory.push(changeRecord); } } if (definition.computed) { item = item || DS.get(name, innerId); DSUtils.forOwn(definition.computed, function (fn, field) { var compute = false; // check if required fields changed DSUtils.forEach(fn.deps, function (dep) { if (dep in added || dep in removed || dep in changed || !(field in item)) { compute = true; } }); compute = compute || !fn.deps.length; if (compute) { DSUtils.compute.call(item, fn, field); } }); } if (definition.relations) { item = item || DS.get(name, innerId); DSUtils.forEach(definition.relationList, function (def) { if (item[def.localField] && (def.localKey in added || def.localKey in removed || def.localKey in changed)) { DS.link(name, item[definition.idAttribute], [def.relation]); } }); } if (definition.idAttribute in changed) { definition.errorFn('Doh! You just changed the primary key of an object! Your data for the "' + name + '" resource is now in an undefined (probably broken) state.'); } }; } function _inject(definition, resource, attrs, options) { var _this = this; var _react = _getReactFunction(_this, definition, resource, attrs, options); var injected; if (DSUtils.isArray(attrs)) { injected = []; for (var i = 0; i < attrs.length; i++) { injected.push(_inject.call(_this, definition, resource, attrs[i], options)); } } else { // check if "idAttribute" is a computed property var c = definition.computed; var idA = definition.idAttribute; if (c && c[idA]) { var args = []; DSUtils.forEach(c[idA].deps, function (dep) { args.push(attrs[dep]); }); attrs[idA] = c[idA][c[idA].length - 1].apply(attrs, args); } if (!(idA in attrs)) { var error = new DSErrors.R(definition.name + '.inject: "attrs" must contain the property specified by `idAttribute`!'); options.errorFn(error); throw error; } else { try { DSUtils.forEach(definition.relationList, function (def) { var relationName = def.relation; var relationDef = _this.definitions[relationName]; var toInject = attrs[def.localField]; if (toInject) { if (!relationDef) { throw new DSErrors.R(definition.name + ' relation is defined but the resource is not!'); } if (DSUtils.isArray(toInject)) { var items = []; DSUtils.forEach(toInject, function (toInjectItem) { if (toInjectItem !== _this.store[relationName][toInjectItem[relationDef.idAttribute]]) { try { var injectedItem = _this.inject(relationName, toInjectItem, options); if (def.foreignKey) { injectedItem[def.foreignKey] = attrs[definition.idAttribute]; } items.push(injectedItem); } catch (err) { options.errorFn(err, 'Failed to inject ' + def.type + ' relation: "' + relationName + '"!'); } } }); attrs[def.localField] = items; } else { if (toInject !== _this.store[relationName][toInject[relationDef.idAttribute]]) { try { attrs[def.localField] = _this.inject(relationName, attrs[def.localField], options); if (def.foreignKey) { attrs[def.localField][def.foreignKey] = attrs[definition.idAttribute]; } } catch (err) { options.errorFn(err, 'Failed to inject ' + def.type + ' relation: "' + relationName + '"!'); } } } } }); var id = attrs[idA]; var item = _this.get(definition.name, id); var initialLastModified = item ? resource.modified[id] : 0; if (!item) { if (options.useClass) { if (attrs instanceof definition[definition['class']]) { item = attrs; } else { item = new definition[definition['class']](); } } else { item = {}; } resource.previousAttributes[id] = DSUtils.copy(attrs); DSUtils.deepMixIn(item, attrs); resource.collection.push(item); resource.changeHistories[id] = []; if (DSUtils.w) { resource.observers[id] = new _this.observe.ObjectObserver(item); resource.observers[id].open(_react, item); } resource.index[id] = item; _react.call(item, {}, {}, {}, null, true); } else { DSUtils.deepMixIn(item, attrs); if (definition.resetHistoryOnInject) { resource.previousAttributes[id] = {}; DSUtils.deepMixIn(resource.previousAttributes[id], attrs); if (resource.changeHistories[id].length) { DSUtils.forEach(resource.changeHistories[id], function (changeRecord) { DSUtils.remove(resource.changeHistory, changeRecord); }); resource.changeHistories[id].splice(0, resource.changeHistories[id].length); } } if (DSUtils.w) { resource.observers[id].deliver(); } } resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]); resource.modified[id] = initialLastModified && resource.modified[id] === initialLastModified ? DSUtils.updateTimestamp(resource.modified[id]) : resource.modified[id]; resource.expiresHeap.remove(item); resource.expiresHeap.push({ item: item, timestamp: resource.saved[id], expires: definition.maxAge ? resource.saved[id] + definition.maxAge : Number.MAX_VALUE }); injected = item; } catch (err) { options.errorFn(err, attrs); } } } return injected; } function _link(definition, injected, options) { var _this = this; DSUtils.forEach(definition.relationList, function (def) { if (options.findBelongsTo && def.type === 'belongsTo' && injected[definition.idAttribute]) { _this.link(definition.name, injected[definition.idAttribute], [def.relation]); } else if ((options.findHasMany && def.type === 'hasMany') || (options.findHasOne && def.type === 'hasOne')) { _this.link(definition.name, injected[definition.idAttribute], [def.relation]); } }); } function inject(resourceName, attrs, options) { var _this = this; var definition = _this.definitions[resourceName]; var resource = _this.store[resourceName]; var injected; if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isObject(attrs) && !DSUtils.isArray(attrs)) { throw new DSErrors.IA(resourceName + '.inject: "attrs" must be an object or an array!'); } var name = definition.name; options = DSUtils._(definition, options); if (options.notify) { options.beforeInject(options, attrs); _this.emit(options, 'beforeInject', DSUtils.copy(attrs)); } injected = _inject.call(_this, definition, resource, attrs, options); resource.collectionModified = DSUtils.updateTimestamp(resource.collectionModified); if (options.findInverseLinks) { if (DSUtils.isArray(injected)) { if (injected.length) { _this.linkInverse(name, injected[0][definition.idAttribute]); } } else { _this.linkInverse(name, injected[definition.idAttribute]); } } if (DSUtils.isArray(injected)) { DSUtils.forEach(injected, function (injectedI) { _link.call(_this, definition, injectedI, options); }); } else { _link.call(_this, definition, injected, options); } if (options.notify) { options.afterInject(options, injected); _this.emit(options, 'afterInject', DSUtils.copy(injected)); } return injected; } module.exports = inject; },{"../../errors":48,"../../utils":50}],44:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function link(resourceName, id, relations) { var _this = this; var definition = _this.definitions[resourceName]; relations = relations || []; id = DSUtils.resolveId(definition, id); if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); } else if (!DSUtils.isArray(relations)) { throw new DSErrors.IA('"relations" must be an array!'); } var linked = _this.get(resourceName, id); if (linked) { DSUtils.forEach(definition.relationList, function (def) { var relationName = def.relation; if (relations.length && !DSUtils.contains(relations, relationName)) { return; } var params = {}; if (def.type === 'belongsTo') { var parent = linked[def.localKey] ? _this.get(relationName, linked[def.localKey]) : null; if (parent) { linked[def.localField] = parent; } } else if (def.type === 'hasMany') { params[def.foreignKey] = linked[definition.idAttribute]; linked[def.localField] = _this.defaults.constructor.prototype.defaultFilter.call(_this, _this.store[relationName].collection, relationName, params, { allowSimpleWhere: true }); } else if (def.type === 'hasOne') { params[def.foreignKey] = linked[definition.idAttribute]; var children = _this.defaults.constructor.prototype.defaultFilter.call(_this, _this.store[relationName].collection, relationName, params, { allowSimpleWhere: true }); if (children.length) { linked[def.localField] = children[0]; } } }); } return linked; } module.exports = link; },{"../../errors":48,"../../utils":50}],45:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function linkAll(resourceName, params, relations) { var _this = this; var definition = _this.definitions[resourceName]; relations = relations || []; if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isArray(relations)) { throw new DSErrors.IA('"relations" must be an array!'); } var linked = _this.filter(resourceName, params); if (linked) { DSUtils.forEach(definition.relationList, function (def) { var relationName = def.relation; if (relations.length && !DSUtils.contains(relations, relationName)) { return; } if (def.type === 'belongsTo') { DSUtils.forEach(linked, function (injectedItem) { var parent = injectedItem[def.localKey] ? _this.get(relationName, injectedItem[def.localKey]) : null; if (parent) { injectedItem[def.localField] = parent; } }); } else if (def.type === 'hasMany') { DSUtils.forEach(linked, function (injectedItem) { var params = {}; params[def.foreignKey] = injectedItem[definition.idAttribute]; injectedItem[def.localField] = _this.defaults.constructor.prototype.defaultFilter.call(_this, _this.store[relationName].collection, relationName, params, { allowSimpleWhere: true }); }); } else if (def.type === 'hasOne') { DSUtils.forEach(linked, function (injectedItem) { var params = {}; params[def.foreignKey] = injectedItem[definition.idAttribute]; var children = _this.defaults.constructor.prototype.defaultFilter.call(_this, _this.store[relationName].collection, relationName, params, { allowSimpleWhere: true }); if (children.length) { injectedItem[def.localField] = children[0]; } }); } }); } return linked; } module.exports = linkAll; },{"../../errors":48,"../../utils":50}],46:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function linkInverse(resourceName, id, relations) { var _this = this; var definition = _this.definitions[resourceName]; relations = relations || []; id = DSUtils.resolveId(definition, id); if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); } else if (!DSUtils.isArray(relations)) { throw new DSErrors.IA('"relations" must be an array!'); } var linked = _this.get(resourceName, id); if (linked) { DSUtils.forOwn(_this.definitions, function (d) { DSUtils.forOwn(d.relations, function (relatedModels) { DSUtils.forOwn(relatedModels, function (defs, relationName) { if (relations.length && !DSUtils.contains(relations, d.name)) { return; } if (definition.name === relationName) { _this.linkAll(d.name, {}, [definition.name]); } }); }); }); } return linked; } module.exports = linkInverse; },{"../../errors":48,"../../utils":50}],47:[function(require,module,exports){ var DSUtils = require('../../utils'); var DSErrors = require('../../errors'); function unlinkInverse(resourceName, id, relations) { var _this = this; var definition = _this.definitions[resourceName]; relations = relations || []; id = DSUtils.resolveId(definition, id); if (!definition) { throw new DSErrors.NER(resourceName); } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); } else if (!DSUtils.isArray(relations)) { throw new DSErrors.IA('"relations" must be an array!'); } var linked = _this.get(resourceName, id); if (linked) { DSUtils.forOwn(_this.definitions, function (d) { DSUtils.forOwn(d.relations, function (relatedModels) { DSUtils.forOwn(relatedModels, function (defs, relationName) { if (definition.name === relationName) { DSUtils.forEach(defs, function (def) { DSUtils.forEach(_this.store[def.name].collection, function (item) { if (def.type === 'hasMany' && item[def.localField]) { var index; DSUtils.forEach(item[def.localField], function (subItem, i) { if (subItem === linked) { index = i; } }); item[def.localField].splice(index, 1); } else if (item[def.localField] === linked) { delete item[def.localField]; } }); }); } }); }); }); } return linked; } module.exports = unlinkInverse; },{"../../errors":48,"../../utils":50}],48:[function(require,module,exports){ function IllegalArgumentError(message) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } this.type = this.constructor.name; this.message = message || 'Illegal Argument!'; } IllegalArgumentError.prototype = new Error(); IllegalArgumentError.prototype.constructor = IllegalArgumentError; function RuntimeError(message) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } this.type = this.constructor.name; this.message = message || 'RuntimeError Error!'; } RuntimeError.prototype = new Error(); RuntimeError.prototype.constructor = RuntimeError; function NonexistentResourceError(resourceName) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } this.type = this.constructor.name; this.message = (resourceName || '') + ' is not a registered resource!'; } NonexistentResourceError.prototype = new Error(); NonexistentResourceError.prototype.constructor = NonexistentResourceError; module.exports = { IllegalArgumentError: IllegalArgumentError, IA: IllegalArgumentError, RuntimeError: RuntimeError, R: RuntimeError, NonexistentResourceError: NonexistentResourceError, NER: NonexistentResourceError }; },{}],49:[function(require,module,exports){ var DS = require('./datastore'); module.exports = { DS: DS, createStore: function (options) { return new DS(options); }, DSUtils: require('./utils'), DSErrors: require('./errors'), version: { full: '1.1.0', major: parseInt('1', 10), minor: parseInt('1', 10), patch: parseInt('0', 10), alpha: 'false' !== 'false' ? 'false' : false, beta: 'false' !== 'false' ? 'false' : false } }; },{"./datastore":37,"./errors":48,"./utils":50}],50:[function(require,module,exports){ /* jshint -W041 */ var w, _Promise; var objectProto = Object.prototype; var toString = objectProto.toString; var DSErrors = require('./errors'); var forEach = require('mout/array/forEach'); var slice = require('mout/array/slice'); var forOwn = require('mout/object/forOwn'); var observe = require('../lib/observe-js/observe-js'); var es6Promise = require('es6-promise'); es6Promise.polyfill(); var isArray = Array.isArray || function isArray(value) { return toString.call(value) == '[object Array]' || false; }; function isRegExp(value) { return toString.call(value) == '[object RegExp]' || false; } // adapted from lodash.isBoolean function isBoolean(value) { return (value === true || value === false || value && typeof value == 'object' && toString.call(value) == '[object Boolean]') || false; } // adapted from lodash.isString function isString(value) { return typeof value == 'string' || (value && typeof value == 'object' && toString.call(value) == '[object String]') || false; } function isObject(value) { return toString.call(value) == '[object Object]' || false; } // adapted from lodash.isDate function isDate(value) { return (value && typeof value == 'object' && toString.call(value) == '[object Date]') || false; } // adapted from lodash.isNumber function isNumber(value) { var type = typeof value; return type == 'number' || (value && type == 'object' && toString.call(value) == '[object Number]') || false; } // adapted from lodash.isFunction function isFunction(value) { return typeof value == 'function' || (value && toString.call(value) === '[object Function]') || false; } // adapted from mout.isEmpty function isEmpty(val) { if (val == null) { // typeof null == 'object' so we check it first return true; } else if (typeof val === 'string' || isArray(val)) { return !val.length; } else if (typeof val === 'object') { var result = true; forOwn(val, function () { result = false; return false; // break loop }); return result; } else { return true; } } function intersection(array1, array2) { if (!array1 || !array2) { return []; } var result = []; var item; for (var i = 0, length = array1.length; i < length; i++) { item = array1[i]; if (DSUtils.contains(result, item)) { continue; } if (DSUtils.contains(array2, item)) { result.push(item); } } return result; } function filter(array, cb, thisObj) { var results = []; forEach(array, function (value, key, arr) { if (cb(value, key, arr)) { results.push(value); } }, thisObj); return results; } function finallyPolyfill(cb) { var constructor = this.constructor; return this.then(function (value) { return constructor.resolve(cb()).then(function () { return value; }); }, function (reason) { return constructor.resolve(cb()).then(function () { throw reason; }); }); } try { w = window; if (!w.Promise.prototype['finally']) { w.Promise.prototype['finally'] = finallyPolyfill; } _Promise = w.Promise; w = {}; } catch (e) { w = null; _Promise = require('bluebird'); } function updateTimestamp(timestamp) { var newTimestamp = typeof Date.now === 'function' ? Date.now() : new Date().getTime(); if (timestamp && newTimestamp <= timestamp) { return timestamp + 1; } else { return newTimestamp; } } function Events(target) { var events = {}; target = target || this; target.on = function (type, func, ctx) { events[type] = events[type] || []; events[type].push({ f: func, c: ctx }); }; target.off = function (type, func) { var listeners = events[type]; if (!listeners) { events = {}; } else if (func) { for (var i = 0; i < listeners.length; i++) { if (listeners[i] === func) { listeners.splice(i, 1); break; } } } else { listeners.splice(0, listeners.length); } }; target.emit = function () { var args = Array.prototype.slice.call(arguments); var listeners = events[args.shift()] || []; if (listeners) { for (var i = 0; i < listeners.length; i++) { listeners[i].f.apply(listeners[i].c, args); } } }; } /** * @method bubbleUp * @param {array} heap The heap. * @param {function} weightFunc The weight function. * @param {number} n The index of the element to bubble up. */ function bubbleUp(heap, weightFunc, n) { var element = heap[n]; var weight = weightFunc(element); // When at 0, an element can not go up any further. while (n > 0) { // Compute the parent element's index, and fetch it. var parentN = Math.floor((n + 1) / 2) - 1; var parent = heap[parentN]; // If the parent has a lesser weight, things are in order and we // are done. if (weight >= weightFunc(parent)) { break; } else { heap[parentN] = element; heap[n] = parent; n = parentN; } } } /** * @method bubbleDown * @param {array} heap The heap. * @param {function} weightFunc The weight function. * @param {number} n The index of the element to sink down. */ function bubbleDown(heap, weightFunc, n) { var length = heap.length; var node = heap[n]; var nodeWeight = weightFunc(node); while (true) { var child2N = (n + 1) * 2, child1N = child2N - 1; var swap = null; if (child1N < length) { var child1 = heap[child1N], child1Weight = weightFunc(child1); // If the score is less than our node's, we need to swap. if (child1Weight < nodeWeight) { swap = child1N; } } // Do the same checks for the other child. if (child2N < length) { var child2 = heap[child2N], child2Weight = weightFunc(child2); if (child2Weight < (swap === null ? nodeWeight : weightFunc(heap[child1N]))) { swap = child2N; } } if (swap === null) { break; } else { heap[n] = heap[swap]; heap[swap] = node; n = swap; } } } function DSBinaryHeap(weightFunc, compareFunc) { if (weightFunc && !isFunction(weightFunc)) { throw new Error('DSBinaryHeap(weightFunc): weightFunc: must be a function!'); } weightFunc = weightFunc || function (x) { return x; }; compareFunc = compareFunc || function (x, y) { return x === y; }; this.weightFunc = weightFunc; this.compareFunc = compareFunc; this.heap = []; } var dsp = DSBinaryHeap.prototype; dsp.push = function (node) { this.heap.push(node); bubbleUp(this.heap, this.weightFunc, this.heap.length - 1); }; dsp.peek = function () { return this.heap[0]; }; dsp.pop = function () { var front = this.heap[0], end = this.heap.pop(); if (this.heap.length > 0) { this.heap[0] = end; bubbleDown(this.heap, this.weightFunc, 0); } return front; }; dsp.remove = function (node) { var length = this.heap.length; for (var i = 0; i < length; i++) { if (this.compareFunc(this.heap[i], node)) { var removed = this.heap[i]; var end = this.heap.pop(); if (i !== length - 1) { this.heap[i] = end; bubbleUp(this.heap, this.weightFunc, i); bubbleDown(this.heap, this.weightFunc, i); } return removed; } } return null; }; dsp.removeAll = function () { this.heap = []; }; dsp.size = function () { return this.heap.length; }; var toPromisify = [ 'beforeValidate', 'validate', 'afterValidate', 'beforeCreate', 'afterCreate', 'beforeUpdate', 'afterUpdate', 'beforeDestroy', 'afterDestroy' ]; // adapted from angular.copy function copy(source, destination, stackSource, stackDest) { if (!destination) { destination = source; if (source) { if (isArray(source)) { destination = copy(source, [], stackSource, stackDest); } else if (isDate(source)) { destination = new Date(source.getTime()); } else if (isRegExp(source)) { destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]); destination.lastIndex = source.lastIndex; } else if (isObject(source)) { var emptyObject = Object.create(Object.getPrototypeOf(source)); destination = copy(source, emptyObject, stackSource, stackDest); } } } else { if (source === destination) { throw new Error('Cannot copy! Source and destination are identical.'); } stackSource = stackSource || []; stackDest = stackDest || []; if (isObject(source)) { var index = stackSource.indexOf(source); if (index !== -1) return stackDest[index]; stackSource.push(source); stackDest.push(destination); } var result; if (isArray(source)) { destination.length = 0; for (var i = 0; i < source.length; i++) { result = copy(source[i], null, stackSource, stackDest); if (isObject(source[i])) { stackSource.push(source[i]); stackDest.push(result); } destination.push(result); } } else { if (isArray(destination)) { destination.length = 0; } else { forEach(destination, function (value, key) { delete destination[key]; }); } for (var key in source) { if (source.hasOwnProperty(key)) { result = copy(source[key], null, stackSource, stackDest); if (isObject(source[key])) { stackSource.push(source[key]); stackDest.push(result); } destination[key] = result; } } } } return destination; } // adapted from angular.equals function equals(o1, o2) { if (o1 === o2) return true; if (o1 === null || o2 === null) return false; if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN var t1 = typeof o1, t2 = typeof o2, length, key, keySet; if (t1 == t2) { if (t1 == 'object') { if (isArray(o1)) { if (!isArray(o2)) return false; if ((length = o1.length) == o2.length) { for (key = 0; key < length; key++) { if (!equals(o1[key], o2[key])) return false; } return true; } } else if (isDate(o1)) { if (!isDate(o2)) return false; return equals(o1.getTime(), o2.getTime()); } else if (isRegExp(o1) && isRegExp(o2)) { return o1.toString() == o2.toString(); } else { if (isArray(o2)) return false; keySet = {}; for (key in o1) { if (key.charAt(0) === '$' || isFunction(o1[key])) continue; if (!equals(o1[key], o2[key])) return false; keySet[key] = true; } for (key in o2) { if (!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key])) return false; } return true; } } } return false; } function resolveId(definition, idOrInstance) { if (this.isString(idOrInstance) || isNumber(idOrInstance)) { return idOrInstance; } else if (idOrInstance && definition) { return idOrInstance[definition.idAttribute] || idOrInstance; } else { return idOrInstance; } } function resolveItem(resource, idOrInstance) { if (resource && (isString(idOrInstance) || isNumber(idOrInstance))) { return resource.index[idOrInstance] || idOrInstance; } else { return idOrInstance; } } function isValidString(val) { return (val != null && val !== ''); } function join(items, separator) { separator = separator || ''; return filter(items, isValidString).join(separator); } function makePath(var_args) { var result = join(slice(arguments), '/'); return result.replace(/([^:\/]|^)\/{2,}/g, '$1/'); } observe.setEqualityFn(equals); var DSUtils = { // Options that inherit from defaults _: function (parent, options) { var _this = this; options = options || {}; if (options && options.constructor === parent.constructor) { return options; } else if (!isObject(options)) { throw new DSErrors.IA('"options" must be an object!'); } forEach(toPromisify, function (name) { if (typeof options[name] === 'function' && options[name].toString().indexOf('var args = Array') === -1) { options[name] = _this.promisify(options[name]); } }); var O = function Options(attrs) { var self = this; forOwn(attrs, function (value, key) { self[key] = value; }); }; O.prototype = parent; return new O(options); }, compute: function (fn, field) { var _this = this; var args = []; forEach(fn.deps, function (dep) { args.push(_this[dep]); }); // compute property _this[field] = fn[fn.length - 1].apply(_this, args); }, contains: require('mout/array/contains'), copy: copy, deepMixIn: require('mout/object/deepMixIn'), diffObjectFromOldObject: observe.diffObjectFromOldObject, DSBinaryHeap: DSBinaryHeap, equals: equals, Events: Events, filter: filter, forEach: forEach, forOwn: forOwn, fromJson: function (json) { return isString(json) ? JSON.parse(json) : json; }, get: require('mout/object/get'), intersection: intersection, isArray: isArray, isBoolean: isBoolean, isDate: isDate, isEmpty: isEmpty, isFunction: isFunction, isObject: isObject, isNumber: isNumber, isRegExp: isRegExp, isString: isString, makePath: makePath, observe: observe, pascalCase: require('mout/string/pascalCase'), pick: require('mout/object/pick'), Promise: _Promise, promisify: function (fn, target) { var Promise = this.Promise; if (!fn) { return; } else if (typeof fn !== 'function') { throw new Error('Can only promisify functions!'); } return function () { var args = Array.prototype.slice.apply(arguments); return new Promise(function (resolve, reject) { args.push(function (err, result) { if (err) { reject(err); } else { resolve(result); } }); try { var promise = fn.apply(target || this, args); if (promise && promise.then) { promise.then(resolve, reject); } } catch (err) { reject(err); } }); }; }, remove: require('mout/array/remove'), set: require('mout/object/set'), slice: slice, sort: require('mout/array/sort'), toJson: JSON.stringify, updateTimestamp: updateTimestamp, upperCase: require('mout/string/upperCase'), removeCircular: function (object) { var objects = []; return (function rmCirc(value) { var i; var nu; if (typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)) { for (i = 0; i < objects.length; i += 1) { if (objects[i] === value) { return undefined; } } objects.push(value); if (DSUtils.isArray(value)) { nu = []; for (i = 0; i < value.length; i += 1) { nu[i] = rmCirc(value[i]); } } else { nu = {}; forOwn(value, function (v, k) { nu[k] = rmCirc(value[k]); }); } return nu; } return value; }(object)); }, resolveItem: resolveItem, resolveId: resolveId, w: w }; module.exports = DSUtils; },{"../lib/observe-js/observe-js":1,"./errors":48,"bluebird":"bluebird","es6-promise":2,"mout/array/contains":4,"mout/array/forEach":5,"mout/array/remove":7,"mout/array/slice":8,"mout/array/sort":9,"mout/object/deepMixIn":13,"mout/object/forOwn":15,"mout/object/get":16,"mout/object/pick":19,"mout/object/set":20,"mout/string/pascalCase":23,"mout/string/upperCase":26}]},{},[49])(49) });
example/components/index.js
travi/hapi-react-router
import React from 'react'; export default function Index() { return <p>Example</p>; } Index.displayName = 'Index';
src/svg-icons/image/blur-off.js
ngbrown/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageBlurOff = (props) => ( <SvgIcon {...props}> <path d="M14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm-.2 4.48l.2.02c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5l.02.2c.09.67.61 1.19 1.28 1.28zM14 3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zm-4 0c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zm11 7c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm8 8c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0-4c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0-4c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm-4 13.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM2.5 5.27l3.78 3.78L6 9c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1c0-.1-.03-.19-.06-.28l2.81 2.81c-.71.11-1.25.73-1.25 1.47 0 .83.67 1.5 1.5 1.5.74 0 1.36-.54 1.47-1.25l2.81 2.81c-.09-.03-.18-.06-.28-.06-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1c0-.1-.03-.19-.06-.28l3.78 3.78L20 20.23 3.77 4 2.5 5.27zM10 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm11-3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zM3 9.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm7 11c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM6 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-3-3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5z"/> </SvgIcon> ); ImageBlurOff = pure(ImageBlurOff); ImageBlurOff.displayName = 'ImageBlurOff'; ImageBlurOff.muiName = 'SvgIcon'; export default ImageBlurOff;
src/components/pages/history/index.js
modern-translator/client
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import React from 'react'; import PropTypes from 'prop-types'; import AppBar from '@material-ui/core/AppBar'; import Divider from '@material-ui/core/Divider'; import IconButton from '@material-ui/core/IconButton'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; import ListItemText from '@material-ui/core/ListItemText'; import Toolbar from '@material-ui/core/Toolbar'; import Tooltip from '@material-ui/core/Tooltip'; import Typography from '@material-ui/core/Typography'; import DeleteIcon from '@material-ui/icons/Delete'; import HistoryIcon from '@material-ui/icons/History'; import SearchIcon from '@material-ui/icons/Search'; import ClearAllIcon from '@material-ui/icons/ClearAll'; import connectComponent from '../../../helpers/connect-component'; import getLocale from '../../../helpers/get-locale'; import { deleteHistoryItem, loadHistory, clearAllHistory } from '../../../state/pages/history/actions'; import { loadOutput } from '../../../state/pages/home/actions'; import { changeRoute } from '../../../state/root/router/actions'; import { ROUTE_HOME } from '../../../constants/routes'; import SearchBox from './search-box'; const styles = (theme) => ({ emptyContainer: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', }, emptyInnerContainer: { textAlign: 'center', }, bigIcon: { height: 96, width: 96, color: theme.palette.text.primary, }, container: { flex: 1, display: 'flex', flexDirection: 'column', position: 'relative', overflow: 'hidden', }, listContainer: { flex: 1, overflowY: 'auto', WebkitOverflowScrolling: 'touch', padding: 0, boxSizing: 'border-box', }, progress: { marginTop: 12, }, appBarColorDefault: { background: theme.palette.type === 'dark' ? theme.palette.grey[900] : theme.palette.primary.main, color: theme.palette.type === 'dark' ? theme.palette.getContrastText(theme.palette.grey[900]) : theme.palette.primary.contrastText, }, title: { flex: 1, textAlign: 'center', }, toolbar: { minHeight: 40, paddingRight: theme.spacing(1.5), paddingLeft: theme.spacing(1.5), }, appBarMenu: { position: 'absolute', right: theme.spacing(1.5), }, toolbarIconButton: { padding: theme.spacing(1), }, }); class History extends React.Component { componentDidMount() { const { onLoadHistory } = this.props; onLoadHistory(true); if (this.listView) { this.listView.onscroll = () => { const { scrollTop, clientHeight, scrollHeight } = this.listView; if (scrollTop + clientHeight > scrollHeight - 200) { const { canLoadMore, historyLoading } = this.props; if (canLoadMore === true && historyLoading === false) { onLoadHistory(); } } }; } } componentWillUnmount() { if (this.listView) this.listView.onscroll = null; } render() { const { classes, historyItems, historyLoading, onChangeRoute, onClearAllHistory, onDeleteHistoryItem, onLoadOutput, query, } = this.props; return ( <div className={classes.container}> <AppBar position="static" color="default" elevation={0} classes={{ colorDefault: classes.appBarColorDefault }}> <Toolbar variant="dense" className={classes.toolbar}> <Typography variant="subtitle1" color="inherit" className={classes.title}>{getLocale('history')}</Typography> <div className={classes.appBarMenu}> <Tooltip title={getLocale('clearHistory')} placement="left"> <IconButton color="inherit" aria-label={getLocale('clearHistory')} className={classes.toolbarIconButton} onClick={onClearAllHistory} > <ClearAllIcon fontSize="small" /> </IconButton> </Tooltip> </div> </Toolbar> </AppBar> <SearchBox /> {(() => { if (historyItems.length < 1 && historyLoading === false) { return ( <div className={classes.emptyContainer}> <div className={classes.emptyInnerContainer}> {query ? ( <SearchIcon className={classes.bigIcon} /> ) : ( <HistoryIcon className={classes.bigIcon} /> )} <Typography variant="h5" color="textSecondary"> {query ? getLocale('noMatchingResults') : getLocale('history')} </Typography> {!query && ( <Typography variant="body2" color="textSecondary"> {getLocale('historyDesc')} </Typography> )} </div> </div> ); } return ( <div className={classes.listContainer} ref={(c) => { this.listView = c; }}> <List disablePadding> {historyItems.map((item) => [( <ListItem button key={`historyItem_${item.historyId}`} onClick={() => { onLoadOutput(item); onChangeRoute(ROUTE_HOME); }} > <ListItemText primary={item.outputText} secondary={item.inputText} primaryTypographyProps={{ color: 'textPrimary' }} /> <ListItemSecondaryAction> <Tooltip title={getLocale('remove')} placement="left"> <IconButton aria-label={getLocale('remove')} onClick={() => onDeleteHistoryItem( item.historyId, item.rev, )} > <DeleteIcon /> </IconButton> </Tooltip> </ListItemSecondaryAction> </ListItem> ), <Divider key={`historyDivider_${item.historyId}`} />])} </List> </div> ); })()} </div> ); } } History.propTypes = { canLoadMore: PropTypes.bool.isRequired, classes: PropTypes.object.isRequired, historyItems: PropTypes.arrayOf(PropTypes.object).isRequired, historyLoading: PropTypes.bool.isRequired, onChangeRoute: PropTypes.func.isRequired, onClearAllHistory: PropTypes.func.isRequired, onDeleteHistoryItem: PropTypes.func.isRequired, onLoadHistory: PropTypes.func.isRequired, onLoadOutput: PropTypes.func.isRequired, query: PropTypes.string.isRequired, }; const mapStateToProps = (state) => ({ canLoadMore: state.pages.history.canLoadMore, historyItems: state.pages.history.items, historyLoading: state.pages.history.loading, query: state.pages.history.query, }); const actionCreators = { changeRoute, clearAllHistory, deleteHistoryItem, loadHistory, loadOutput, }; export default connectComponent( History, mapStateToProps, actionCreators, styles, );
src/components/GithubButton/GithubButton.js
rkxtd/react-devops-kit
import React from 'react'; const GithubButton = (props) => { const {user, repo, type, width, height, count, large} = props; let src = `https://ghbtns.com/github-btn.html?user=${user}&repo=${repo}&type=${type}`; if (count) src += '&count=true'; if (large) src += '&size=large'; return ( <iframe src={src} frameBorder="0" allowTransparency="true" scrolling="0" width={width} height={height} style={{border: 'none', width: width, height: height}}></iframe> ); }; GithubButton.propTypes = { user: React.PropTypes.string.isRequired, repo: React.PropTypes.string.isRequired, type: React.PropTypes.oneOf(['star', 'watch', 'fork', 'follow']).isRequired, width: React.PropTypes.number.isRequired, height: React.PropTypes.number.isRequired, count: React.PropTypes.bool, large: React.PropTypes.bool }; export default GithubButton;
src/other/CloseButton.js
ndlib/beehive
import React from 'react' import PropTypes from 'prop-types' import { Button } from '@material-ui/core' import { makeStyles } from '@material-ui/core/styles' import ClearIcon from '@material-ui/icons/Clear' import { Link } from 'react-router-dom' import SearchStore from '../store/SearchStore' const useStyles = makeStyles(theme => ({ closeButton: { color: props => props.darkIcon ? theme.palette.common.black : theme.palette.common.white, }, icon: { border: 'solid 1px', verticalAlign: 'middle', }, container: { display: 'flex', justifyContent: 'flex-end', alignItems: 'center', marginLeft: 'auto', height: '100%', padding: '0', }, })) const CloseButton = ({ href, darkIcon }) => { // generate what the back location url is const destination = href || (() => { const current = window.location.pathname let stopword // this should bring us up 1 level. eg section=>showcase showcase=>collection if (current.includes('/items/')) { if (SearchStore.collection) { return SearchStore.searchUri() } stopword = 'items' } else if (current.includes('/pages/')) { stopword = 'pages' } else if (current.includes('/sections/')) { stopword = 'sections' } else if (current.includes('/showcases/')) { stopword = 'showcases' } else { return '/' } const re = RegExp(`((?:\/[^\/]+)+)\/${stopword}`) // eslint-disable-line no-useless-escape return re.exec(current)[1] })() const classes = useStyles({ darkIcon, }) return ( <Link to={destination} className={classes.container}> <Button className={classes.closeButton}> <ClearIcon className={`material-icons ${classes.icon}`} /> </Button> </Link> ) } CloseButton.propTypes = { href: PropTypes.string, darkIcon: PropTypes.bool, } export default CloseButton
eGasAPP/www/lib/auth0-lock/src/i18n.js
egasJMLM/App-web
import React from 'react'; import Immutable, { Map } from 'immutable'; import { format } from 'util'; import sync from './sync'; import * as l from './core/index'; import { dataFns } from './utils/data_utils'; const { get, set } = dataFns(["i18n"]); import enDictionary from './i18n/en'; import { load, preload } from './utils/cdn_utils'; export function str(m, keyPath, ...args) { return format(get(m, ["strings"].concat(keyPath), ""), ...args); } export function html(m, keyPath, ...args) { const html = str(m, keyPath, ...args); return html ? React.createElement("span", {dangerouslySetInnerHTML: {__html: html}}) : null; } export function group(m, keyPath) { return get(m, ["strings"].concat(keyPath), Map()).toJS(); } export function initI18n(m) { const language = l.ui.language(m); const overrides = l.ui.dict(m); let base = languageDictionaries[language] || Map({}); if (base.isEmpty()) { base = overrides; m = sync(m, "i18n", { syncFn: (_, cb) => syncLang(m, language, cb), successFn: (m, result) => { registerLanguageDictionary(language, result); return set( m, "strings", languageDictionaries[language].mergeDeep(overrides) ); } }); } if (!base.has("title")) { base = base.set("title", enDictionary.title); } if (!base.has("unrecoverableError")) { base = base.set("unrecoverableError", enDictionary.unrecoverableError); } return set(m, "strings", base.mergeDeep(overrides)); } // sync function syncLang(m, language, cb) { load({ method: "registerLanguageDictionary", url: `${l.assetsUrl(m)}/js/lock/${__VERSION__}/${language}.js`, check: str => str && str === language, cb: (err, _, dictionary) => { cb(err, dictionary); } }); } const languageDictionaries = []; function registerLanguageDictionary(language, dictionary) { languageDictionaries[language] = Immutable.fromJS(dictionary); } registerLanguageDictionary("en", enDictionary); preload({ method: "registerLanguageDictionary", cb: registerLanguageDictionary });
src/react/JSONTree/JSONObjectNode.js
rrrene/redux-devtools
import React from 'react'; import reactMixin from 'react-mixin'; import { ExpandedStateHandlerMixin } from './mixins'; import JSONArrow from './JSONArrow'; import grabNode from './grab-node'; const styles = { base: { position: 'relative', paddingTop: 3, paddingBottom: 3, marginLeft: 14 }, label: { margin: 0, padding: 0, display: 'inline-block' }, span: { cursor: 'default' }, spanType: { marginLeft: 5, marginRight: 5 } }; @reactMixin.decorate(ExpandedStateHandlerMixin) export default class JSONObjectNode extends React.Component { defaultProps = { data: [], initialExpanded: false }; // cache store for the number of items string we display itemString = false; // flag to see if we still need to render our child nodes needsChildNodes = true; // cache store for our child nodes renderedChildren = []; constructor(props) { super(props); this.state = { expanded: this.props.initialExpanded, createdChildNodes: false }; } // Returns the child nodes for each element in the object. If we have // generated them previously, we return from cache, otherwise we create // them. getChildNodes() { if (this.state.expanded && this.needsChildNodes) { const obj = this.props.data; let childNodes = []; for (let k in obj) { if (obj.hasOwnProperty(k)) { let prevData; if (typeof this.props.previousData !== 'undefined') { prevData = this.props.previousData[k]; } const node = grabNode(k, obj[k], prevData, this.props.theme); if (node !== false) { childNodes.push(node); } } } this.needsChildNodes = false; this.renderedChildren = childNodes; } return this.renderedChildren; } // Returns the "n Items" string for this node, generating and // caching it if it hasn't been created yet. getItemString() { if (!this.itemString) { const len = Object.keys(this.props.data).length; this.itemString = len + ' key' + (len !== 1 ? 's' : ''); } return this.itemString; } render() { let childListStyle = { padding: 0, margin: 0, listStyle: 'none', display: (this.state.expanded) ? 'block' : 'none' }; let containerStyle; let spanStyle = { ...styles.span, color: this.props.theme.base0B }; containerStyle = { ...styles.base }; if (this.state.expanded) { spanStyle = { ...spanStyle, color: this.props.theme.base03 }; } return ( <li style={containerStyle}> <JSONArrow theme={this.props.theme} open={this.state.expanded} onClick={::this.handleClick}/> <label style={{ ...styles.label, color: this.props.theme.base0D }} onClick={::this.handleClick}> {this.props.keyName}: </label> <span style={spanStyle} onClick={::this.handleClick}> <span style={styles.spanType}>&#123;&#125;</span> {this.getItemString()} </span> <ul style={childListStyle}> {this.getChildNodes()} </ul> </li> ); } }
CS_TEST3/html/jquery.js
erebus-labs/sense_platform
/*! * jQuery JavaScript Library v1.7.1 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Mon Nov 21 21:11:03 2011 -0500 */ (function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b4<b3;b4++){if((b9=arguments[b4])!=null){for(b2 in b9){b0=b5[b2];b1=b9[b2];if(b5===b1){continue}if(b8&&b1&&(bF.isPlainObject(b1)||(b6=bF.isArray(b1)))){if(b6){b6=false;b7=b0&&bF.isArray(b0)?b0:[]}else{b7=b0&&bF.isPlainObject(b0)?b0:{}}b5[b2]=bF.extend(b8,b7,b1)}else{if(b1!==L){b5[b2]=b1}}}}}return b5};bF.extend({noConflict:function(b0){if(bb.$===bF){bb.$=bH}if(b0&&bb.jQuery===bF){bb.jQuery=bU}return bF},isReady:false,readyWait:1,holdReady:function(b0){if(b0){bF.readyWait++}else{bF.ready(true)}},ready:function(b0){if((b0===true&&!--bF.readyWait)||(b0!==true&&!bF.isReady)){if(!av.body){return setTimeout(bF.ready,1)}bF.isReady=true;if(b0!==true&&--bF.readyWait>0){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b4<b5;){if(b6.apply(b3[b4++],b2)===false){break}}}}else{if(b0){for(b1 in b3){if(b6.call(b3[b1],b1,b3[b1])===false){break}}}else{for(;b4<b5;){if(b6.call(b3[b4],b4,b3[b4++])===false){break}}}}return b3},trim:bO?function(b0){return b0==null?"":bO.call(b0)}:function(b0){return b0==null?"":b0.toString().replace(bI,"").replace(bE,"")},makeArray:function(b3,b1){var b0=b1||[];if(b3!=null){var b2=bF.type(b3);if(b3.length==null||b2==="string"||b2==="function"||b2==="regexp"||bF.isWindow(b3)){bz.call(b0,b3)}else{bF.merge(b0,b3)}}return b0},inArray:function(b2,b3,b1){var b0;if(b3){if(bv){return bv.call(b3,b2,b1)}b0=b3.length;b1=b1?b1<0?Math.max(0,b0+b1):b1:0;for(;b1<b0;b1++){if(b1 in b3&&b3[b1]===b2){return b1}}}return -1},merge:function(b4,b2){var b3=b4.length,b1=0;if(typeof b2.length==="number"){for(var b0=b2.length;b1<b0;b1++){b4[b3++]=b2[b1]}}else{while(b2[b1]!==L){b4[b3++]=b2[b1++]}}b4.length=b3;return b4},grep:function(b1,b6,b0){var b2=[],b5;b0=!!b0;for(var b3=0,b4=b1.length;b3<b4;b3++){b5=!!b6(b1[b3],b3);if(b0!==b5){b2.push(b1[b3])}}return b2},map:function(b0,b7,b8){var b5,b6,b4=[],b2=0,b1=b0.length,b3=b0 instanceof bF||b1!==L&&typeof b1==="number"&&((b1>0&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b2<b1;b2++){b5=b7(b0[b2],b2,b8);if(b5!=null){b4[b4.length]=b5}}}else{for(b6 in b0){b5=b7(b0[b6],b6,b8);if(b5!=null){b4[b4.length]=b5}}}return b4.concat.apply([],b4)},guid:1,proxy:function(b4,b3){if(typeof b3==="string"){var b2=b4[b3];b3=b4;b4=b2}if(!bF.isFunction(b4)){return L}var b0=bK.call(arguments,2),b1=function(){return b4.apply(b3,b0.concat(bK.call(arguments)))};b1.guid=b4.guid=b4.guid||b1.guid||bF.guid++;return b1},access:function(b0,b8,b6,b2,b5,b7){var b1=b0.length;if(typeof b8==="object"){for(var b3 in b8){bF.access(b0,b3,b8[b3],b2,b5,b6)}return b0}if(b6!==L){b2=!b7&&b2&&bF.isFunction(b6);for(var b4=0;b4<b1;b4++){b5(b0[b4],b8,b2?b6.call(b0[b4],b4,b5(b0[b4],b8)):b6,b7)}return b0}return b1?b5(b0[0],b8):L},now:function(){return(new Date()).getTime()},uaMatch:function(b1){b1=b1.toLowerCase();var b0=by.exec(b1)||bR.exec(b1)||bQ.exec(b1)||b1.indexOf("compatible")<0&&bS.exec(b1)||[];return{browser:b0[1]||"",version:b0[2]||"0"}},sub:function(){function b0(b3,b4){return new b0.fn.init(b3,b4)}bF.extend(true,b0,this);b0.superclass=this;b0.fn=b0.prototype=this();b0.fn.constructor=b0;b0.sub=this.sub;b0.fn.init=function b2(b3,b4){if(b4&&b4 instanceof bF&&!(b4 instanceof b0)){b4=b0(b4)}return bF.fn.init.call(this,b3,b4,b1)};b0.fn.init.prototype=b0.fn;var b1=b0(av);return b0},browser:{}});bF.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(b1,b0){bx["[object "+b0+"]"]=b0.toLowerCase()});bV=bF.uaMatch(bX);if(bV.browser){bF.browser[bV.browser]=true;bF.browser.version=bV.version}if(bF.browser.webkit){bF.browser.safari=true}if(bM.test("\xA0")){bI=/^[\s\xA0]+/;bE=/[\s\xA0]+$/}bD=bF(av);if(av.addEventListener){e=function(){av.removeEventListener("DOMContentLoaded",e,false);bF.ready()}}else{if(av.attachEvent){e=function(){if(av.readyState==="complete"){av.detachEvent("onreadystatechange",e);bF.ready()}}}}function bw(){if(bF.isReady){return}try{av.documentElement.doScroll("left")}catch(b0){setTimeout(bw,1);return}bF.ready()}return bF})();var a2={};function X(e){var bv=a2[e]={},bw,bx;e=e.split(/\s+/);for(bw=0,bx=e.length;bw<bx;bw++){bv[e[bw]]=true}return bv}b.Callbacks=function(bw){bw=bw?(a2[bw]||X(bw)):{};var bB=[],bC=[],bx,by,bv,bz,bA,bE=function(bF){var bG,bJ,bI,bH,bK;for(bG=0,bJ=bF.length;bG<bJ;bG++){bI=bF[bG];bH=b.type(bI);if(bH==="array"){bE(bI)}else{if(bH==="function"){if(!bw.unique||!bD.has(bI)){bB.push(bI)}}}}},e=function(bG,bF){bF=bF||[];bx=!bw.memory||[bG,bF];by=true;bA=bv||0;bv=0;bz=bB.length;for(;bB&&bA<bz;bA++){if(bB[bA].apply(bG,bF)===false&&bw.stopOnFalse){bx=true;break}}by=false;if(bB){if(!bw.once){if(bC&&bC.length){bx=bC.shift();bD.fireWith(bx[0],bx[1])}}else{if(bx===true){bD.disable()}else{bB=[]}}}},bD={add:function(){if(bB){var bF=bB.length;bE(arguments);if(by){bz=bB.length}else{if(bx&&bx!==true){bv=bF;e(bx[0],bx[1])}}}return this},remove:function(){if(bB){var bF=arguments,bH=0,bI=bF.length;for(;bH<bI;bH++){for(var bG=0;bG<bB.length;bG++){if(bF[bH]===bB[bG]){if(by){if(bG<=bz){bz--;if(bG<=bA){bA--}}}bB.splice(bG--,1);if(bw.unique){break}}}}}return this},has:function(bG){if(bB){var bF=0,bH=bB.length;for(;bF<bH;bF++){if(bG===bB[bF]){return true}}}return false},empty:function(){bB=[];return this},disable:function(){bB=bC=bx=L;return this},disabled:function(){return !bB},lock:function(){bC=L;if(!bx||bx===true){bD.disable()}return this},locked:function(){return !bC},fireWith:function(bG,bF){if(bC){if(by){if(!bw.once){bC.push([bG,bF])}}else{if(!(bw.once&&bx)){e(bG,bF)}}}return this},fire:function(){bD.fireWith(this,arguments);return this},fired:function(){return !!bx}};return bD};var aJ=[].slice;b.extend({Deferred:function(by){var bx=b.Callbacks("once memory"),bw=b.Callbacks("once memory"),bv=b.Callbacks("memory"),e="pending",bA={resolve:bx,reject:bw,notify:bv},bC={done:bx.add,fail:bw.add,progress:bv.add,state:function(){return e},isResolved:bx.fired,isRejected:bw.fired,then:function(bE,bD,bF){bB.done(bE).fail(bD).progress(bF);return this},always:function(){bB.done.apply(bB,arguments).fail.apply(bB,arguments);return this},pipe:function(bF,bE,bD){return b.Deferred(function(bG){b.each({done:[bF,"resolve"],fail:[bE,"reject"],progress:[bD,"notify"]},function(bI,bL){var bH=bL[0],bK=bL[1],bJ;if(b.isFunction(bH)){bB[bI](function(){bJ=bH.apply(this,arguments);if(bJ&&b.isFunction(bJ.promise)){bJ.promise().then(bG.resolve,bG.reject,bG.notify)}else{bG[bK+"With"](this===bB?bG:this,[bJ])}})}else{bB[bI](bG[bK])}})}).promise()},promise:function(bE){if(bE==null){bE=bC}else{for(var bD in bC){bE[bD]=bC[bD]}}return bE}},bB=bC.promise({}),bz;for(bz in bA){bB[bz]=bA[bz].fire;bB[bz+"With"]=bA[bz].fireWith}bB.done(function(){e="resolved"},bw.disable,bv.lock).fail(function(){e="rejected"},bx.disable,bv.lock);if(by){by.call(bB,bB)}return bB},when:function(bA){var bx=aJ.call(arguments,0),bv=0,e=bx.length,bB=new Array(e),bw=e,by=e,bC=e<=1&&bA&&b.isFunction(bA.promise)?bA:b.Deferred(),bE=bC.promise();function bD(bF){return function(bG){bx[bF]=arguments.length>1?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv<e;bv++){if(bx[bv]&&bx[bv].promise&&b.isFunction(bx[bv].promise)){bx[bv].promise().then(bD(bv),bC.reject,bz(bv))}else{--bw}}if(!bw){bC.resolveWith(bC,bx)}}else{if(bC!==bA){bC.resolveWith(bC,e?[bA]:[])}}return bE}});b.support=(function(){var bJ,bI,bF,bG,bx,bE,bA,bD,bz,bK,bB,by,bw,bv=av.createElement("div"),bH=av.documentElement;bv.setAttribute("className","t");bv.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="<div "+e+"><div></div></div><table "+e+" cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="<div style='width:4px;'></div>";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA<bz;bA++){delete bB[bv[bA]]}if(!(by?S:b.isEmptyObject)(bB)){return}}}if(!by){delete e[bw].data;if(!S(e[bw])){return}}if(b.support.deleteExpando||!e.setInterval){delete e[bw]}else{e[bw]=null}if(bD){if(b.support.deleteExpando){delete bx[bC]}else{if(bx.removeAttribute){bx.removeAttribute(bC)}else{bx[bC]=null}}}},_data:function(bv,e,bw){return b.data(bv,e,bw,true)},acceptData:function(bv){if(bv.nodeName){var e=b.noData[bv.nodeName.toLowerCase()];if(e){return !(e===true||bv.getAttribute("classid")!==e)}}return true}});b.fn.extend({data:function(by,bA){var bB,e,bw,bz=null;if(typeof by==="undefined"){if(this.length){bz=b.data(this[0]);if(this[0].nodeType===1&&!b._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var bx=0,bv=e.length;bx<bv;bx++){bw=e[bx].name;if(bw.indexOf("data-")===0){bw=b.camelCase(bw.substring(5));a5(this[0],bw,bz[bw])}}b._data(this[0],"parsedAttrs",true)}}return bz}else{if(typeof by==="object"){return this.each(function(){b.data(this,by)})}}bB=by.split(".");bB[1]=bB[1]?"."+bB[1]:"";if(bA===L){bz=this.triggerHandler("getData"+bB[1]+"!",[bB[0]]);if(bz===L&&this.length){bz=b.data(this[0],by);bz=a5(this[0],by,bz)}return bz===L&&bB[1]?this.data(bB[0]):bz}else{return this.each(function(){var bC=b(this),bD=[bB[0],bA];bC.triggerHandler("setData"+bB[1]+"!",bD);b.data(this,by,bA);bC.triggerHandler("changeData"+bB[1]+"!",bD)})}},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function a5(bx,bw,by){if(by===L&&bx.nodeType===1){var bv="data-"+bw.replace(aA,"-$1").toLowerCase();by=bx.getAttribute(bv);if(typeof by==="string"){try{by=by==="true"?true:by==="false"?false:by==="null"?null:b.isNumeric(by)?parseFloat(by):aS.test(by)?b.parseJSON(by):by}catch(bz){}b.data(bx,bw,by)}else{by=L}}return by}function S(bv){for(var e in bv){if(e==="data"&&b.isEmptyObject(bv[e])){continue}if(e!=="toJSON"){return false}}return true}function bi(by,bx,bA){var bw=bx+"defer",bv=bx+"queue",e=bx+"mark",bz=b._data(by,bw);if(bz&&(bA==="queue"||!b._data(by,bv))&&(bA==="mark"||!b._data(by,e))){setTimeout(function(){if(!b._data(by,bv)&&!b._data(by,e)){b.removeData(by,bw,true);bz.fire()}},0)}}b.extend({_mark:function(bv,e){if(bv){e=(e||"fx")+"mark";b._data(bv,e,(b._data(bv,e)||0)+1)}},_unmark:function(by,bx,bv){if(by!==true){bv=bx;bx=by;by=false}if(bx){bv=bv||"fx";var e=bv+"mark",bw=by?0:((b._data(bx,e)||1)-1);if(bw){b._data(bx,e,bw)}else{b.removeData(bx,e,true);bi(bx,bv,"mark")}}},queue:function(bv,e,bx){var bw;if(bv){e=(e||"fx")+"queue";bw=b._data(bv,e);if(bx){if(!bw||b.isArray(bx)){bw=b._data(bv,e,b.makeArray(bx))}else{bw.push(bx)}}return bw||[]}},dequeue:function(by,bx){bx=bx||"fx";var bv=b.queue(by,bx),bw=bv.shift(),e={};if(bw==="inprogress"){bw=bv.shift()}if(bw){if(bx==="fx"){bv.unshift("inprogress")}b._data(by,bx+".run",e);bw.call(by,function(){b.dequeue(by,bx)},e)}if(!bv.length){b.removeData(by,bx+"queue "+bx+".run",true);bi(by,bx,"queue")}}});b.fn.extend({queue:function(e,bv){if(typeof e!=="string"){bv=e;e="fx"}if(bv===L){return b.queue(this[0],e)}return this.each(function(){var bw=b.queue(this,e,bv);if(e==="fx"&&bw[0]!=="inprogress"){b.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(bv,e){bv=b.fx?b.fx.speeds[bv]||bv:bv;e=e||"fx";return this.queue(e,function(bx,bw){var by=setTimeout(bx,bv);bw.stop=function(){clearTimeout(by)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(bD,bw){if(typeof bD!=="string"){bw=bD;bD=L}bD=bD||"fx";var e=b.Deferred(),bv=this,by=bv.length,bB=1,bz=bD+"defer",bA=bD+"queue",bC=bD+"mark",bx;function bE(){if(!(--bB)){e.resolveWith(bv,[bv])}}while(by--){if((bx=b.data(bv[by],bz,L,true)||(b.data(bv[by],bA,L,true)||b.data(bv[by],bC,L,true))&&b.data(bv[by],bz,b.Callbacks("once memory"),true))){bB++;bx.add(bE)}}bE();return e.promise()}});var aP=/[\n\t\r]/g,af=/\s+/,aU=/\r/g,g=/^(?:button|input)$/i,D=/^(?:button|input|object|select|textarea)$/i,l=/^a(?:rea)?$/i,ao=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,F=b.support.getSetAttribute,be,aY,aF;b.fn.extend({attr:function(e,bv){return b.access(this,e,bv,true,b.attr)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,bv){return b.access(this,e,bv,true,b.prop)},removeProp:function(e){e=b.propFix[e]||e;return this.each(function(){try{this[e]=L;delete this[e]}catch(bv){}})},addClass:function(by){var bA,bw,bv,bx,bz,bB,e;if(b.isFunction(by)){return this.each(function(bC){b(this).addClass(by.call(this,bC,this.className))})}if(by&&typeof by==="string"){bA=by.split(af);for(bw=0,bv=this.length;bw<bv;bw++){bx=this[bw];if(bx.nodeType===1){if(!bx.className&&bA.length===1){bx.className=by}else{bz=" "+bx.className+" ";for(bB=0,e=bA.length;bB<e;bB++){if(!~bz.indexOf(" "+bA[bB]+" ")){bz+=bA[bB]+" "}}bx.className=b.trim(bz)}}}}return this},removeClass:function(bz){var bA,bw,bv,by,bx,bB,e;if(b.isFunction(bz)){return this.each(function(bC){b(this).removeClass(bz.call(this,bC,this.className))})}if((bz&&typeof bz==="string")||bz===L){bA=(bz||"").split(af);for(bw=0,bv=this.length;bw<bv;bw++){by=this[bw];if(by.nodeType===1&&by.className){if(bz){bx=(" "+by.className+" ").replace(aP," ");for(bB=0,e=bA.length;bB<e;bB++){bx=bx.replace(" "+bA[bB]+" "," ")}by.className=b.trim(bx)}else{by.className=""}}}}return this},toggleClass:function(bx,bv){var bw=typeof bx,e=typeof bv==="boolean";if(b.isFunction(bx)){return this.each(function(by){b(this).toggleClass(bx.call(this,by,this.className,bv),bv)})}return this.each(function(){if(bw==="string"){var bA,bz=0,by=b(this),bB=bv,bC=bx.split(af);while((bA=bC[bz++])){bB=e?bB:!by.hasClass(bA);by[bB?"addClass":"removeClass"](bA)}}else{if(bw==="undefined"||bw==="boolean"){if(this.className){b._data(this,"__className__",this.className)}this.className=this.className||bx===false?"":b._data(this,"__className__")||""}}})},hasClass:function(e){var bx=" "+e+" ",bw=0,bv=this.length;for(;bw<bv;bw++){if(this[bw].nodeType===1&&(" "+this[bw].className+" ").replace(aP," ").indexOf(bx)>-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv<bz;bv++){bx=bC[bv];if(bx.selected&&(b.support.optDisabled?!bx.disabled:bx.getAttribute("disabled")===null)&&(!bx.parentNode.disabled||!b.nodeName(bx.parentNode,"optgroup"))){bA=b(bx).val();if(bw){return bA}bB.push(bA)}}if(bw&&!bB.length&&bC.length){return b(bC[by]).val()}return bB},set:function(bv,bw){var e=b.makeArray(bw);b(bv).find("option").each(function(){this.selected=b.inArray(b(this).val(),e)>=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw<e;bw++){bv=bA[bw];if(bv){by=b.propFix[bv]||bv;b.attr(bx,bv,"");bx.removeAttribute(F?bv:by);if(ao.test(bv)&&by in bx){bx[by]=false}}}}},attrHooks:{type:{set:function(e,bv){if(g.test(e.nodeName)&&e.parentNode){b.error("type property can't be changed")}else{if(!b.support.radioValue&&bv==="radio"&&b.nodeName(e,"input")){var bw=e.value;e.setAttribute("type",bv);if(bw){e.value=bw}return bv}}}},value:{get:function(bv,e){if(be&&b.nodeName(bv,"button")){return be.get(bv,e)}return e in bv?bv.value:null},set:function(bv,bw,e){if(be&&b.nodeName(bv,"button")){return be.set(bv,bw,e)}bv.value=bw}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(bz,bx,bA){var bw,e,by,bv=bz.nodeType;if(!bz||bv===3||bv===8||bv===2){return}by=bv!==1||!b.isXMLDoc(bz);if(by){bx=b.propFix[bx]||bx;e=b.propHooks[bx]}if(bA!==L){if(e&&"set" in e&&(bw=e.set(bz,bA,bx))!==L){return bw}else{return(bz[bx]=bA)}}else{if(e&&"get" in e&&(bw=e.get(bz,bx))!==null){return bw}else{return bz[bx]}}},propHooks:{tabIndex:{get:function(bv){var e=bv.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):D.test(bv.nodeName)||l.test(bv.nodeName)&&bv.href?0:L}}}});b.attrHooks.tabindex=b.propHooks.tabIndex;aY={get:function(bv,e){var bx,bw=b.prop(bv,e);return bw===true||typeof bw!=="boolean"&&(bx=bv.getAttributeNode(e))&&bx.nodeValue!==false?e.toLowerCase():L},set:function(bv,bx,e){var bw;if(bx===false){b.removeAttr(bv,e)}else{bw=b.propFix[e]||e;if(bw in bv){bv[bw]=true}bv.setAttribute(e,e.toLowerCase())}return e}};if(!F){aF={name:true,id:true};be=b.valHooks.button={get:function(bw,bv){var e;e=bw.getAttributeNode(bv);return e&&(aF[bv]?e.nodeValue!=="":e.specified)?e.nodeValue:L},set:function(bw,bx,bv){var e=bw.getAttributeNode(bv);if(!e){e=av.createAttribute(bv);bw.setAttributeNode(e)}return(e.nodeValue=bx+"")}};b.attrHooks.tabindex.set=be.set;b.each(["width","height"],function(bv,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{set:function(bw,bx){if(bx===""){bw.setAttribute(e,"auto");return bx}}})});b.attrHooks.contenteditable={get:be.get,set:function(bv,bw,e){if(bw===""){bw="false"}be.set(bv,bw,e)}}}if(!b.support.hrefNormalized){b.each(["href","src","width","height"],function(bv,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{get:function(bx){var bw=bx.getAttribute(e,2);return bw===null?L:bw}})})}if(!b.support.style){b.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||L},set:function(e,bv){return(e.style.cssText=""+bv)}}}if(!b.support.optSelected){b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(bv){var e=bv.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!b.support.enctype){b.propFix.enctype="encoding"}if(!b.support.checkOn){b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,bv){if(b.isArray(bv)){return(e.checked=b.inArray(b(e).val(),bv)>=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI<bC.length;bI++){bH=n.exec(bC[bI])||[];bF=bH[1];e=(bH[2]||"").split(".").sort();bE=b.event.special[bF]||{};bF=(by?bE.delegateType:bE.bindType)||bF;bE=b.event.special[bF]||{};bG=b.extend({type:bF,origType:bH[1],data:bA,handler:bJ,guid:bJ.guid,selector:by,quick:Y(by),namespace:e.join(".")},bv);bw=bK[bF];if(!bw){bw=bK[bF]=[];bw.delegateCount=0;if(!bE.setup||bE.setup.call(bx,bA,e,bB)===false){if(bx.addEventListener){bx.addEventListener(bF,bB,false)}else{if(bx.attachEvent){bx.attachEvent("on"+bF,bB)}}}}if(bE.add){bE.add.call(bx,bG);if(!bG.handler.guid){bG.handler.guid=bJ.guid}}if(by){bw.splice(bw.delegateCount++,0,bG)}else{bw.push(bG)}b.event.global[bF]=true}bx=null},global:{},remove:function(bJ,bE,bv,bH,bB){var bI=b.hasData(bJ)&&b._data(bJ),bF,bx,bz,bL,bC,bA,bG,bw,by,bK,bD,e;if(!bI||!(bw=bI.events)){return}bE=b.trim(bt(bE||"")).split(" ");for(bF=0;bF<bE.length;bF++){bx=n.exec(bE[bF])||[];bz=bL=bx[1];bC=bx[2];if(!bz){for(bz in bw){b.event.remove(bJ,bz+bE[bF],bv,bH,true)}continue}by=b.event.special[bz]||{};bz=(bH?by.delegateType:by.bindType)||bz;bD=bw[bz]||[];bA=bD.length;bC=bC?new RegExp("(^|\\.)"+bC.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(bG=0;bG<bD.length;bG++){e=bD[bG];if((bB||bL===e.origType)&&(!bv||bv.guid===e.guid)&&(!bC||bC.test(e.namespace))&&(!bH||bH===e.selector||bH==="**"&&e.selector)){bD.splice(bG--,1);if(e.selector){bD.delegateCount--}if(by.remove){by.remove.call(bJ,e)}}}if(bD.length===0&&bA!==bD.length){if(!by.teardown||by.teardown.call(bJ,bC)===false){b.removeEvent(bJ,bz,bI.handle)}delete bw[bz]}}if(b.isEmptyObject(bw)){bK=bI.handle;if(bK){bK.elem=null}b.removeData(bJ,["events","handle"],true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(bv,bD,bA,bJ){if(bA&&(bA.nodeType===3||bA.nodeType===8)){return}var bG=bv.type||bv,bx=[],e,bw,bC,bH,bz,by,bF,bE,bB,bI;if(T.test(bG+b.event.triggered)){return}if(bG.indexOf("!")>=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bC<bB.length&&!bv.isPropagationStopped();bC++){bH=bB[bC][0];bv.type=bB[bC][1];bE=(b._data(bH,"events")||{})[bv.type]&&b._data(bH,"handle");if(bE){bE.apply(bH,bD)}bE=by&&bH[by];if(bE&&b.acceptData(bH)&&bE.apply(bH,bD)===false){bv.preventDefault()}}bv.type=bG;if(!bJ&&!bv.isDefaultPrevented()){if((!bF._default||bF._default.apply(bA.ownerDocument,bD)===false)&&!(bG==="click"&&b.nodeName(bA,"a"))&&b.acceptData(bA)){if(by&&bA[bG]&&((bG!=="focus"&&bG!=="blur")||bv.target.offsetWidth!==0)&&!b.isWindow(bA)){bz=bA[by];if(bz){bA[by]=null}b.event.triggered=bG;bA[bG]();b.event.triggered=L;if(bz){bA[by]=bz}}}}return bv.result},dispatch:function(e){e=b.event.fix(e||bb.event);var bz=((b._data(this,"events")||{})[e.type]||[]),bA=bz.delegateCount,bG=[].slice.call(arguments,0),by=!e.exclusive&&!e.namespace,bH=[],bC,bB,bK,bx,bF,bE,bv,bD,bI,bw,bJ;bG[0]=e;e.delegateTarget=this;if(bA&&!e.target.disabled&&!(e.button&&e.type==="click")){bx=b(this);bx.context=this.ownerDocument||this;for(bK=e.target;bK!=this;bK=bK.parentNode||this){bE={};bD=[];bx[0]=bK;for(bC=0;bC<bA;bC++){bI=bz[bC];bw=bI.selector;if(bE[bw]===L){bE[bw]=(bI.quick?j(bK,bI.quick):bx.is(bw))}if(bE[bw]){bD.push(bI)}}if(bD.length){bH.push({elem:bK,matches:bD})}}}if(bz.length>bA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC<bH.length&&!e.isPropagationStopped();bC++){bv=bH[bC];e.currentTarget=bv.elem;for(bB=0;bB<bv.matches.length&&!e.isImmediatePropagationStopped();bB++){bI=bv.matches[bB];if(by||(!e.namespace&&!bI.namespace)||e.namespace_re&&e.namespace_re.test(bI.namespace)){e.data=bI.data;e.handleObj=bI;bF=((b.event.special[bI.origType]||{}).handle||bI.handler).apply(bv.elem,bG);if(bF!==L){e.result=bF;if(bF===false){e.preventDefault();e.stopPropagation()}}}}}return e.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(bv,e){if(bv.which==null){bv.which=e.charCode!=null?e.charCode:e.keyCode}return bv}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(bx,bw){var by,bz,e,bv=bw.button,bA=bw.fromElement;if(bx.pageX==null&&bw.clientX!=null){by=bx.target.ownerDocument||av;bz=by.documentElement;e=by.body;bx.pageX=bw.clientX+(bz&&bz.scrollLeft||e&&e.scrollLeft||0)-(bz&&bz.clientLeft||e&&e.clientLeft||0);bx.pageY=bw.clientY+(bz&&bz.scrollTop||e&&e.scrollTop||0)-(bz&&bz.clientTop||e&&e.clientTop||0)}if(!bx.relatedTarget&&bA){bx.relatedTarget=bA===bx.target?bw.toElement:bA}if(!bx.which&&bv!==L){bx.which=(bv&1?1:(bv&2?3:(bv&4?2:0)))}return bx}},fix:function(bw){if(bw[b.expando]){return bw}var bv,bz,e=bw,bx=b.event.fixHooks[bw.type]||{},by=bx.props?this.props.concat(bx.props):this.props;bw=b.Event(e);for(bv=by.length;bv;){bz=by[--bv];bw[bz]=e[bz]}if(!bw.target){bw.target=e.srcElement||av}if(bw.target.nodeType===3){bw.target=bw.target.parentNode}if(bw.metaKey===L){bw.metaKey=bw.ctrlKey}return bx.filter?bx.filter(bw,e):bw},special:{ready:{setup:b.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(bw,bv,e){if(b.isWindow(this)){this.onbeforeunload=e}},teardown:function(bv,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}},simulate:function(bw,by,bx,bv){var bz=b.extend(new b.Event(),bx,{type:bw,isSimulated:true,originalEvent:{}});if(bv){b.event.trigger(bz,null,by)}else{b.event.dispatch.call(by,bz)}if(bz.isDefaultPrevented()){bx.preventDefault()}}};b.event.handle=b.event.dispatch;b.removeEvent=av.removeEventListener?function(bv,e,bw){if(bv.removeEventListener){bv.removeEventListener(e,bw,false)}}:function(bv,e,bw){if(bv.detachEvent){bv.detachEvent("on"+e,bw)}};b.Event=function(bv,e){if(!(this instanceof b.Event)){return new b.Event(bv,e)}if(bv&&bv.type){this.originalEvent=bv;this.type=bv.type;this.isDefaultPrevented=(bv.defaultPrevented||bv.returnValue===false||bv.getPreventDefault&&bv.getPreventDefault())?i:bk}else{this.type=bv}if(e){b.extend(this,e)}this.timeStamp=bv&&bv.timeStamp||b.now();this[b.expando]=true};function bk(){return false}function i(){return true}b.Event.prototype={preventDefault:function(){this.isDefaultPrevented=i;var bv=this.originalEvent;if(!bv){return}if(bv.preventDefault){bv.preventDefault()}else{bv.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=i;var bv=this.originalEvent;if(!bv){return}if(bv.stopPropagation){bv.stopPropagation()}bv.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i;this.stopPropagation()},isDefaultPrevented:bk,isPropagationStopped:bk,isImmediatePropagationStopped:bk};b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bv,e){b.event.special[bv]={delegateType:e,bindType:e,handle:function(bz){var bB=this,bA=bz.relatedTarget,by=bz.handleObj,bw=by.selector,bx;if(!bA||(bA!==bB&&!b.contains(bB,bA))){bz.type=by.origType;bx=by.handler.apply(this,arguments);bz.type=e}return bx}}});if(!b.support.submitBubbles){b.event.special.submit={setup:function(){if(b.nodeName(this,"form")){return false}b.event.add(this,"click._submit keypress._submit",function(bx){var bw=bx.target,bv=b.nodeName(bw,"input")||b.nodeName(bw,"button")?bw.form:L;if(bv&&!bv._submit_attached){b.event.add(bv,"submit._submit",function(e){if(this.parentNode&&!e.isTrigger){b.event.simulate("submit",this.parentNode,e,true)}});bv._submit_attached=true}})},teardown:function(){if(b.nodeName(this,"form")){return false}b.event.remove(this,"._submit")}}}if(!b.support.changeBubbles){b.event.special.change={setup:function(){if(bd.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){b.event.add(this,"propertychange._change",function(e){if(e.originalEvent.propertyName==="checked"){this._just_changed=true}});b.event.add(this,"click._change",function(e){if(this._just_changed&&!e.isTrigger){this._just_changed=false;b.event.simulate("change",this,e,true)}})}return false}b.event.add(this,"beforeactivate._change",function(bw){var bv=bw.target;if(bd.test(bv.nodeName)&&!bv._change_attached){b.event.add(bv,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){b.event.simulate("change",this.parentNode,e,true)}});bv._change_attached=true}})},handle:function(bv){var e=bv.target;if(this!==e||bv.isSimulated||bv.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return bv.handleObj.handler.apply(this,arguments)}},teardown:function(){b.event.remove(this,"._change");return bd.test(this.nodeName)}}}if(!b.support.focusinBubbles){b.each({focus:"focusin",blur:"focusout"},function(bx,e){var bv=0,bw=function(by){b.event.simulate(e,by.target,b.event.fix(by),true)};b.event.special[e]={setup:function(){if(bv++===0){av.addEventListener(bx,bw,true)}},teardown:function(){if(--bv===0){av.removeEventListener(bx,bw,true)}}}})}b.fn.extend({on:function(bw,e,bz,by,bv){var bA,bx;if(typeof bw==="object"){if(typeof e!=="string"){bz=e;e=L}for(bx in bw){this.on(bx,e,bz,bw[bx],bv)}return this}if(bz==null&&by==null){by=e;bz=e=L}else{if(by==null){if(typeof e==="string"){by=bz;bz=L}else{by=bz;bz=e;e=L}}}if(by===false){by=bk}else{if(!by){return this}}if(bv===1){bA=by;by=function(bB){b().off(bB);return bA.apply(this,arguments)};by.guid=bA.guid||(bA.guid=b.guid++)}return this.each(function(){b.event.add(this,bw,by,bz,e)})},one:function(bv,e,bx,bw){return this.on.call(this,bv,e,bx,bw,1)},off:function(bw,e,by){if(bw&&bw.preventDefault&&bw.handleObj){var bv=bw.handleObj;b(bw.delegateTarget).off(bv.namespace?bv.type+"."+bv.namespace:bv.type,bv.selector,bv.handler);return this}if(typeof bw==="object"){for(var bx in bw){this.off(bx,e,bw[bx])}return this}if(e===false||typeof e==="function"){by=e;e=L}if(by===false){by=bk}return this.each(function(){b.event.remove(this,bw,by,e)})},bind:function(e,bw,bv){return this.on(e,null,bw,bv)},unbind:function(e,bv){return this.off(e,null,bv)},live:function(e,bw,bv){b(this.context).on(e,this.selector,bw,bv);return this},die:function(e,bv){b(this.context).off(e,this.selector||"**",bv);return this},delegate:function(e,bv,bx,bw){return this.on(bv,e,bx,bw)},undelegate:function(e,bv,bw){return arguments.length==1?this.off(e,"**"):this.off(bv,e,bw)},trigger:function(e,bv){return this.each(function(){b.event.trigger(e,bv,this)})},triggerHandler:function(e,bv){if(this[0]){return b.event.trigger(e,bv,this[0],true)}},toggle:function(bx){var bv=arguments,e=bx.guid||b.guid++,bw=0,by=function(bz){var bA=(b._data(this,"lastToggle"+bx.guid)||0)%bw;b._data(this,"lastToggle"+bx.guid,bA+1);bz.preventDefault();return bv[bA].apply(this,arguments)||false};by.guid=e;while(bw<bv.length){bv[bw++].guid=e}return this.click(by)},hover:function(e,bv){return this.mouseenter(e).mouseleave(bv||e)}});b.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu").split(" "),function(bv,e){b.fn[e]=function(bx,bw){if(bw==null){bw=bx;bx=null}return arguments.length>0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e<bR.length;e++){if(bR[e]===bR[e-1]){bR.splice(e--,1)}}}}return bR};by.matches=function(e,bR){return by(e,null,null,bR)};by.matchesSelector=function(e,bR){return by(bR,null,null,[e]).length>0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS<bU;bS++){bV=bE.order[bS];if((bT=bE.leftMatch[bV].exec(bX))){bR=bT[1];bT.splice(1,1);if(bR.substr(bR.length-1)!=="\\"){bT[1]=(bT[1]||"").replace(bK,"");bW=bE.find[bV](bT,e,bY);if(bW!=null){bX=bX.replace(bE.match[bV],"");break}}}}if(!bW){bW=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bW,expr:bX}};by.filter=function(b1,b0,b4,bU){var bW,e,bZ,b6,b3,bR,bT,bV,b2,bS=b1,b5=[],bY=b0,bX=b0&&b0[0]&&by.isXML(b0[0]);while(b1&&b0.length){for(bZ in bE.filter){if((bW=bE.leftMatch[bZ].exec(b1))!=null&&bW[2]){bR=bE.filter[bZ];bT=bW[1];e=false;bW.splice(1,1);if(bT.substr(bT.length-1)==="\\"){continue}if(bY===b5){b5=[]}if(bE.preFilter[bZ]){bW=bE.preFilter[bZ](bW,bY,b4,b5,bU,bX);if(!bW){e=b6=true}else{if(bW===true){continue}}}if(bW){for(bV=0;(b3=bY[bV])!=null;bV++){if(b3){b6=bR(b3,bW,bV,bY);b2=bU^b6;if(b4&&b6!=null){if(b2){e=true}else{bY[bV]=false}}else{if(b2){b5.push(b3);e=true}}}}}if(b6!==L){if(!b4){bY=b5}b1=b1.replace(bE.match[bZ],"");if(!e){return[]}break}}}if(b1===bS){if(e==null){by.error(b1)}else{break}}bS=b1}return bY};by.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var bw=by.getText=function(bU){var bS,bT,e=bU.nodeType,bR="";if(e){if(e===1||e===9){if(typeof bU.textContent==="string"){return bU.textContent}else{if(typeof bU.innerText==="string"){return bU.innerText.replace(bO,"")}else{for(bU=bU.firstChild;bU;bU=bU.nextSibling){bR+=bw(bU)}}}}else{if(e===3||e===4){return bU.nodeValue}}}else{for(bS=0;(bT=bU[bS]);bS++){if(bT.nodeType!==8){bR+=bw(bT)}}}return bR};var bE=by.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(bW,bR){var bT=typeof bR==="string",bV=bT&&!bQ.test(bR),bX=bT&&!bV;if(bV){bR=bR.toLowerCase()}for(var bS=0,e=bW.length,bU;bS<e;bS++){if((bU=bW[bS])){while((bU=bU.previousSibling)&&bU.nodeType!==1){}bW[bS]=bX||bU&&bU.nodeName.toLowerCase()===bR?bU||false:bU===bR}}if(bX){by.filter(bR,bW,true)}},">":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS<e;bS++){bV=bW[bS];if(bV){var bT=bV.parentNode;bW[bS]=bT.nodeName.toLowerCase()===bR?bT:false}}}else{for(;bS<e;bS++){bV=bW[bS];if(bV){bW[bS]=bU?bV.parentNode:bV.parentNode===bR}}if(bU){by.filter(bR,bW,true)}}},"":function(bT,bR,bV){var bU,bS=bI++,e=bN;if(typeof bR==="string"&&!bQ.test(bR)){bR=bR.toLowerCase();bU=bR;e=bv}e("parentNode",bR,bS,bT,bU,bV)},"~":function(bT,bR,bV){var bU,bS=bI++,e=bN;if(typeof bR==="string"&&!bQ.test(bR)){bR=bR.toLowerCase();bU=bR;e=bv}e("previousSibling",bR,bS,bT,bU,bV)}},find:{ID:function(bR,bS,bT){if(typeof bS.getElementById!=="undefined"&&!bT){var e=bS.getElementById(bR[1]);return e&&e.parentNode?[e]:[]}},NAME:function(bS,bV){if(typeof bV.getElementsByName!=="undefined"){var bR=[],bU=bV.getElementsByName(bS[1]);for(var bT=0,e=bU.length;bT<e;bT++){if(bU[bT].getAttribute("name")===bS[1]){bR.push(bU[bT])}}return bR.length===0?null:bR}},TAG:function(e,bR){if(typeof bR.getElementsByTagName!=="undefined"){return bR.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(bT,bR,bS,e,bW,bX){bT=" "+bT[1].replace(bK,"")+" ";if(bX){return bT}for(var bU=0,bV;(bV=bR[bU])!=null;bU++){if(bV){if(bW^(bV.className&&(" "+bV.className+" ").replace(/[\t\n\r]/g," ").indexOf(bT)>=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bR<e[3]-0},gt:function(bS,bR,e){return bR>e[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV<bU;bV++){if(bT[bV]===bS){return false}}return true}else{by.error(e)}}}},CHILD:function(bS,bU){var bT,b0,bW,bZ,e,bV,bY,bX=bU[1],bR=bS;switch(bX){case"only":case"first":while((bR=bR.previousSibling)){if(bR.nodeType===1){return false}}if(bX==="first"){return true}bR=bS;case"last":while((bR=bR.nextSibling)){if(bR.nodeType===1){return false}}return true;case"nth":bT=bU[2];b0=bU[3];if(bT===1&&b0===0){return true}bW=bU[0];bZ=bS.parentNode;if(bZ&&(bZ[bC]!==bW||!bS.nodeIndex)){bV=0;for(bR=bZ.firstChild;bR;bR=bR.nextSibling){if(bR.nodeType===1){bR.nodeIndex=++bV}}bZ[bC]=bW}bY=bS.nodeIndex-b0;if(bT===0){return bY===0}else{return(bY%bT===0&&bY/bT>=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS<e;bS++){bR.push(bU[bS])}}else{for(;bU[bS];bS++){bR.push(bU[bS])}}}return bR}}var bJ,bG;if(av.documentElement.compareDocumentPosition){bJ=function(bR,e){if(bR===e){bB=true;return 0}if(!bR.compareDocumentPosition||!e.compareDocumentPosition){return bR.compareDocumentPosition?-1:1}return bR.compareDocumentPosition(e)&4?-1:1}}else{bJ=function(bY,bX){if(bY===bX){bB=true;return 0}else{if(bY.sourceIndex&&bX.sourceIndex){return bY.sourceIndex-bX.sourceIndex}}var bV,bR,bS=[],e=[],bU=bY.parentNode,bW=bX.parentNode,bZ=bU;if(bU===bW){return bG(bY,bX)}else{if(!bU){return -1}else{if(!bW){return 1}}}while(bZ){bS.unshift(bZ);bZ=bZ.parentNode}bZ=bW;while(bZ){e.unshift(bZ);bZ=bZ.parentNode}bV=bS.length;bR=e.length;for(var bT=0;bT<bV&&bT<bR;bT++){if(bS[bT]!==e[bT]){return bG(bS[bT],e[bT])}}return bT===bV?bG(bY,e[bT],-1):bG(bS[bT],bX,1)};bG=function(bR,e,bS){if(bR===e){return bS}var bT=bR.nextSibling;while(bT){if(bT===e){return -1}bT=bT.nextSibling}return 1}}(function(){var bR=av.createElement("div"),bS="script"+(new Date()).getTime(),e=av.documentElement;bR.innerHTML="<a name='"+bS+"'/>";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="<p class='TEST'></p>";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT<bS;bT++){var e=bZ[bT];if(e){var bU=false;e=e[bR];while(e){if(e[bC]===bV){bU=bZ[e.sizset];break}if(e.nodeType===1&&!bY){e[bC]=bV;e.sizset=bT}if(e.nodeName.toLowerCase()===bW){bU=e;break}e=e[bR]}bZ[bT]=bU}}}function bN(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT<bS;bT++){var e=bZ[bT];if(e){var bU=false;e=e[bR];while(e){if(e[bC]===bV){bU=bZ[e.sizset];break}if(e.nodeType===1){if(!bY){e[bC]=bV;e.sizset=bT}if(typeof bW!=="string"){if(e===bW){bU=true;break}}else{if(by.filter(bW,[e]).length>0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT<bR;bT++){by(bS,bY[bT],bX,bW)}return by.filter(bU,bX)};by.attr=b.attr;by.selectors.attrMap={};b.find=by;b.expr=by.selectors;b.expr[":"]=b.expr.filters;b.unique=by.uniqueSort;b.text=by.getText;b.isXMLDoc=by.isXML;b.contains=by.contains})();var ab=/Until$/,aq=/^(?:parents|prevUntil|prevAll)/,a9=/,/,bp=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,H=b.expr.match.POS,ay={children:true,contents:true,next:true,prev:true};b.fn.extend({find:function(e){var bw=this,by,bv;if(typeof e!=="string"){return b(e).filter(function(){for(by=0,bv=bw.length;by<bv;by++){if(b.contains(bw[by],this)){return true}}})}var bx=this.pushStack("","find",e),bA,bB,bz;for(by=0,bv=this.length;by<bv;by++){bA=bx.length;b.find(e,this[by],bx);if(by>0){for(bB=bA;bB<bx.length;bB++){for(bz=0;bz<bA;bz++){if(bx[bz]===bx[bB]){bx.splice(bB--,1);break}}}}}return bx},has:function(bv){var e=b(bv);return this.filter(function(){for(var bx=0,bw=e.length;bx<bw;bx++){if(b.contains(this,e[bx])){return true}}})},not:function(e){return this.pushStack(aG(this,e,false),"not",e)},filter:function(e){return this.pushStack(aG(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?H.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw<by.length;bw++){if(b(bz).is(by[bw])){bv.push({selector:by[bw],elem:bz,level:bB})}}bz=bz.parentNode;bB++}return bv}var bA=H.test(by)||typeof by!=="string"?b(by,bx||this.context):0;for(bw=0,e=this.length;bw<e;bw++){bz=this[bw];while(bz){if(bA?bA.index(bz)>-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/<tbody/i,W=/<|&#?\w+;/,ae=/<(?:script|style)/i,O=/<(?:script|object|embed|option|style)/i,ah=new RegExp("<(?:"+aR+")","i"),o=/checked\s*(?:[^=]|=\s*.checked.)/i,bm=/\/(java|ecma)script/i,aN=/^\s*<!(?:\[CDATA\[|\-\-)/,ax={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div<div>","</div>"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1></$2>");try{for(var bw=0,bv=this.length;bw<bv;bw++){if(this[bw].nodeType===1){b.cleanData(this[bw].getElementsByTagName("*"));this[bw].innerHTML=bx}}}catch(by){this.empty().append(bx)}}else{if(b.isFunction(bx)){this.each(function(bz){var e=b(this);e.html(bx.call(this,bz,e.html()))})}else{this.empty().append(bx)}}}return this},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(b.isFunction(e)){return this.each(function(bx){var bw=b(this),bv=bw.html();bw.replaceWith(e.call(this,bx,bv))})}if(typeof e!=="string"){e=b(e).detach()}return this.each(function(){var bw=this.nextSibling,bv=this.parentNode;b(this).remove();if(bw){b(bw).before(e)}else{b(bv).append(e)}})}else{return this.length?this.pushStack(b(b.isFunction(e)?e():e),"replaceWith",e):this}},detach:function(e){return this.remove(e,true)},domManip:function(bB,bF,bE){var bx,by,bA,bD,bC=bB[0],bv=[];if(!b.support.checkClone&&arguments.length===3&&typeof bC==="string"&&o.test(bC)){return this.each(function(){b(this).domManip(bB,bF,bE,true)})}if(b.isFunction(bC)){return this.each(function(bH){var bG=b(this);bB[0]=bC.call(this,bH,bF?bG.html():L);bG.domManip(bB,bF,bE)})}if(this[0]){bD=bC&&bC.parentNode;if(b.support.parentNode&&bD&&bD.nodeType===11&&bD.childNodes.length===this.length){bx={fragment:bD}}else{bx=b.buildFragment(bB,this,bv)}bA=bx.fragment;if(bA.childNodes.length===1){by=bA=bA.firstChild}else{by=bA.firstChild}if(by){bF=bF&&b.nodeName(by,"tr");for(var bw=0,e=this.length,bz=e-1;bw<e;bw++){bE.call(bF?ba(this[bw],by):this[bw],bx.cacheable||(e>1&&bw<bz)?b.clone(bA,true,true):bA)}}if(bv.length){b.each(bv,bo)}}return this}});function ba(e,bv){return b.nodeName(e,"table")?(e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody"))):e}function t(bB,bv){if(bv.nodeType!==1||!b.hasData(bB)){return}var by,bx,e,bA=b._data(bB),bz=b._data(bv,bA),bw=bA.events;if(bw){delete bz.handle;bz.events={};for(by in bw){for(bx=0,e=bw[by].length;bx<e;bx++){b.event.add(bv,by+(bw[by][bx].namespace?".":"")+bw[by][bx].namespace,bw[by][bx],bw[by][bx].data)}}}if(bz.data){bz.data=b.extend({},bz.data)}}function ai(bv,e){var bw;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bv)}bw=e.nodeName.toLowerCase();if(bw==="object"){e.outerHTML=bv.outerHTML}else{if(bw==="input"&&(bv.type==="checkbox"||bv.type==="radio")){if(bv.checked){e.defaultChecked=e.checked=bv.checked}if(e.value!==bv.value){e.value=bv.value}}else{if(bw==="option"){e.selected=bv.defaultSelected}else{if(bw==="input"||bw==="textarea"){e.defaultValue=bv.defaultValue}}}}e.removeAttribute(b.expando)}b.buildFragment=function(bz,bx,bv){var by,e,bw,bA,bB=bz[0];if(bx&&bx[0]){bA=bx[0].ownerDocument||bx[0]}if(!bA.createDocumentFragment){bA=av}if(bz.length===1&&typeof bB==="string"&&bB.length<512&&bA===av&&bB.charAt(0)==="<"&&!O.test(bB)&&(b.support.checkClone||!o.test(bB))&&(b.support.html5Clone||!ah.test(bB))){e=true;bw=b.fragments[bB];if(bw&&bw!==1){by=bw}}if(!by){by=bA.createDocumentFragment();b.clean(bz,bA,by,bv)}if(e){b.fragments[bB]=bw?by:1}return{fragment:by,cacheable:e}};b.fragments={};b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bv){b.fn[e]=function(bw){var bz=[],bC=b(bw),bB=this.length===1&&this[0].parentNode;if(bB&&bB.nodeType===11&&bB.childNodes.length===1&&bC.length===1){bC[bv](this[0]);return this}else{for(var bA=0,bx=bC.length;bA<bx;bA++){var by=(bA>0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1></$2>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]==="<table>"&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB<bG;bB++){E(bz[bB])}}else{E(bz)}}if(bz.nodeType){bI.push(bz)}else{bI=b.merge(bI,bz)}}if(bH){bF=function(bL){return !bL.type||bm.test(bL.type)};for(bE=0;bI[bE];bE++){if(bA&&b.nodeName(bI[bE],"script")&&(!bI[bE].type||bI[bE].type.toLowerCase()==="text/javascript")){bA.push(bI[bE].parentNode?bI[bE].parentNode.removeChild(bI[bE]):bI[bE])}else{if(bI[bE].nodeType===1){var bJ=b.grep(bI[bE].getElementsByTagName("script"),bF);bI.splice.apply(bI,[bE+1,0].concat(bJ))}bH.appendChild(bI[bE])}}}return bI},cleanData:function(bv){var by,bw,e=b.cache,bB=b.event.special,bA=b.support.deleteExpando;for(var bz=0,bx;(bx=bv[bz])!=null;bz++){if(bx.nodeName&&b.noData[bx.nodeName.toLowerCase()]){continue}bw=bx[b.expando];if(bw){by=e[bw];if(by&&by.events){for(var bC in by.events){if(bB[bC]){b.event.remove(bx,bC)}else{b.removeEvent(bx,bC,by.handle)}}if(by.handle){by.handle.elem=null}}if(bA){delete bx[b.expando]}else{if(bx.removeAttribute){bx.removeAttribute(b.expando)}}delete e[bw]}}}});function bo(e,bv){if(bv.src){b.ajax({url:bv.src,async:false,dataType:"script"})}else{b.globalEval((bv.text||bv.textContent||bv.innerHTML||"").replace(aN,"/*$0*/"))}if(bv.parentNode){bv.parentNode.removeChild(bv)}}var ak=/alpha\([^)]*\)/i,au=/opacity=([^)]*)/,z=/([A-Z]|^ms)/g,bc=/^-?\d+(?:px)?$/i,bn=/^-?\d/,I=/^([\-+])=([\-+.\de]+)/,a7={position:"absolute",visibility:"hidden",display:"block"},an=["Left","Right"],a1=["Top","Bottom"],Z,aI,aX;b.fn.css=function(e,bv){if(arguments.length===2&&bv===L){return this}return b.access(this,e,bv,true,function(bx,bw,by){return by!==L?b.style(bx,bw,by):b.css(bx,bw)})};b.extend({cssHooks:{opacity:{get:function(bw,bv){if(bv){var e=Z(bw,"opacity","opacity");return e===""?"1":e}else{return bw.style.opacity}}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(bx,bw,bD,by){if(!bx||bx.nodeType===3||bx.nodeType===8||!bx.style){return}var bB,bC,bz=b.camelCase(bw),bv=bx.style,bE=b.cssHooks[bz];bw=b.cssProps[bz]||bz;if(bD!==L){bC=typeof bD;if(bC==="string"&&(bB=I.exec(bD))){bD=(+(bB[1]+1)*+bB[2])+parseFloat(b.css(bx,bw));bC="number"}if(bD==null||bC==="number"&&isNaN(bD)){return}if(bC==="number"&&!b.cssNumber[bz]){bD+="px"}if(!bE||!("set" in bE)||(bD=bE.set(bx,bD))!==L){try{bv[bw]=bD}catch(bA){}}}else{if(bE&&"get" in bE&&(bB=bE.get(bx,false,by))!==L){return bB}return bv[bw]}},css:function(by,bx,bv){var bw,e;bx=b.camelCase(bx);e=b.cssHooks[bx];bx=b.cssProps[bx]||bx;if(bx==="cssFloat"){bx="float"}if(e&&"get" in e&&(bw=e.get(by,true,bv))!==L){return bw}else{if(Z){return Z(by,bx)}}},swap:function(bx,bw,by){var e={};for(var bv in bw){e[bv]=bx.style[bv];bx.style[bv]=bw[bv]}by.call(bx);for(bv in bw){bx.style[bv]=e[bv]}}});b.curCSS=b.css;b.each(["height","width"],function(bv,e){b.cssHooks[e]={get:function(by,bx,bw){var bz;if(bx){if(by.offsetWidth!==0){return p(by,e,bw)}else{b.swap(by,a7,function(){bz=p(by,e,bw)})}return bz}},set:function(bw,bx){if(bc.test(bx)){bx=parseFloat(bx);if(bx>=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx<e;bx++){if(!bv){bA-=parseFloat(b.css(by,"padding"+bz[bx]))||0}if(bv==="margin"){bA+=parseFloat(b.css(by,bv+bz[bx]))||0}else{bA-=parseFloat(b.css(by,"border"+bz[bx]+"Width"))||0}}}return bA+"px"}bA=Z(by,bw,bw);if(bA<0||bA==null){bA=by.style[bw]||0}bA=parseFloat(bA)||0;if(bv){for(;bx<e;bx++){bA+=parseFloat(b.css(by,"padding"+bz[bx]))||0;if(bv!=="padding"){bA+=parseFloat(b.css(by,"border"+bz[bx]+"Width"))||0}if(bv==="margin"){bA+=parseFloat(b.css(by,bv+bz[bx]))||0}}}return bA+"px"}if(b.expr&&b.expr.filters){b.expr.filters.hidden=function(bw){var bv=bw.offsetWidth,e=bw.offsetHeight;return(bv===0&&e===0)||(!b.support.reliableHiddenOffsets&&((bw.style&&bw.style.display)||b.css(bw,"display"))==="none")};b.expr.filters.visible=function(e){return !b.expr.filters.hidden(e)}}var k=/%20/g,ap=/\[\]$/,bs=/\r?\n/g,bq=/#.*$/,aD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,aZ=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aM=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,aQ=/^(?:GET|HEAD)$/,c=/^\/\//,M=/\?/,a6=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw<bz;bw++){bv=bx[bw];bC=/^\+/.test(bv);if(bC){bv=bv.substr(1)||"*"}bB=e[bv]=e[bv]||[];bB[bC?"unshift":"push"](bA)}}}}function aW(bv,bE,bz,bD,bB,bx){bB=bB||bE.dataTypes[0];bx=bx||{};bx[bB]=true;var bA=bv[bB],bw=0,e=bA?bA.length:0,by=(bv===aa),bC;for(;bw<e&&(by||!bC);bw++){bC=bA[bw](bE,bz,bD);if(typeof bC==="string"){if(!by||bx[bC]){bC=L}else{bE.dataTypes.unshift(bC);bC=aW(bv,bE,bz,bD,bC,bx)}}}if((by||!bC)&&!bx["*"]){bC=aW(bv,bE,bz,bD,"*",bx)}return bC}function am(bw,bx){var bv,e,by=b.ajaxSettings.flatOptions||{};for(bv in bx){if(bx[bv]!==L){(by[bv]?bw:(e||(e={})))[bv]=bx[bv]}}if(e){b.extend(true,bw,e)}}b.fn.extend({load:function(bw,bz,bA){if(typeof bw!=="string"&&A){return A.apply(this,arguments)}else{if(!this.length){return this}}var by=bw.indexOf(" ");if(by>=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("<div>").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA<bw;bA++){if(bA===1){for(bE in bH.converters){if(typeof bE==="string"){bG[bE.toLowerCase()]=bH.converters[bE]}}}bx=bC;bC=bD[bA];if(bC==="*"){bC=bx}else{if(bx!=="*"&&bx!==bC){by=bx+" "+bC;bF=bG[by]||bG["* "+bC];if(!bF){e=L;for(bv in bG){bB=bv.split(" ");if(bB[0]===bx||bB[0]==="*"){e=bG[bB[1]+" "+bC];if(e){bv=bG[bv];if(bv===true){bF=e}else{if(e===true){bF=bv}}break}}}}if(!(bF||e)){b.error("No conversion from "+by.replace(" "," to "))}if(bF!==true){bz=bF?bF(bz):e(bv(bz))}}}}return bz}var aC=b.now(),u=/(\=)\?(&|$)|\?\?/i;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return b.expando+"_"+(aC++)}});b.ajaxPrefilter("json jsonp",function(bD,bA,bC){var bx=bD.contentType==="application/x-www-form-urlencoded"&&(typeof bD.data==="string");if(bD.dataTypes[0]==="jsonp"||bD.jsonp!==false&&(u.test(bD.url)||bx&&u.test(bD.data))){var bB,bw=bD.jsonpCallback=b.isFunction(bD.jsonpCallback)?bD.jsonpCallback():bD.jsonpCallback,bz=bb[bw],e=bD.url,by=bD.data,bv="$1"+bw+"$2";if(bD.jsonp!==false){e=e.replace(u,bv);if(bD.url===e){if(bx){by=by.replace(u,bv)}if(bD.data===by){e+=(/\?/.test(e)?"&":"?")+bD.jsonp+"="+bw}}}bD.url=e;bD.data=by;bb[bw]=function(bE){bB=[bE]};bC.always(function(){bb[bw]=bz;if(bB&&b.isFunction(bz)){bb[bw](bB[0])}});bD.converters["script json"]=function(){if(!bB){b.error(bw+" was not called")}return bB[0]};bD.dataTypes[0]="json";return"script"}});b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){b.globalEval(e);return e}}});b.ajaxPrefilter("script",function(e){if(e.cache===L){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});b.ajaxTransport("script",function(bw){if(bw.crossDomain){var e,bv=av.head||av.getElementsByTagName("head")[0]||av.documentElement;return{send:function(bx,by){e=av.createElement("script");e.async="async";if(bw.scriptCharset){e.charset=bw.scriptCharset}e.src=bw.url;e.onload=e.onreadystatechange=function(bA,bz){if(bz||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bv&&e.parentNode){bv.removeChild(e)}e=L;if(!bz){by(200,"success")}}};bv.insertBefore(e,bv.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var B=bb.ActiveXObject?function(){for(var e in N){N[e](0,1)}}:false,y=0,N;function aL(){try{return new bb.XMLHttpRequest()}catch(bv){}}function aj(){try{return new bb.ActiveXObject("Microsoft.XMLHTTP")}catch(bv){}}b.ajaxSettings.xhr=bb.ActiveXObject?function(){return !this.isLocal&&aL()||aj()}:aL;(function(e){b.extend(b.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(b.ajaxSettings.xhr());if(b.support.ajax){b.ajaxTransport(function(e){if(!e.crossDomain||b.support.cors){var bv;return{send:function(bB,bw){var bA=e.xhr(),bz,by;if(e.username){bA.open(e.type,e.url,e.async,e.username,e.password)}else{bA.open(e.type,e.url,e.async)}if(e.xhrFields){for(by in e.xhrFields){bA[by]=e.xhrFields[by]}}if(e.mimeType&&bA.overrideMimeType){bA.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!bB["X-Requested-With"]){bB["X-Requested-With"]="XMLHttpRequest"}try{for(by in bB){bA.setRequestHeader(by,bB[by])}}catch(bx){}bA.send((e.hasContent&&e.data)||null);bv=function(bK,bE){var bF,bD,bC,bI,bH;try{if(bv&&(bE||bA.readyState===4)){bv=L;if(bz){bA.onreadystatechange=b.noop;if(B){delete N[bz]}}if(bE){if(bA.readyState!==4){bA.abort()}}else{bF=bA.status;bC=bA.getAllResponseHeaders();bI={};bH=bA.responseXML;if(bH&&bH.documentElement){bI.xml=bH}bI.text=bA.responseText;try{bD=bA.statusText}catch(bJ){bD=""}if(!bF&&e.isLocal&&!e.crossDomain){bF=bI.text?200:404}else{if(bF===1223){bF=204}}}}}catch(bG){if(!bE){bw(-1,bG)}}if(bI){bw(bF,bD,bI,bC)}};if(!e.async||bA.readyState===4){bv()}else{bz=++y;if(B){if(!N){N={};b(bb).unload(B)}N[bz]=bv}bA.onreadystatechange=bv}},abort:function(){if(bv){bv(0,1)}}}}})}var Q={},a8,m,aB=/^(?:toggle|show|hide)$/,aT=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,a3,aH=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],a4;b.fn.extend({show:function(bx,bA,bz){var bw,by;if(bx||bx===0){return this.animate(a0("show",3),bx,bA,bz)}else{for(var bv=0,e=this.length;bv<e;bv++){bw=this[bv];if(bw.style){by=bw.style.display;if(!b._data(bw,"olddisplay")&&by==="none"){by=bw.style.display=""}if(by===""&&b.css(bw,"display")==="none"){b._data(bw,"olddisplay",x(bw.nodeName))}}}for(bv=0;bv<e;bv++){bw=this[bv];if(bw.style){by=bw.style.display;if(by===""||by==="none"){bw.style.display=b._data(bw,"olddisplay")||""}}}return this}},hide:function(bx,bA,bz){if(bx||bx===0){return this.animate(a0("hide",3),bx,bA,bz)}else{var bw,by,bv=0,e=this.length;for(;bv<e;bv++){bw=this[bv];if(bw.style){by=b.css(bw,"display");if(by!=="none"&&!b._data(bw,"olddisplay")){b._data(bw,"olddisplay",by)}}}for(bv=0;bv<e;bv++){if(this[bv].style){this[bv].style.display="none"}}return this}},_toggle:b.fn.toggle,toggle:function(bw,bv,bx){var e=typeof bw==="boolean";if(b.isFunction(bw)&&b.isFunction(bv)){this._toggle.apply(this,arguments)}else{if(bw==null||e){this.each(function(){var by=e?bw:b(this).is(":hidden");b(this)[by?"show":"hide"]()})}else{this.animate(a0("toggle",3),bw,bv,bx)}}return this},fadeTo:function(e,bx,bw,bv){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:bx},e,bw,bv)},animate:function(bz,bw,by,bx){var e=b.speed(bw,by,bx);if(b.isEmptyObject(bz)){return this.each(e.complete,[false])}bz=b.extend({},bz);function bv(){if(e.queue===false){b._mark(this)}var bE=b.extend({},e),bK=this.nodeType===1,bI=bK&&b(this).is(":hidden"),bB,bF,bD,bJ,bH,bC,bG,bL,bA;bE.animatedProperties={};for(bD in bz){bB=b.camelCase(bD);if(bD!==bB){bz[bB]=bz[bD];delete bz[bD]}bF=bz[bB];if(b.isArray(bF)){bE.animatedProperties[bB]=bF[1];bF=bz[bB]=bF[0]}else{bE.animatedProperties[bB]=bE.specialEasing&&bE.specialEasing[bB]||bE.easing||"swing"}if(bF==="hide"&&bI||bF==="show"&&!bI){return bE.complete.call(this)}if(bK&&(bB==="height"||bB==="width")){bE.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(b.css(this,"display")==="inline"&&b.css(this,"float")==="none"){if(!b.support.inlineBlockNeedsLayout||x(this.nodeName)==="inline"){this.style.display="inline-block"}else{this.style.zoom=1}}}}if(bE.overflow!=null){this.style.overflow="hidden"}for(bD in bz){bJ=new b.fx(this,bE,bD);bF=bz[bD];if(aB.test(bF)){bA=b._data(this,"toggle"+bD)||(bF==="toggle"?bI?"show":"hide":0);if(bA){b._data(this,"toggle"+bD,bA==="show"?"hide":"show");bJ[bA]()}else{bJ[bF]()}}else{bH=aT.exec(bF);bC=bJ.cur();if(bH){bG=parseFloat(bH[2]);bL=bH[3]||(b.cssNumber[bD]?"":"px");if(bL!=="px"){b.style(this,bD,(bG||1)+bL);bC=((bG||1)/bJ.cur())*bC;b.style(this,bD,bC+bL)}if(bH[1]){bG=((bH[1]==="-="?-1:1)*bG)+bC}bJ.custom(bC,bG,bL)}else{bJ.custom(bC,bF,"")}}}return true}return e.queue===false?this.each(bv):this.queue(e.queue,bv)},stop:function(bw,bv,e){if(typeof bw!=="string"){e=bv;bv=bw;bw=L}if(bv&&bw!==false){this.queue(bw||"fx",[])}return this.each(function(){var bx,by=false,bA=b.timers,bz=b._data(this);if(!e){b._unmark(true,this)}function bB(bE,bF,bD){var bC=bF[bD];b.removeData(bE,bD,true);bC.stop(e)}if(bw==null){for(bx in bz){if(bz[bx]&&bz[bx].stop&&bx.indexOf(".run")===bx.length-4){bB(this,bz,bx)}}}else{if(bz[bx=bw+".run"]&&bz[bx].stop){bB(this,bz,bx)}}for(bx=bA.length;bx--;){if(bA[bx].elem===this&&(bw==null||bA[bx].queue===bw)){if(e){bA[bx](true)}else{bA[bx].saveState()}by=true;bA.splice(bx,1)}}if(!(e&&by)){b.dequeue(this,bw)}})}});function bh(){setTimeout(at,0);return(a4=b.now())}function at(){a4=L}function a0(bv,e){var bw={};b.each(aH.concat.apply([],aH.slice(0,e)),function(){bw[this]=bv});return bw}b.each({slideDown:a0("show",1),slideUp:a0("hide",1),slideToggle:a0("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bv){b.fn[e]=function(bw,by,bx){return this.animate(bv,bw,by,bx)}});b.extend({speed:function(bw,bx,bv){var e=bw&&typeof bw==="object"?b.extend({},bw):{complete:bv||!bv&&bx||b.isFunction(bw)&&bw,duration:bw,easing:bv&&bx||bx&&!b.isFunction(bx)&&bx};e.duration=b.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in b.fx.speeds?b.fx.speeds[e.duration]:b.fx.speeds._default;if(e.queue==null||e.queue===true){e.queue="fx"}e.old=e.complete;e.complete=function(by){if(b.isFunction(e.old)){e.old.call(this)}if(e.queue){b.dequeue(this,e.queue)}else{if(by!==false){b._unmark(this)}}};return e},easing:{linear:function(bw,bx,e,bv){return e+bv*bw},swing:function(bw,bx,e,bv){return((-Math.cos(bw*Math.PI)/2)+0.5)*bv+e}},timers:[],fx:function(bv,e,bw){this.options=e;this.elem=bv;this.prop=bw;e.orig=e.orig||{}}});b.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(b.fx.step[this.prop]||b.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e,bv=b.css(this.elem,this.prop);return isNaN(e=parseFloat(bv))?!bv||bv==="auto"?0:bv:e},custom:function(bz,by,bx){var e=this,bw=b.fx;this.startTime=a4||bh();this.end=by;this.now=this.start=bz;this.pos=this.state=0;this.unit=bx||this.unit||(b.cssNumber[this.prop]?"":"px");function bv(bA){return e.step(bA)}bv.queue=this.options.queue;bv.elem=this.elem;bv.saveState=function(){if(e.options.hide&&b._data(e.elem,"fxshow"+e.prop)===L){b._data(e.elem,"fxshow"+e.prop,e.start)}};if(bv()&&b.timers.push(bv)&&!a3){a3=setInterval(bw.tick,bw.interval)}},show:function(){var e=b._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=e||b.style(this.elem,this.prop);this.options.show=true;if(e!==L){this.custom(this.cur(),e)}else{this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur())}b(this.elem).show()},hide:function(){this.options.orig[this.prop]=b._data(this.elem,"fxshow"+this.prop)||b.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(by){var bA,bB,bv,bx=a4||bh(),e=true,bz=this.elem,bw=this.options;if(by||bx>=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e<bv.length;e++){bw=bv[e];if(!bw()&&bv[e]===bw){bv.splice(e--,1)}}if(!bv.length){b.fx.stop()}},interval:13,stop:function(){clearInterval(a3);a3=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){b.style(e.elem,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=e.now+e.unit}else{e.elem[e.prop]=e.now}}}});b.each(["width","height"],function(e,bv){b.fx.step[bv]=function(bw){b.style(bw.elem,bv,Math.max(0,bw.now)+bw.unit)}});if(b.expr&&b.expr.filters){b.expr.filters.animated=function(e){return b.grep(b.timers,function(bv){return e===bv.elem}).length}}function x(bx){if(!Q[bx]){var e=av.body,bv=b("<"+bx+">").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! * jQuery UI 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h<j.length;h++){if(e.options[j[h][0]]){j[h][1].apply(e.element,f)}}}},contains:function(f,e){return document.compareDocumentPosition?f.compareDocumentPosition(e)&16:f!==e&&f.contains(e)},hasScroll:function(h,f){if(a(h).css("overflow")==="hidden"){return false}var e=(f&&f==="left")?"scrollLeft":"scrollTop",g=false;if(h[e]>0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! * jQuery UI Widget 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Widget */ (function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! * jQuery UI Mouse 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Mouse * * Depends: * jquery.ui.widget.js */ (function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g<l.length;g++){var j=c.trim(l[g]),e="ui-resizable-"+j;var h=c('<div class="ui-resizable-handle '+e+'"></div>');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(h<e.maxWidth){e.maxWidth=h}if(k<e.maxHeight){e.maxHeight=k}}this._vBoundaries=e},_updateCache:function(e){var f=this.options;this.offset=this.helper.offset();if(a(e.left)){this.position.left=e.left}if(a(e.top)){this.position.top=e.top}if(a(e.height)){this.size.height=e.height}if(a(e.width)){this.size.width=e.width}},_updateRatio:function(h,g){var i=this.options,j=this.position,f=this.size,e=this.axis;if(a(h.height)){h.width=(h.height*this.aspectRatio)}else{if(a(h.width)){h.height=(h.width/this.aspectRatio)}}if(e=="sw"){h.left=j.left+(f.width-h.width);h.top=null}if(e=="nw"){h.top=j.top+(f.height-h.height);h.left=j.left+(f.width-h.width)}return h},_respectSize:function(l,g){var j=this.helper,i=this._vBoundaries,r=this._aspectRatio||g.shiftKey,q=this.axis,t=a(l.width)&&i.maxWidth&&(i.maxWidth<l.width),m=a(l.height)&&i.maxHeight&&(i.maxHeight<l.height),h=a(l.width)&&i.minWidth&&(i.minWidth>l.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f<this._proportionallyResizeElements.length;f++){var h=this._proportionallyResizeElements[f];if(!this.borderDif){var e=[h.css("borderTopWidth"),h.css("borderRightWidth"),h.css("borderBottomWidth"),h.css("borderLeftWidth")],j=[h.css("paddingTop"),h.css("paddingRight"),h.css("paddingBottom"),h.css("paddingLeft")];this.borderDif=c.map(e,function(l,n){var m=parseInt(l,10)||0,o=parseInt(j[n],10)||0;return m+o})}if(c.browser.msie&&!(!(c(g).is(":hidden")||c(g).parents(":hidden").length))){continue}h.css({height:(g.height()-this.borderDif[0]-this.borderDif[2])||0,width:(g.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var f=this.element,i=this.options;this.elementOffset=f.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! * jQuery hashchange event - v1.3 - 7/21/2010 * http://benalman.com/projects/jquery-hashchange-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);/*! PowerTip - v1.2.0 - 2013-04-03 http://stevenbenner.github.com/jquery-powertip/ Copyright (c) 2013 Steven Benner (http://stevenbenner.com/). Released under MIT license. https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt */ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(k){var A=k(document),s=k(window),w=k("body");var n="displayController",e="hasActiveHover",d="forcedOpen",u="hasMouseMove",f="mouseOnToPopup",g="originalTitle",y="powertip",o="powertipjq",l="powertiptarget",E=180/Math.PI;var c={isTipOpen:false,isFixedTipOpen:false,isClosing:false,tipOpenImminent:false,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,mouseTrackingActive:false,delayInProgress:false,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0};var p={none:0,top:1,bottom:2,left:4,right:8};k.fn.powerTip=function(F,N){if(!this.length){return this}if(k.type(F)==="string"&&k.powerTip[F]){return k.powerTip[F].call(this,this,N)}var O=k.extend({},k.fn.powerTip.defaults,F),G=new x(O);h();this.each(function M(){var R=k(this),Q=R.data(y),P=R.data(o),T=R.data(l),S;if(R.data(n)){k.powerTip.destroy(R)}S=R.attr("title");if(!Q&&!T&&!P&&S){R.data(y,S);R.data(g,S);R.removeAttr("title")}R.data(n,new t(R,O,G))});if(!O.manual){this.on({"mouseenter.powertip":function J(P){k.powerTip.show(this,P)},"mouseleave.powertip":function L(){k.powerTip.hide(this)},"focus.powertip":function K(){k.powerTip.show(this)},"blur.powertip":function H(){k.powerTip.hide(this,true)},"keydown.powertip":function I(P){if(P.keyCode===27){k.powerTip.hide(this,true)}}})}return this};k.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false};k.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};k.powerTip={show:function z(F,G){if(G){i(G);c.previousX=G.pageX;c.previousY=G.pageY;k(F).data(n).show()}else{k(F).first().data(n).show(true,true)}return F},reposition:function r(F){k(F).first().data(n).resetPosition();return F},hide:function D(G,F){if(G){k(G).first().data(n).hide(F)}else{if(c.activeHover){c.activeHover.data(n).hide(true)}}return G},destroy:function C(G){k(G).off(".powertip").each(function F(){var I=k(this),H=[g,n,e,d];if(I.data(g)){I.attr("title",I.data(g));H.push(y)}I.removeData(H)});return G}};k.powerTip.showTip=k.powerTip.show;k.powerTip.closeTip=k.powerTip.hide;function b(){var F=this;F.top="auto";F.left="auto";F.right="auto";F.bottom="auto";F.set=function(H,G){if(k.isNumeric(G)){F[H]=Math.round(G)}}}function t(K,N,F){var J=null;function L(P,Q){M();if(!K.data(e)){if(!P){c.tipOpenImminent=true;J=setTimeout(function O(){J=null;I()},N.intentPollInterval)}else{if(Q){K.data(d,true)}F.showTip(K)}}}function G(P){M();c.tipOpenImminent=false;if(K.data(e)){K.data(d,false);if(!P){c.delayInProgress=true;J=setTimeout(function O(){J=null;F.hideTip(K);c.delayInProgress=false},N.closeDelay)}else{F.hideTip(K)}}}function I(){var Q=Math.abs(c.previousX-c.currentX),O=Math.abs(c.previousY-c.currentY),P=Q+O;if(P<N.intentSensitivity){F.showTip(K)}else{c.previousX=c.currentX;c.previousY=c.currentY;L()}}function M(){J=clearTimeout(J);c.delayInProgress=false}function H(){F.resetPosition(K)}this.show=L;this.hide=G;this.cancel=M;this.resetPosition=H}function j(){function G(M,L,J,O,P){var K=L.split("-")[0],N=new b(),I;if(q(M)){I=H(M,K)}else{I=F(M,K)}switch(L){case"n":N.set("left",I.left-(J/2));N.set("bottom",c.windowHeight-I.top+P);break;case"e":N.set("left",I.left+P);N.set("top",I.top-(O/2));break;case"s":N.set("left",I.left-(J/2));N.set("top",I.top+P);break;case"w":N.set("top",I.top-(O/2));N.set("right",c.windowWidth-I.left+P);break;case"nw":N.set("bottom",c.windowHeight-I.top+P);N.set("right",c.windowWidth-I.left-20);break;case"nw-alt":N.set("left",I.left);N.set("bottom",c.windowHeight-I.top+P);break;case"ne":N.set("left",I.left-20);N.set("bottom",c.windowHeight-I.top+P);break;case"ne-alt":N.set("bottom",c.windowHeight-I.top+P);N.set("right",c.windowWidth-I.left);break;case"sw":N.set("top",I.top+P);N.set("right",c.windowWidth-I.left-20);break;case"sw-alt":N.set("left",I.left);N.set("top",I.top+P);break;case"se":N.set("left",I.left-20);N.set("top",I.top+P);break;case"se-alt":N.set("top",I.top+P);N.set("right",c.windowWidth-I.left);break}return N}function F(K,J){var O=K.offset(),N=K.outerWidth(),I=K.outerHeight(),M,L;switch(J){case"n":M=O.left+N/2;L=O.top;break;case"e":M=O.left+N;L=O.top+I/2;break;case"s":M=O.left+N/2;L=O.top+I;break;case"w":M=O.left;L=O.top+I/2;break;case"nw":M=O.left;L=O.top;break;case"ne":M=O.left+N;L=O.top;break;case"sw":M=O.left;L=O.top+I;break;case"se":M=O.left+N;L=O.top+I;break}return{top:L,left:M}}function H(O,K){var S=O.closest("svg")[0],N=O[0],W=S.createSVGPoint(),L=N.getBBox(),V=N.getScreenCTM(),M=L.width/2,Q=L.height/2,P=[],I=["nw","n","ne","e","se","s","sw","w"],U,X,R,T;function J(){P.push(W.matrixTransform(V))}W.x=L.x;W.y=L.y;J();W.x+=M;J();W.x+=M;J();W.y+=Q;J();W.y+=Q;J();W.x-=M;J();W.x-=M;J();W.y-=Q;J();if(P[0].y!==P[1].y||P[0].x!==P[7].x){X=Math.atan2(V.b,V.a)*E;R=Math.ceil(((X%360)-22.5)/45);if(R<1){R+=8}while(R--){I.push(I.shift())}}for(T=0;T<P.length;T++){if(I[T]===K){U=P[T];break}}return{top:U.y+c.scrollTop,left:U.x+c.scrollLeft}}this.compute=G}function x(Q){var P=new j(),O=k("#"+Q.popupId);if(O.length===0){O=k("<div/>",{id:Q.popupId});if(w.length===0){w=k("body")}w.append(O)}if(Q.followMouse){if(!O.data(u)){A.on("mousemove",M);s.on("scroll",M);O.data(u,true)}}if(Q.mouseOnToPopup){O.on({mouseenter:function L(){if(O.data(f)){if(c.activeHover){c.activeHover.data(n).cancel()}}},mouseleave:function N(){if(c.activeHover){c.activeHover.data(n).hide()}}})}function I(S){S.data(e,true);O.queue(function R(T){H(S);T()})}function H(S){var U;if(!S.data(e)){return}if(c.isTipOpen){if(!c.isClosing){K(c.activeHover)}O.delay(100).queue(function R(V){H(S);V()});return}S.trigger("powerTipPreRender");U=B(S);if(U){O.empty().append(U)}else{return}S.trigger("powerTipRender");c.activeHover=S;c.isTipOpen=true;O.data(f,Q.mouseOnToPopup);if(!Q.followMouse){G(S);c.isFixedTipOpen=true}else{M()}O.fadeIn(Q.fadeInTime,function T(){if(!c.desyncTimeout){c.desyncTimeout=setInterval(J,500)}S.trigger("powerTipOpen")})}function K(R){c.isClosing=true;c.activeHover=null;c.isTipOpen=false;c.desyncTimeout=clearInterval(c.desyncTimeout);R.data(e,false);R.data(d,false);O.fadeOut(Q.fadeOutTime,function S(){var T=new b();c.isClosing=false;c.isFixedTipOpen=false;O.removeClass();T.set("top",c.currentY+Q.offset);T.set("left",c.currentX+Q.offset);O.css(T);R.trigger("powerTipClose")})}function M(){if(!c.isFixedTipOpen&&(c.isTipOpen||(c.tipOpenImminent&&O.data(u)))){var R=O.outerWidth(),V=O.outerHeight(),U=new b(),S,T;U.set("top",c.currentY+Q.offset);U.set("left",c.currentX+Q.offset);S=m(U,R,V);if(S!==p.none){T=a(S);if(T===1){if(S===p.right){U.set("left",c.windowWidth-R)}else{if(S===p.bottom){U.set("top",c.scrollTop+c.windowHeight-V)}}}else{U.set("left",c.currentX-R-Q.offset);U.set("top",c.currentY-V-Q.offset)}}O.css(U)}}function G(S){var R,T;if(Q.smartPlacement){R=k.fn.powerTip.smartPlacementLists[Q.placement];k.each(R,function(U,W){var V=m(F(S,W),O.outerWidth(),O.outerHeight());T=W;if(V===p.none){return false}})}else{F(S,Q.placement);T=Q.placement}O.addClass(T)}function F(U,T){var R=0,S,W,V=new b();V.set("top",0);V.set("left",0);O.css(V);do{S=O.outerWidth();W=O.outerHeight();V=P.compute(U,T,S,W,Q.offset);O.css(V)}while(++R<=5&&(S!==O.outerWidth()||W!==O.outerHeight()));return V}function J(){var R=false;if(c.isTipOpen&&!c.isClosing&&!c.delayInProgress){if(c.activeHover.data(e)===false||c.activeHover.is(":disabled")){R=true}else{if(!v(c.activeHover)&&!c.activeHover.is(":focus")&&!c.activeHover.data(d)){if(O.data(f)){if(!v(O)){R=true}}else{R=true}}}if(R){K(c.activeHover)}}}this.showTip=I;this.hideTip=K;this.resetPosition=G}function q(F){return window.SVGElement&&F[0] instanceof SVGElement}function h(){if(!c.mouseTrackingActive){c.mouseTrackingActive=true;k(function H(){c.scrollLeft=s.scrollLeft();c.scrollTop=s.scrollTop();c.windowWidth=s.width();c.windowHeight=s.height()});A.on("mousemove",i);s.on({resize:function G(){c.windowWidth=s.width();c.windowHeight=s.height()},scroll:function F(){var I=s.scrollLeft(),J=s.scrollTop();if(I!==c.scrollLeft){c.currentX+=I-c.scrollLeft;c.scrollLeft=I}if(J!==c.scrollTop){c.currentY+=J-c.scrollTop;c.scrollTop=J}}})}}function i(F){c.currentX=F.pageX;c.currentY=F.pageY}function v(F){var H=F.offset(),J=F[0].getBoundingClientRect(),I=J.right-J.left,G=J.bottom-J.top;return c.currentX>=H.left&&c.currentX<=H.left+I&&c.currentY>=H.top&&c.currentY<=H.top+G}function B(I){var G=I.data(y),F=I.data(o),K=I.data(l),H,J;if(G){if(k.isFunction(G)){G=G.call(I[0])}J=G}else{if(F){if(k.isFunction(F)){F=F.call(I[0])}if(F.length>0){J=F.clone(true,true)}}else{if(K){H=k("#"+K);if(H.length>0){J=H.html()}}}}return J}function m(M,L,K){var G=c.scrollTop,J=c.scrollLeft,I=G+c.windowHeight,F=J+c.windowWidth,H=p.none;if(M.top<G||Math.abs(M.bottom-c.windowHeight)-K<G){H|=p.top}if(M.top+K>I||Math.abs(M.bottom-c.windowHeight)>I){H|=p.bottom}if(M.left<J||M.right+L>F){H|=p.left}if(M.left+L>F||M.right<J){H|=p.right}return H}function a(G){var F=0;while(G){G&=G-1;F++}return F}}));
app/static/js/dependencies/jquery.min.js
bachvtuan/send-email-by-using-django-celery
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license */ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
src/components/Header/Header.js
tablackmore/viaplay-fullstack-es6
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import React, { Component } from 'react'; class Header extends Component { render() { return ( <div className="block page-header"> <div className="scaffold"> <div className="logo"> <a href="/" data-href> <img src="http://assets.viaplay.tv/frontend-2015113001/images/header-logo-large.png" alt="Viaplay Start" width={144} height={35} /> </a> <button className="toggle-navigation" /> <button className="toggle-user" /> </div> <nav className="sections"> <a href="/serier" data-href="https://content.viaplay.se/pcdash-se/serier">Serier</a> <a href="/film" data-href="https://content.viaplay.se/pcdash-se/film">Film</a> <a href="/sport" data-href="https://content.viaplay.se/pcdash-se/sport">Sport</a> <a href="/barn" data-href="https://content.viaplay.se/pcdash-se/barn">Barn</a> <a href="/hyrbutik" data-href="https://content.viaplay.se/pcdash-se/hyrbutik">Hyrbutik</a> </nav> <div className="user" data-logout-href data-login-href data-persistent-login-href data-user-id /> </div> </div> ); } } export default Header;
ajax/libs/yui/3.14.1/datatable-body/datatable-body.js
htmlstrap/cdnjs
YUI.add('datatable-body', function (Y, NAME) { /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. @module datatable @submodule datatable-body @since 3.5.0 **/ var Lang = Y.Lang, isArray = Lang.isArray, isNumber = Lang.isNumber, isString = Lang.isString, fromTemplate = Lang.sub, htmlEscape = Y.Escape.html, toArray = Y.Array, bind = Y.bind, YObject = Y.Object, valueRegExp = /\{value\}/g, EV_CONTENT_UPDATE = 'contentUpdate'; /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. Translates the provided `modelList` into a rendered `<tbody>` based on the data in the constituent Models, altered or amended by any special column configurations. The `columns` configuration, passed to the constructor, determines which columns will be rendered. The rendering process involves constructing an HTML template for a complete row of data, built by concatenating a customized copy of the instance's `CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is then populated with values from each Model in the `modelList`, aggregating a complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. A column `formatter` can be: * a function, as described below. * a string which can be: * the name of a pre-defined formatter function which can be located in the `Y.DataTable.BodyView.Formatters` hash using the value of the `formatter` property as the index. * A template that can use the `{value}` placeholder to include the value for the current cell or the name of any field in the underlaying model also enclosed in curly braces. Any number and type of these placeholders can be used. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @class BodyView @namespace DataTable @extends View @since 3.5.0 **/ Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], { // -- Instance properties ------------------------------------------------- /** HTML template used to create table cells. @property CELL_TEMPLATE @type {HTML} @default '<td {headers} class="{className}">{content}</td>' @since 3.5.0 **/ CELL_TEMPLATE: '<td {headers} class="{className}">{content}</td>', /** CSS class applied to even rows. This is assigned at instantiation. For DataTable, this will be `yui3-datatable-even`. @property CLASS_EVEN @type {String} @default 'yui3-table-even' @since 3.5.0 **/ //CLASS_EVEN: null /** CSS class applied to odd rows. This is assigned at instantiation. When used by DataTable instances, this will be `yui3-datatable-odd`. @property CLASS_ODD @type {String} @default 'yui3-table-odd' @since 3.5.0 **/ //CLASS_ODD: null /** HTML template used to create table rows. @property ROW_TEMPLATE @type {HTML} @default '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>' @since 3.5.0 **/ ROW_TEMPLATE : '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>', /** The object that serves as the source of truth for column and row data. This property is assigned at instantiation from the `host` property of the configuration object passed to the constructor. @property host @type {Object} @default (initially unset) @since 3.5.0 **/ //TODO: should this be protected? //host: null, /** HTML templates used to create the `<tbody>` containing the table rows. @property TBODY_TEMPLATE @type {HTML} @default '<tbody class="{className}">{content}</tbody>' @since 3.6.0 **/ TBODY_TEMPLATE: '<tbody class="{className}"></tbody>', // -- Public methods ------------------------------------------------------ /** Returns the `<td>` Node from the given row and column index. Alternately, the `seed` can be a Node. If so, the nearest ancestor cell is returned. If the `seed` is a cell, it is returned. If there is no cell at the given coordinates, `null` is returned. Optionally, include an offset array or string to return a cell near the cell identified by the `seed`. The offset can be an array containing the number of rows to shift followed by the number of columns to shift, or one of "above", "below", "next", or "previous". <pre><code>// Previous cell in the previous row var cell = table.getCell(e.target, [-1, -1]); // Next cell var cell = table.getCell(e.target, 'next'); var cell = table.getCell(e.target, [0, 1];</pre></code> @method getCell @param {Number[]|Node} seed Array of row and column indexes, or a Node that is either the cell itself or a descendant of one. @param {Number[]|String} [shift] Offset by which to identify the returned cell Node @return {Node} @since 3.5.0 **/ getCell: function (seed, shift) { var tbody = this.tbodyNode, row, cell, index, rowIndexOffset; if (seed && tbody) { if (isArray(seed)) { row = tbody.get('children').item(seed[0]); cell = row && row.get('children').item(seed[1]); } else if (Y.instanceOf(seed, Y.Node)) { cell = seed.ancestor('.' + this.getClassName('cell'), true); } if (cell && shift) { rowIndexOffset = tbody.get('firstChild.rowIndex'); if (isString(shift)) { // TODO this should be a static object map switch (shift) { case 'above' : shift = [-1, 0]; break; case 'below' : shift = [1, 0]; break; case 'next' : shift = [0, 1]; break; case 'previous': shift = [0, -1]; break; } } if (isArray(shift)) { index = cell.get('parentNode.rowIndex') + shift[0] - rowIndexOffset; row = tbody.get('children').item(index); index = cell.get('cellIndex') + shift[1]; cell = row && row.get('children').item(index); } } } return cell || null; }, /** Returns the generated CSS classname based on the input. If the `host` attribute is configured, it will attempt to relay to its `getClassName` or use its static `NAME` property as a string base. If `host` is absent or has neither method nor `NAME`, a CSS classname will be generated using this class's `NAME`. @method getClassName @param {String} token* Any number of token strings to assemble the classname from. @return {String} @protected @since 3.5.0 **/ getClassName: function () { var host = this.host, args; if (host && host.getClassName) { return host.getClassName.apply(host, arguments); } else { args = toArray(arguments); args.unshift(this.constructor.NAME); return Y.ClassNameManager.getClassName .apply(Y.ClassNameManager, args); } }, /** Returns the Model associated to the row Node or id provided. Passing the Node or id for a descendant of the row also works. If no Model can be found, `null` is returned. @method getRecord @param {String|Node} seed Row Node or `id`, or one for a descendant of a row @return {Model} @since 3.5.0 **/ getRecord: function (seed) { var modelList = this.get('modelList'), tbody = this.tbodyNode, row = null, record; if (tbody) { if (isString(seed)) { seed = tbody.one('#' + seed); } if (Y.instanceOf(seed, Y.Node)) { row = seed.ancestor(function (node) { return node.get('parentNode').compareTo(tbody); }, true); record = row && modelList.getByClientId(row.getData('yui3-record')); } } return record || null; }, /** Returns the `<tr>` Node from the given row index, Model, or Model's `clientId`. If the rows haven't been rendered yet, or if the row can't be found by the input, `null` is returned. @method getRow @param {Number|String|Model} id Row index, Model instance, or clientId @return {Node} @since 3.5.0 **/ getRow: function (id) { var tbody = this.tbodyNode, row = null; if (tbody) { if (id) { id = this._idMap[id.get ? id.get('clientId') : id] || id; } row = isNumber(id) ? tbody.get('children').item(id) : tbody.one('#' + id); } return row; }, /** Creates the table's `<tbody>` content by assembling markup generated by populating the `ROW\_TEMPLATE`, and `CELL\_TEMPLATE` templates with content from the `columns` and `modelList` attributes. The rendering process happens in three stages: 1. A row template is assembled from the `columns` attribute (see `_createRowTemplate`) 2. An HTML string is built up by concatenating the application of the data in each Model in the `modelList` to the row template. For cells with `formatter`s, the function is called to generate cell content. Cells with `nodeFormatter`s are ignored. For all other cells, the data value from the Model attribute for the given column key is used. The accumulated row markup is then inserted into the container. 3. If any column is configured with a `nodeFormatter`, the `modelList` is iterated again to apply the `nodeFormatter`s. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @method render @return {BodyView} The instance @chainable @since 3.5.0 **/ render: function () { var table = this.get('container'), data = this.get('modelList'), displayCols = this.get('columns'), tbody = this.tbodyNode || (this.tbodyNode = this._createTBodyNode()); // Needed for mutation this._createRowTemplate(displayCols); if (data) { tbody.setHTML(this._createDataHTML(displayCols)); this._applyNodeFormatters(tbody, displayCols); } if (tbody.get('parentNode') !== table) { table.appendChild(tbody); } this.bindUI(); return this; }, /** Refreshes the provided row against the provided model and the Array of columns to be updated. @method refreshRow @param {Y.Node} row @param {Y.Model} model Y.Model representation of the row @param {String[]} colKeys Array of column keys @chainable */ refreshRow: function (row, model, colKeys) { var col, cell, len = colKeys.length, i; for (i = 0; i < len; i++) { col = this.getColumn(colKeys[i]); if (col !== null) { cell = row.one('.' + this.getClassName('col', col._id || col.key)); this.refreshCell(cell, model); } } return this; }, /** Refreshes the given cell with the provided model data and the provided column configuration. Uses the provided column formatter if aviable. @method refreshCell @param {Y.Node} cell Y.Node pointer to the cell element to be updated @param {Y.Model} [model] Y.Model representation of the row @param {Object} [col] Column configuration object for the cell @chainable */ refreshCell: function (cell, model, col) { var content, formatterFn, formatterData, data = model.toJSON(); cell = this.getCell(cell); /* jshint -W030 */ model || (model = this.getRecord(cell)); col || (col = this.getColumn(cell)); /* jshint +W030 */ if (col.nodeFormatter) { formatterData = { cell: cell.one('.' + this.getClassName('liner')) || cell, column: col, data: data, record: model, rowIndex: this._getRowIndex(cell.ancestor('tr')), td: cell, value: data[col.key] }; keep = col.nodeFormatter.call(host,formatterData); if (keep === false) { // Remove from the Node cache to reduce // memory footprint. This also purges events, // which you shouldn't be scoping to a cell // anyway. You've been warned. Incidentally, // you should always return false. Just sayin. cell.destroy(true); } } else if (col.formatter) { if (!col._formatterFn) { col = this._setColumnsFormatterFn([col])[0]; } formatterFn = col._formatterFn || null; if (formatterFn) { formatterData = { value : data[col.key], data : data, column : col, record : model, className: '', rowClass : '', rowIndex : this._getRowIndex(cell.ancestor('tr')) }; // Formatters can either return a value ... content = formatterFn.call(this.get('host'), formatterData); // ... or update the value property of the data obj passed if (content === undefined) { content = formatterData.value; } } if (content === undefined || content === null || content === '') { content = col.emptyCellValue || ''; } } else { content = data[col.key] || col.emptyCellValue || ''; } cell.setHTML(col.allowHTML ? content : Y.Escape.html(content)); return this; }, /** Returns column data from this.get('columns'). If a Y.Node is provided as the key, will try to determine the key from the classname @method getColumn @param {String|Y.Node} name @return {Object} Returns column configuration */ getColumn: function (name) { if (Y.instanceOf(name, Y.Node)) { // get column name from node name = name.get('className').match( new RegExp( this.getClassName('col') +'-([^ ]*)' ) )[1]; } if (this.host) { return this.host._columnMap[name] || null; } var displayCols = this.get('columns'), col = null; Y.Array.some(displayCols, function (_col) { if ((_col._id || _col.key) === name) { col = _col; return true; } }); return col; }, // -- Protected and private methods --------------------------------------- /** Handles changes in the source's columns attribute. Redraws the table data. @method _afterColumnsChange @param {EventFacade} e The `columnsChange` event object @protected @since 3.5.0 **/ // TODO: Preserve existing DOM // This will involve parsing and comparing the old and new column configs // and reacting to four types of changes: // 1. formatter, nodeFormatter, emptyCellValue changes // 2. column deletions // 3. column additions // 4. column moves (preserve cells) _afterColumnsChange: function () { this.render(); }, /** Handles modelList changes, including additions, deletions, and updates. Modifies the existing table DOM accordingly. @method _afterDataChange @param {EventFacade} e The `change` event from the ModelList @protected @since 3.5.0 **/ _afterDataChange: function (e) { var type = (e.type.match(/:(add|change|remove)$/) || [])[1], index = e.index, displayCols = this.get('columns'), col, changed = e.changed && Y.Object.keys(e.changed), key, row, i, len; for (i = 0, len = displayCols.length; i < len; i++ ) { col = displayCols[i]; // since nodeFormatters typcially make changes outside of it's // cell, we need to see if there are any columns that have a // nodeFormatter and if so, we need to do a full render() of the // tbody if (col.hasOwnProperty('nodeFormatter')) { this.render(); this.fire(EV_CONTENT_UPDATE); return; } } // TODO: if multiple rows are being added/remove/swapped, can we avoid the restriping? switch (type) { case 'change': for (i = 0, len = displayCols.length; i < len; i++) { col = displayCols[i]; key = col.key; if (col.formatter && !e.changed[key]) { changed.push(key); } } this.refreshRow(this.getRow(e.target), e.target, changed); break; case 'add': // we need to make sure we don't have an index larger than the data we have index = Math.min(index, this.get('modelList').size() - 1); // updates the columns with formatter functions this._setColumnsFormatterFn(displayCols); row = Y.Node.create(this._createRowHTML(e.model, index, displayCols)); this.tbodyNode.insert(row, index); this._restripe(index); break; case 'remove': this.getRow(index).remove(true); // we removed a row, so we need to back up our index to stripe this._restripe(index - 1); break; default: this.render(); } // Event fired to tell users when we are done updating after the data // was changed this.fire(EV_CONTENT_UPDATE); }, /** Toggles the odd/even classname of the row after the given index. This method is used to update rows after a row is inserted into or removed from the table. Note this event is delayed so the table is only restriped once when multiple rows are updated at one time. @protected @method _restripe @param {Number} [index] Index of row to start restriping after @since 3.11.0 */ _restripe: function (index) { var task = this._restripeTask, self; // index|0 to force int, avoid NaN. Math.max() to avoid neg indexes. index = Math.max((index|0), 0); if (!task) { self = this; this._restripeTask = { timer: setTimeout(function () { // Check for self existence before continuing if (!self || self.get('destroy') || !self.tbodyNode || !self.tbodyNode.inDoc()) { self._restripeTask = null; return; } var odd = [self.CLASS_ODD, self.CLASS_EVEN], even = [self.CLASS_EVEN, self.CLASS_ODD], index = self._restripeTask.index; self.tbodyNode.get('childNodes') .slice(index) .each(function (row, i) { // TODO: each vs batch row.replaceClass.apply(row, (index + i) % 2 ? even : odd); }); self._restripeTask = null; }, 0), index: index }; } else { task.index = Math.min(task.index, index); } }, /** Handles replacement of the modelList. Rerenders the `<tbody>` contents. @method _afterModelListChange @param {EventFacade} e The `modelListChange` event @protected @since 3.6.0 **/ _afterModelListChange: function () { var handles = this._eventHandles; if (handles.dataChange) { handles.dataChange.detach(); delete handles.dataChange; this.bindUI(); } if (this.tbodyNode) { this.render(); } }, /** Iterates the `modelList`, and calls any `nodeFormatter`s found in the `columns` param on the appropriate cell Nodes in the `tbody`. @method _applyNodeFormatters @param {Node} tbody The `<tbody>` Node whose columns to update @param {Object[]} displayCols The column configurations @protected @since 3.5.0 **/ _applyNodeFormatters: function (tbody, displayCols) { var host = this.host || this, data = this.get('modelList'), formatters = [], linerQuery = '.' + this.getClassName('liner'), rows, i, len; // Only iterate the ModelList again if there are nodeFormatters for (i = 0, len = displayCols.length; i < len; ++i) { if (displayCols[i].nodeFormatter) { formatters.push(i); } } if (data && formatters.length) { rows = tbody.get('childNodes'); data.each(function (record, index) { var formatterData = { data : record.toJSON(), record : record, rowIndex : index }, row = rows.item(index), i, len, col, key, cells, cell, keep; if (row) { cells = row.get('childNodes'); for (i = 0, len = formatters.length; i < len; ++i) { cell = cells.item(formatters[i]); if (cell) { col = formatterData.column = displayCols[formatters[i]]; key = col.key || col.id; formatterData.value = record.get(key); formatterData.td = cell; formatterData.cell = cell.one(linerQuery) || cell; keep = col.nodeFormatter.call(host,formatterData); if (keep === false) { // Remove from the Node cache to reduce // memory footprint. This also purges events, // which you shouldn't be scoping to a cell // anyway. You've been warned. Incidentally, // you should always return false. Just sayin. cell.destroy(true); } } } } }); } }, /** Binds event subscriptions from the UI and the host (if assigned). @method bindUI @protected @since 3.5.0 **/ bindUI: function () { var handles = this._eventHandles, modelList = this.get('modelList'), changeEvent = modelList.model.NAME + ':change'; if (!handles.columnsChange) { handles.columnsChange = this.after('columnsChange', bind('_afterColumnsChange', this)); } if (modelList && !handles.dataChange) { handles.dataChange = modelList.after( ['add', 'remove', 'reset', changeEvent], bind('_afterDataChange', this)); } }, /** Iterates the `modelList` and applies each Model to the `_rowTemplate`, allowing any column `formatter` or `emptyCellValue` to override cell content for the appropriate column. The aggregated HTML string is returned. @method _createDataHTML @param {Object[]} displayCols The column configurations to customize the generated cell content or class names @return {HTML} The markup for all Models in the `modelList`, each applied to the `_rowTemplate` @protected @since 3.5.0 **/ _createDataHTML: function (displayCols) { var data = this.get('modelList'), html = ''; if (data) { data.each(function (model, index) { html += this._createRowHTML(model, index, displayCols); }, this); } return html; }, /** Applies the data of a given Model, modified by any column formatters and supplemented by other template values to the instance's `_rowTemplate` (see `_createRowTemplate`). The generated string is then returned. The data from Model's attributes is fetched by `toJSON` and this data object is appended with other properties to supply values to {placeholders} in the template. For a template generated from a Model with 'foo' and 'bar' attributes, the data object would end up with the following properties before being used to populate the `_rowTemplate`: * `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute. * `foo` - The value to populate the 'foo' column cell content. This value will be the value stored in the Model's `foo` attribute, or the result of the column's `formatter` if assigned. If the value is '', `null`, or `undefined`, and the column's `emptyCellValue` is assigned, that value will be used. * `bar` - Same for the 'bar' column cell content. * `foo-className` - String of CSS classes to apply to the `<td>`. * `bar-className` - Same. * `rowClass` - String of CSS classes to apply to the `<tr>`. This will be the odd/even class per the specified index plus any additional classes assigned by column formatters (via `o.rowClass`). Because this object is available to formatters, any additional properties can be added to fill in custom {placeholders} in the `_rowTemplate`. @method _createRowHTML @param {Model} model The Model instance to apply to the row template @param {Number} index The index the row will be appearing @param {Object[]} displayCols The column configurations @return {HTML} The markup for the provided Model, less any `nodeFormatter`s @protected @since 3.5.0 **/ _createRowHTML: function (model, index, displayCols) { var data = model.toJSON(), clientId = model.get('clientId'), values = { rowId : this._getRowId(clientId), clientId: clientId, rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN }, host = this.host || this, i, len, col, token, value, formatterData; for (i = 0, len = displayCols.length; i < len; ++i) { col = displayCols[i]; value = data[col.key]; token = col._id || col.key; values[token + '-className'] = ''; if (col._formatterFn) { formatterData = { value : value, data : data, column : col, record : model, className: '', rowClass : '', rowIndex : index }; // Formatters can either return a value value = col._formatterFn.call(host, formatterData); // or update the value property of the data obj passed if (value === undefined) { value = formatterData.value; } values[token + '-className'] = formatterData.className; values.rowClass += ' ' + formatterData.rowClass; } // if the token missing OR is the value a legit value if (!values.hasOwnProperty(token) || data.hasOwnProperty(col.key)) { if (value === undefined || value === null || value === '') { value = col.emptyCellValue || ''; } values[token] = col.allowHTML ? value : htmlEscape(value); } } // replace consecutive whitespace with a single space values.rowClass = values.rowClass.replace(/\s+/g, ' '); return fromTemplate(this._rowTemplate, values); }, /** Locates the row within the tbodyNode and returns the found index, or Null if it is not found in the tbodyNode @param {Y.Node} row @return {Number} Index of row in tbodyNode */ _getRowIndex: function (row) { var tbody = this.tbodyNode, index = 1; if (tbody && row) { //if row is not in the tbody, return if (row.ancestor('tbody') !== tbody) { return null; } // increment until we no longer have a previous node /*jshint boss: true*/ while (row = row.previous()) { // NOTE: assignment /*jshint boss: false*/ index++; } } return index; }, /** Creates a custom HTML template string for use in generating the markup for individual table rows with {placeholder}s to capture data from the Models in the `modelList` attribute or from column `formatter`s. Assigns the `_rowTemplate` property. @method _createRowTemplate @param {Object[]} displayCols Array of column configuration objects @protected @since 3.5.0 **/ _createRowTemplate: function (displayCols) { var html = '', cellTemplate = this.CELL_TEMPLATE, i, len, col, key, token, headers, tokenValues, formatter; this._setColumnsFormatterFn(displayCols); for (i = 0, len = displayCols.length; i < len; ++i) { col = displayCols[i]; key = col.key; token = col._id || key; formatter = col._formatterFn; // Only include headers if there are more than one headers = (col._headers || []).length > 1 ? 'headers="' + col._headers.join(' ') + '"' : ''; tokenValues = { content : '{' + token + '}', headers : headers, className: this.getClassName('col', token) + ' ' + (col.className || '') + ' ' + this.getClassName('cell') + ' {' + token + '-className}' }; if (!formatter && col.formatter) { tokenValues.content = col.formatter.replace(valueRegExp, tokenValues.content); } if (col.nodeFormatter) { // Defer all node decoration to the formatter tokenValues.content = ''; } html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues); } this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, { content: html }); }, /** Parses the columns array and defines the column's _formatterFn if there is a formatter available on the column @protected @method _setColumnsFormatterFn @param {Object[]} displayCols Array of column configuration objects @return {Object[]} Returns modified displayCols configuration Array */ _setColumnsFormatterFn: function (displayCols) { var Formatters = Y.DataTable.BodyView.Formatters, formatter, col, i, len; for (i = 0, len = displayCols.length; i < len; i++) { col = displayCols[i]; formatter = col.formatter; if (!col._formatterFn && formatter) { if (Lang.isFunction(formatter)) { col._formatterFn = formatter; } else if (formatter in Formatters) { col._formatterFn = Formatters[formatter].call(this.host || this, col); } } } return displayCols; }, /** Creates the `<tbody>` node that will store the data rows. @method _createTBodyNode @return {Node} @protected @since 3.6.0 **/ _createTBodyNode: function () { return Y.Node.create(fromTemplate(this.TBODY_TEMPLATE, { className: this.getClassName('data') })); }, /** Destroys the instance. @method destructor @protected @since 3.5.0 **/ destructor: function () { (new Y.EventHandle(YObject.values(this._eventHandles))).detach(); }, /** Holds the event subscriptions needing to be detached when the instance is `destroy()`ed. @property _eventHandles @type {Object} @default undefined (initially unset) @protected @since 3.5.0 **/ //_eventHandles: null, /** Returns the row ID associated with a Model's clientId. @method _getRowId @param {String} clientId The Model clientId @return {String} @protected **/ _getRowId: function (clientId) { return this._idMap[clientId] || (this._idMap[clientId] = Y.guid()); }, /** Map of Model clientIds to row ids. @property _idMap @type {Object} @protected **/ //_idMap, /** Initializes the instance. Reads the following configuration properties in addition to the instance attributes: * `columns` - (REQUIRED) The initial column information * `host` - The object to serve as source of truth for column info and for generating class names @method initializer @param {Object} config Configuration data @protected @since 3.5.0 **/ initializer: function (config) { this.host = config.host; this._eventHandles = { modelListChange: this.after('modelListChange', bind('_afterModelListChange', this)) }; this._idMap = {}; this.CLASS_ODD = this.getClassName('odd'); this.CLASS_EVEN = this.getClassName('even'); } /** The HTML template used to create a full row of markup for a single Model in the `modelList` plus any customizations defined in the column configurations. @property _rowTemplate @type {HTML} @default (initially unset) @protected @since 3.5.0 **/ //_rowTemplate: null },{ /** Hash of formatting functions for cell contents. This property can be populated with a hash of formatting functions by the developer or a set of pre-defined functions can be loaded via the `datatable-formatters` module. See: [DataTable.BodyView.Formatters](./DataTable.BodyView.Formatters.html) @property Formatters @type Object @since 3.8.0 @static **/ Formatters: {} }); }, '@VERSION@', {"requires": ["datatable-core", "view", "classnamemanager"]});
docs/webpack.config.development.js
KerenChandran/react-toolbox
const path = require('path'); const webpack = require('webpack'); const autoprefixer = require('autoprefixer'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const TransferWebpackPlugin = require('transfer-webpack-plugin'); module.exports = { context: __dirname, devtool: 'inline-source-map', entry: [ 'webpack-hot-middleware/client', './app/index.js' ], output: { path: path.join(__dirname, 'build'), filename: 'docs.js', publicPath: '/' }, resolve: { extensions: ['', '.scss', '.js', '.json', '.md'], packageMains: ['browser', 'web', 'browserify', 'main', 'style'], alias: { 'react-toolbox': path.resolve(__dirname + './../components') }, modulesDirectories: [ 'node_modules', path.resolve(__dirname, './node_modules'), path.resolve(__dirname, './../node_modules'), path.resolve(__dirname, './../components') ] }, module: { loaders: [ { test: /\.js$/, exclude: /(node_modules)/, loader: 'babel' }, { test: /\.(scss|css)$/, loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox') }, { test: /\.(txt)$/, loader: 'raw', include: path.resolve(__dirname, './app/components/layout/main/modules') }, { test: /\.(md)$/, loader: 'html!highlight!markdown' } ] }, postcss: [autoprefixer], plugins: [ new ExtractTextPlugin('docs.css', { allChunks: true }), new TransferWebpackPlugin([{ from: 'www/images', to: 'images' }], path.resolve(__dirname, './')), new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development') }) ] };
tests/unit/modal/modal.handleKeyDown.spec.js
Travix-International/travix-ui-kit
import React from 'react'; import { shallow } from 'enzyme'; import Modal from '../../../components/modal/modal'; describe('Modal: handleKeyDown', () => { it('should close on Esc key event', () => { Modal.prototype.close = jest.fn(); const component = shallow( <Modal active > Modal Content </Modal> ); expect(Modal.prototype.close).not.toBeCalled(); component.instance().handleKeyDown({ keyCode: 25 }); expect(Modal.prototype.close).not.toBeCalled(); component.instance().handleKeyDown({ keyCode: 27 }); expect(Modal.prototype.close).toBeCalled(); }); });
packages/material-ui-icons/src/SignalWifi4BarLockRounded.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M21.55 9.61L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l10.08 12.56c.8 1 2.32 1 3.12 0l1.94-2.42V14.5c0-2.8 2.2-5 5-5 .36 0 .71.04 1.05.11z" /><path d="M23 16v-1.5c0-1.4-1.1-2.5-2.5-2.5S18 13.1 18 14.5V16c-.5 0-1 .5-1 1v4c0 .5.5 1 1 1h5c.5 0 1-.5 1-1v-4c0-.5-.5-1-1-1zm-1 0h-3v-1.5c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5V16z" /></g></React.Fragment> , 'SignalWifi4BarLockRounded');
src/components/Logout/Logout.js
worknation/client.work.nation
import { d } from 'lightsaber/lib/log' import React from 'react' import Auth from '../../models/Authentication' export default class Logout extends React.Component { componentWillMount() { Auth.logout() this.props.history.push('/') } render() { return null } }
node_modules/react-icons/ti/power-outline.js
bairrada97/festival
import React from 'react' import Icon from 'react-icon-base' const TiPowerOutline = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m29.2 10.1c-1.4-1.4-3.3-1.7-5-1.2v-0.6c0-2.7-2.3-5-5-5s-5 2.3-5 5v0.6c-1.7-0.5-3.7-0.2-5.1 1.2-2.6 2.7-4.1 6.2-4.1 10s1.5 7.4 4.2 10c2.6 2.7 6.2 4.2 10 4.2s7.3-1.5 10-4.2c2.7-2.6 4.1-6.2 4.1-10s-1.4-7.3-4.1-10z m-11.7-1.8c0-0.9 0.7-1.6 1.7-1.6s1.6 0.7 1.6 1.6v8.4c0 0.9-0.7 1.6-1.6 1.6s-1.7-0.7-1.7-1.6v-8.4z m-1.7 6.4v2c0 1.8 1.5 3.3 3.4 3.3s3.3-1.5 3.3-3.3v-2c0.2 0.5 0.4 0.9 0.8 1.3 1.1 1.1 1.7 2.6 1.7 4.1s-0.6 3-1.7 4.1c-2.2 2.2-6.1 2.2-8.3 0-1.1-1.1-1.7-2.5-1.7-4.1s0.6-3 1.7-4.1c0.4-0.4 0.7-0.8 0.8-1.3z m11 13.1c-2 2-4.7 3.2-7.6 3.2s-5.6-1.2-7.7-3.2c-2-2.1-3.2-4.8-3.2-7.7s1.2-5.6 3.2-7.6c0.7-0.7 1.7-0.7 2.4 0s0.6 1.7 0 2.3c-1.5 1.4-2.2 3.3-2.2 5.3s0.7 3.9 2.2 5.3c1.4 1.4 3.3 2.2 5.3 2.2s3.9-0.8 5.3-2.2c1.4-1.4 2.2-3.3 2.2-5.3s-0.8-3.9-2.2-5.3c-0.7-0.6-0.7-1.7 0-2.3s1.7-0.7 2.3 0c2.1 2 3.2 4.7 3.2 7.6s-1.1 5.6-3.2 7.7z"/></g> </Icon> ) export default TiPowerOutline
examples/official-storybook/stories/addon-info/jsx.stories.js
storybooks/react-storybook
import React from 'react'; import { withInfo } from '@storybook/addon-info'; import { action } from '@storybook/addon-actions'; import BaseButton from '../../components/BaseButton'; const JSXDescription = ( <div> <h2>This is a JSX info section</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero nulla. </p> <p> <a href="https://github.com/storybookjs/react-storybook-addon-info">This is a link</a> </p> <p> <img alt="350x150" src="http://placehold.it/350x150" /> </p> </div> ); export default { title: 'Addons/Info/JSX', decorators: [withInfo], }; export const DisplaysJsxInDescription = () => ( <BaseButton onClick={action('clicked')} label="Button" /> ); DisplaysJsxInDescription.story = { name: 'Displays JSX in description', parameters: { info: { text: JSXDescription }, }, };
chrome/common/extensions/docs/examples/extensions/gdocs/js/jquery-1.4.1.min.js
CapOM/ChromiumGStreamerBackend
/*! * jQuery JavaScript Library v1.4.1 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Mon Jan 25 19:43:33 2010 -0500 */ (function(z,v){function la(){if(!c.isReady){try{r.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function Ma(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var n in b)X(a,n,b[n],f,e,d);return a}if(d!==v){f=!i&&f&&c.isFunction(d);for(n=0;n<j;n++)e(a[n],b,f?d.call(a[n],n,e(a[n],b)):d,i);return a}return j? e(a[0],b):null}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function ma(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function na(a){var b,d=[],f=[],e=arguments,i,j,n,o,m,s,x=c.extend({},c.data(this,"events").live);if(!(a.button&&a.type==="click")){for(o in x){j=x[o];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete x[o]}i=c(a.target).closest(f, a.currentTarget);m=0;for(s=i.length;m<s;m++)for(o in x){j=x[o];n=i[m].elem;f=null;if(i[m].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==n)d.push({elem:n,fn:j})}}m=0;for(s=d.length;m<s;m++){i=d[m];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}}function oa(a,b){return"live."+(a?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function pa(a){return!a||!a.parentNode||a.parentNode.nodeType=== 11}function qa(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ra(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0&&(c.support.checkClone||!sa.test(a[0]))){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:r;f=b.createDocumentFragment(); c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=i?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(ta.concat.apply([],ta.slice(0,b)),function(){d[this]=a});return d}function ua(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Na=z.jQuery,Oa=z.$,r=z.document,S,Pa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent, va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:r;if(a=Ta.exec(a))if(c.isPlainObject(b)){a=[r.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ra([d[1]], [f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=r.getElementById(d[2])){if(b.id!==d[2])return S.find(a);this.length=1;this[0]=b}this.context=r;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=r;a=r.getElementsByTagName(a)}else return!b||b.jquery?(b||S).find(a):c(b).find(a);else if(c.isFunction(a))return S.ready(a);if(a.selector!==v){this.selector=a.selector;this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a, this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return Q.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;ba.apply(this,a);return this},each:function(a,b){return c.each(this, a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(r,c);else P&&P.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice}; c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];n=e[i];if(a!==n)if(f&&n&&(c.isPlainObject(n)||c.isArray(n))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(n)?[]:{};a[i]=c.extend(f,j,n)}else if(n!==v)a[i]=n}return a};c.extend({noConflict:function(a){z.$= Oa;if(a)z.jQuery=Na;return c},isReady:false,ready:function(){if(!c.isReady){if(!r.body)return setTimeout(c.ready,13);c.isReady=true;if(P){for(var a,b=0;a=P[b++];)a.call(r,c);P=null}c.fn.triggerHandler&&c(r).triggerHandler("ready")}},bindReady:function(){if(!va){va=true;if(r.readyState==="complete")return c.ready();if(r.addEventListener){r.addEventListener("DOMContentLoaded",L,false);z.addEventListener("load",c.ready,false)}else if(r.attachEvent){r.attachEvent("onreadystatechange",L);z.attachEvent("onload", c.ready);var a=false;try{a=z.frameElement==null}catch(b){}r.documentElement.doScroll&&a&&la()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===v||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false; return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return z.JSON&&z.JSON.parse?z.JSON.parse(a):(new Function("return "+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Ra.test(a)){var b=r.getElementsByTagName("head")[0]|| r.documentElement,d=r.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(r.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===v||c.isFunction(a);if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d= a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Sa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!== v;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=v}else if(b&&!c.isFunction(b)){d=b;b=v}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b}, uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});O=c.uaMatch(O);if(O.browser){c.browser[O.browser]=true;c.browser.version=O.version}if(c.browser.webkit)c.browser.safari=true;if(wa)c.inArray=function(a,b){return wa.call(b,a)};S=c(r);if(r.addEventListener)L=function(){r.removeEventListener("DOMContentLoaded", L,false);c.ready()};else if(r.attachEvent)L=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=r.documentElement,b=r.createElement("script"),d=r.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support= {leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null}; b.type="text/javascript";try{b.appendChild(r.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if(z[f]){c.support.scriptEval=true;delete z[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function n(){c.support.noCloneEvent=false;d.detachEvent("onclick",n)});d.cloneNode(true).fireEvent("onclick")}d=r.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=r.createDocumentFragment();a.appendChild(d.firstChild); c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var n=r.createElement("div");n.style.width=n.style.paddingLeft="1px";r.body.appendChild(n);c.boxModel=c.support.boxModel=n.offsetWidth===2;r.body.removeChild(n).style.display="none"});a=function(n){var o=r.createElement("div");n="on"+n;var m=n in o;if(!m){o.setAttribute(n,"return;");m=typeof o[n]==="function"}return m};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props= {"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ua=0,xa={},Va={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var f=a[G],e=c.cache;if(!b&&!f)return null;f||(f=++Ua);if(typeof b==="object"){a[G]=f;e=e[f]=c.extend(true, {},b)}else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});if(d!==v){a[G]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[G]}catch(i){a.removeAttribute&&a.removeAttribute(G)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this, a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===v){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===v&&this.length)f=c.data(this[0],a);return f===v&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d); return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===v)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]|| a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(o){var m= c(this);m.addClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,n=b.length;j<n;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var m=c(this);m.removeClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string"||a===v)for(var b=(a||"").split(ca), d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(ya," "),j=0,n=b.length;j<n;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),n=b,o= a.split(ca);e=o[i++];){n=f?n:!j.hasClass(e);j[n?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(ya," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value|| {}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(za.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Wa,"")}return v}var n=c.isFunction(a);return this.each(function(o){var m=c(this),s=a;if(this.nodeType===1){if(n)s=a.call(this,o,m.val()); if(typeof s==="number")s+="";if(c.isArray(s)&&za.test(this.type))this.checked=c.inArray(m.val(),s)>=0;else if(c.nodeName(this,"select")){var x=c.makeArray(s);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),x)>=0});if(!x.length)this.selectedIndex=-1}else this.value=s}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](d); f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==v;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Xa.test(b);if(b in a&&f&&!i){if(e){b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText= ""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?v:a}return c.style(a,b,d)}});var ab=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==z&&!a.frameElement)a=z;if(!d.guid)d.guid=c.guid++;if(f!==v){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j= function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var n,o=0;n=b[o++];){var m=n.split(".");n=m.shift();if(o>1){d=c.proxy(d);if(f!==v)d.data=f}d.type=m.slice(0).sort().join(".");var s=e[n],x=this.special[n]||{};if(!s){s=e[n]={};if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)}if(x.add)if((m=x.add.call(a, d,f,m,s))&&c.isFunction(m)){m.guid=m.guid||d.guid;m.data=m.data||d.data;m.type=m.type||d.type;d=m}s[d.guid]=d;this.global[n]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===v||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);for(var n=0;i=b[n++];){var o=i.split(".");i=o.shift();var m=!o.length,s=c.map(o.slice(0).sort(),ab);s=new RegExp("(^|\\.)"+ s.join("\\.(?:.*\\.)?")+"(\\.|$)");var x=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);for(e in f[i])break;if(!e){if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(A=c.data(a,"handle"))A.elem=null;c.removeData(a, "events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return v;a.result=v;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d, b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(i){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){d=a.target;var j;if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){try{if(d[e]){if(j=d["on"+e])d["on"+e]=null;this.triggered=true;d[e]()}}catch(n){}if(j)d["on"+e]=j;this.triggered=false}}},handle:function(a){var b, d;a=arguments[0]=c.event.fix(a||z.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==v){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||r;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=r.documentElement;d=r.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;b.liveProxy=a;c.event.add(this,b.live,na,b)},remove:function(a){if(a.length){var b= 0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],na)}},special:{}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true}; c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Aa=function(a){for(var b= a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ba=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ba:Aa,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ba:Aa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!== "form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this, "keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var da=/textarea|input|select/i;function Ca(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ea(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Ca(d);if(a.type!=="focusout"|| d.type!=="radio")c.data(d,"_change_data",e);if(!(f===v||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}}c.event.special.change={filters:{focusout:ea,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)},beforeactivate:function(a){a= a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))}},setup:function(a,b,d){for(var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)},remove:function(a,b){for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)}};var T=c.event.special.change.filters}r.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this, f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){e=f;f=v}var j=b==="one"?c.proxy(e,function(n){c(this).unbind(n,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a, b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+ a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e){var i,j=0;if(c.isFunction(f)){e=f;f=v}for(d=(d||"").split(/\s+/);(i=d[j++])!=null;){i=i==="focus"?"focusin":i==="blur"?"focusout":i==="hover"?d.push("mouseleave")&&"mouseenter":i;b==="live"?c(this.context).bind(oa(i,this.selector),{data:f,selector:this.selector, live:i},e):c(this.context).unbind(oa(i,this.selector),e?{guid:e.guid+this.selector+i}:null)}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});z.attachEvent&&!z.addEventListener&&z.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g){for(var h="",k,l=0;g[l];l++){k=g[l];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===k){y=l[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=k;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}l[q]=y}}}function d(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache=== k){y=l[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=k;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(o.filter(h,[t]).length>0){y=t;break}}t=t[g]}l[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;[0,0].sort(function(){n=false;return 0});var o=function(g,h,k,l){k=k||[];var q=h=h||r;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g|| typeof g!=="string")return k;for(var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){I=u[3];p.push(u[1]);if(u[2]){R=u[3];break}}if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){g=p.shift();if(m.relative[g])g+=p.shift();t=fa(g,t)}else{if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){u=o.find(p.shift(),h,M);h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]}if(h){u= l?{expr:p.pop(),set:A(l)}:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=u.expr?o.filter(u.expr,u.set):u.set;if(p.length>0)y=A(t);else H=false;for(;p.length;){var D=p.pop();u=D;if(m.relative[D])u=p.pop();else D="";if(u==null)u=h;m.relative[D](y,u,M)}}else y=[]}y||(y=t);y||o.error(D||g);if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&& y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);if(R){o(R,q,k,l);o.uniqueSort(k)}return k};o.uniqueSort=function(g){if(C){j=n;g.sort(C);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};o.matches=function(g,h){return o(g,null,null,h)};o.find=function(g,h,k){var l,q;if(!g)return[];for(var p=0,u=m.order.length;p<u;p++){var t=m.order[p];if(q=m.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");l=m.find[t](q, h,k);if(l!=null){g=g.replace(m.match[t],"");break}}}}l||(l=h.getElementsByTagName("*"));return{set:l,expr:g}};o.filter=function(g,h,k,l){for(var q=g,p=[],u=h,t,y,R=h&&h[0]&&w(h[0]);g&&h.length;){for(var H in m.filter)if((t=m.leftMatch[H].exec(g))!=null&&t[2]){var M=m.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(u===p)p=[];if(m.preFilter[H])if(t=m.preFilter[H](t,u,k,p,l,R)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=u[U])!=null;U++)if(D){I=M(D,t,U,u);var Da= l^!!I;if(k&&I!=null)if(Da)y=true;else u[U]=false;else if(Da){p.push(D);y=true}}if(I!==v){k||(u=p);g=g.replace(m.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)o.error(g);else break;q=g}return u};o.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var m=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,h){var k=typeof h==="string",l=k&&!/\W/.test(h);k=k&&!l;if(l)h=h.toLowerCase();l=0;for(var q=g.length, p;l<q;l++)if(p=g[l]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[l]=k||p&&p.nodeName.toLowerCase()===h?p||false:p===h}k&&o.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var l=0,q=g.length;l<q;l++){var p=g[l];if(p){k=p.parentNode;g[l]=k.nodeName.toLowerCase()===h?k:false}}}else{l=0;for(q=g.length;l<q;l++)if(p=g[l])g[l]=k?p.parentNode:p.parentNode===h;k&&o.filter(h,g,true)}},"":function(g,h,k){var l=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p= h=h.toLowerCase();q=b}q("parentNode",h,l,g,p,k)},"~":function(g,h,k){var l=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,l,g,p,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];h=h.getElementsByName(g[1]);for(var l=0,q=h.length;l<q;l++)h[l].getAttribute("name")===g[1]&&k.push(h[l]);return k.length===0?null:k}}, TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,l,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var u;(u=h[p])!=null;p++)if(u)if(q^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||l.push(u);else if(k)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&& "2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,l,q,p){h=g[1].replace(/\\/g,"");if(!p&&m.attrMap[h])g[1]=m.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,l,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);else{g=o.filter(g[3],h,k,true^q);k||l.push.apply(l,g);return false}else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true); return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!o(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"=== g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,k,l){return h===l.length-1},even:function(g,h){return h%2=== 0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,l){var q=h[1],p=m.filters[q];if(p)return p(g,k,h,l);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];k=0;for(l=h.length;k<l;k++)if(h[k]===g)return false;return true}else o.error("Syntax error, unrecognized expression: "+ q)},CHILD:function(g,h){var k=h[1],l=g;switch(k){case "only":case "first":for(;l=l.previousSibling;)if(l.nodeType===1)return false;if(k==="first")return true;l=g;case "last":for(;l=l.nextSibling;)if(l.nodeType===1)return false;return true;case "nth":k=h[2];var q=h[3];if(k===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var u=0;for(l=p.firstChild;l;l=l.nextSibling)if(l.nodeType===1)l.nodeIndex=++u;p.sizcache=h}g=g.nodeIndex-q;return k===0?g===0:g%k===0&&g/k>= 0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var l=h[2];h=h[4];return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="? k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,l){var q=m.setFilters[h[2]];if(q)return q(g,k,h,l)}}},s=m.match.POS;for(var x in m.match){m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var A=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g}; try{Array.prototype.slice.call(r.documentElement.childNodes,0)}catch(B){A=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,l=g.length;k<l;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var C;if(r.documentElement.compareDocumentPosition)C=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g=== h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in r.documentElement)C=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(r.createRange)C=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),l=h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);l.setStart(h,0);l.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END, l);if(g===0)j=true;return g};(function(){var g=r.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=r.documentElement;k.insertBefore(g,k.firstChild);if(r.getElementById(h)){m.find.ID=function(l,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]};m.filter.ID=function(l,q){var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id"); return l.nodeType===1&&p&&p.nodeValue===q}}k.removeChild(g);k=g=null})();(function(){var g=r.createElement("div");g.appendChild(r.createComment(""));if(g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);k=h}return k};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){return h.getAttribute("href", 2)};g=null})();r.querySelectorAll&&function(){var g=o,h=r.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){o=function(l,q,p,u){q=q||r;if(!u&&q.nodeType===9&&!w(q))try{return A(q.querySelectorAll(l),p)}catch(t){}return g(l,q,p,u)};for(var k in g)o[k]=g[k];h=null}}();(function(){var g=r.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== 0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){m.order.splice(1,0,"CLASS");m.find.CLASS=function(h,k,l){if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])};g=null}}})();var E=r.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},w=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},fa=function(g,h){var k=[], l="",q;for(h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){l+=q[0];g=g.replace(m.match.PSEUDO,"")}g=m.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)o(g,h[q],k);return o.filter(l,k)};c.find=o;c.expr=o.selectors;c.expr[":"]=c.expr.filters;c.unique=o.uniqueSort;c.getText=a;c.isXMLDoc=w;c.contains=E})();var bb=/Until$/,cb=/^(?:parents|prevUntil|prevAll)/,db=/,/;Q=Array.prototype.slice;var Ea=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a, function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Qa.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d= 0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ea(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ea(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for(var n=a.length;e<n;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)> -1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(m,s){for(;s&&s.ownerDocument&&s!==b;){if(o?o.index(s)>-1:c(s).is(a))return s;s=s.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(), a);return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")}, nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);bb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e): e;if((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();return this.pushStack(e,a,Q.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!== b&&d.push(a);return d}});var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,sa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ia=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"], col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));return c.getText(this)}, wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length? d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments, false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&& !c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){qa(this,b);qa(this.find("*"),b.find("*"))}return b},html:function(a){if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(Ha.exec(a)|| ["",""])[1].toLowerCase()]){a=a.replace(Ga,Ia);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this, b,f))});else a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(s){return c.nodeName(s,"table")?s.getElementsByTagName("tbody")[0]||s.appendChild(s.ownerDocument.createElement("tbody")):s}var e,i,j=a[0],n=[];if(!c.support.checkClone&&arguments.length===3&&typeof j=== "string"&&sa.test(j))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(j))return this.each(function(s){var x=c(this);a[0]=j.call(this,s,b?x.html():v);x.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ra(a,this,n);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var o=0,m=this.length;o<m;o++)d.call(b?f(this[o],i):this[o],e.cacheable||this.length>1||o>0?e.fragment.cloneNode(true):e.fragment)}n&&c.each(n, Ma)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){c.cleanData(this.getElementsByTagName("*"));c.cleanData([this])}this.parentNode&& this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&c.cleanData(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||r;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||r;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j=== "string"){j=j.replace(Ga,Ia);var n=(Ha.exec(j)||["",""])[1].toLowerCase(),o=F[n]||F._default,m=o[0];i=b.createElement("div");for(i.innerHTML=o[1]+j+o[2];m--;)i=i.lastChild;if(!c.support.tbody){m=fb.test(j);n=n==="table"&&!m?i.firstChild&&i.firstChild.childNodes:o[1]==="<table>"&&!m?i.childNodes:[];for(o=n.length-1;o>=0;--o)c.nodeName(n[o],"tbody")&&!n[o].childNodes.length&&n[o].parentNode.removeChild(n[o])}!c.support.leadingWhitespace&&V.test(j)&&i.insertBefore(b.createTextNode(V.exec(j)[0]),i.firstChild); j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()==="text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e},cleanData:function(a){for(var b=0,d;(d=a[b])!=null;b++){c.event.remove(d);c.removeData(d)}}});var hb=/z-?index|font-?weight|opacity|zoom|line-?height/i, Ja=/alpha\([^)]*\)/,Ka=/opacity=([^)]*)/,ga=/float/i,ha=/-([a-z])/ig,ib=/([A-Z])/g,jb=/^-?\d+(?:px)?$/i,kb=/^-?\d/,lb={position:"absolute",visibility:"hidden",display:"block"},mb=["Left","Right"],nb=["Top","Bottom"],ob=r.defaultView&&r.defaultView.getComputedStyle,La=c.support.cssFloat?"cssFloat":"styleFloat",ia=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===v)return c.curCSS(d,f);if(typeof e==="number"&&!hb.test(f))e+="px";c.style(d,f,e)})}; c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return v;if((b==="width"||b==="height")&&parseFloat(d)<0)d=v;var f=a.style||a,e=d!==v;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ja.test(a)?a.replace(Ja,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ka.exec(f.filter)[1])/100+"":""}if(ga.test(b))b=La;b=b.replace(ha,ia);if(e)f[b]=d;return f[b]},css:function(a, b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?mb:nb;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,lb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&& a.currentStyle){f=Ka.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ga.test(b))b=La;if(!d&&e&&e[b])f=e[b];else if(ob){if(ga.test(b))b="float";b=b.replace(ib,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ha,ia);f=a.currentStyle[b]||a.currentStyle[d];if(!jb.test(f)&&kb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left= a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var pb= J(),qb=/<script(.|\s)*?\/script>/gi,rb=/select|textarea/i,sb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ja=/\?/,tb=/(\?|&)_=.*?(&|$)/,ub=/^(\w+:)?\/\/([^\/?#]+)/,vb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b= c.param(b,c.ajaxSettings.traditional);f="POST"}var i=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(j,n){if(n==="success"||n==="notmodified")i.html(e?c("<div />").append(j.responseText.replace(qb,"")).find(e):j.responseText);d&&i.each(d,[j.responseText,n,j])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&& (this.checked||rb.test(this.nodeName)||sb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a, b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:z.XMLHttpRequest&&(z.location.protocol!=="file:"||!z.ActiveXObject)?function(){return new z.XMLHttpRequest}: function(){try{return new z.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(o,n,j,w);e.global&&f("ajaxSuccess",[w,e])}function d(){e.complete&&e.complete.call(o,w,j);e.global&&f("ajaxComplete",[w,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")} function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,n,o=a&&a.context||e,m=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(m==="GET")N.test(e.url)||(e.url+=(ja.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)|| N.test(e.url))){i=e.jsonpCallback||"jsonp"+pb++;if(e.data)e.data=(e.data+"").replace(N,"="+i+"$1");e.url=e.url.replace(N,"="+i+"$1");e.dataType="script";z[i]=z[i]||function(q){n=q;b();d();z[i]=v;try{delete z[i]}catch(p){}A&&A.removeChild(B)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&m==="GET"){var s=J(),x=e.url.replace(tb,"$1_="+s+"$2");e.url=x+(x===e.url?(ja.test(e.url)?"&":"?")+"_="+s:"")}if(e.data&&m==="GET")e.url+=(ja.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&& c.event.trigger("ajaxStart");s=(s=ub.exec(e.url))&&(s[1]&&s[1]!==location.protocol||s[2]!==location.host);if(e.dataType==="script"&&m==="GET"&&s){var A=r.getElementsByTagName("head")[0]||r.documentElement,B=r.createElement("script");B.src=e.url;if(e.scriptCharset)B.charset=e.scriptCharset;if(!i){var C=false;B.onload=B.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;b();d();B.onload=B.onreadystatechange=null;A&&B.parentNode&& A.removeChild(B)}}}A.insertBefore(B,A.firstChild);return v}var E=false,w=e.xhr();if(w){e.username?w.open(m,e.url,e.async,e.username,e.password):w.open(m,e.url,e.async);try{if(e.data||a&&a.contentType)w.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&w.setRequestHeader("If-None-Match",c.etag[e.url])}s||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept", e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(fa){}if(e.beforeSend&&e.beforeSend.call(o,w,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");w.abort();return false}e.global&&f("ajaxSend",[w,e]);var g=w.onreadystatechange=function(q){if(!w||w.readyState===0||q==="abort"){E||d();E=true;if(w)w.onreadystatechange=c.noop}else if(!E&&w&&(w.readyState===4||q==="timeout")){E=true;w.onreadystatechange=c.noop;j=q==="timeout"?"timeout":!c.httpSuccess(w)? "error":e.ifModified&&c.httpNotModified(w,e.url)?"notmodified":"success";var p;if(j==="success")try{n=c.httpData(w,e.dataType,e)}catch(u){j="parsererror";p=u}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,w,j,p);d();q==="timeout"&&w.abort();if(e.async)w=null}};try{var h=w.abort;w.abort=function(){w&&h.call(w);g("abort")}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){w&&!E&&g("timeout")},e.timeout);try{w.send(m==="POST"||m==="PUT"||m==="DELETE"?e.data:null)}catch(l){c.handleError(e, w,null,l);d()}e.async||g();return w}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]= f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(j,n){if(c.isArray(n))c.each(n, function(o,m){b?f(j,m):d(j+"["+(typeof m==="object"||c.isArray(m)?o:"")+"]",m)});else!b&&n!=null&&typeof n==="object"?c.each(n,function(o,m){d(j+"["+o+"]",m)}):f(j,n)}function f(j,n){n=c.isFunction(n)?n():n;e[e.length]=encodeURIComponent(j)+"="+encodeURIComponent(n)}var e=[];if(b===v)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var i in a)d(i,a[i]);return e.join("&").replace(vb,"+")}});var ka={},wb=/toggle|show|hide/,xb=/^([+-]=)?([\d+-.]+)(.*)$/, W,ta=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(ka[d])f=ka[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove(); ka[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&& c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,n=this.nodeType===1&&c(this).is(":hidden"), o=this;for(j in a){var m=j.replace(ha,ia);if(j!==m){a[m]=a[j];delete a[j];j=m}if(a[j]==="hide"&&n||a[j]==="show"&&!n)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(s,x){var A=new c.fx(o,i,s);if(wb.test(x))A[x==="toggle"?n?"show":"hide":x](a); else{var B=xb.exec(x),C=A.cur(true)||0;if(B){x=parseFloat(B[2]);var E=B[3]||"px";if(E!=="px"){o.style[s]=(x||1)+E;C=(x||1)/A.cur(true)*C;o.style[s]=C+E}if(B[1])x=(B[1]==="-="?-1:1)*x+C;A.custom(C,x,E)}else A.custom(C,x,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle", 1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a, b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]== null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop=== "width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow= this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos= c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!= null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in r.documentElement?function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(), f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(s){c.offset.setOffset(this,a,s)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f= b,e=b.ownerDocument,i,j=e.documentElement,n=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var o=b.offsetTop,m=b.offsetLeft;(b=b.parentNode)&&b!==n&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;o-=b.scrollTop;m-=b.scrollLeft;if(b===d){o+=b.offsetTop;m+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){o+=parseFloat(i.borderTopWidth)|| 0;m+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){o+=parseFloat(i.borderTopWidth)||0;m+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){o+=n.offsetTop;m+=n.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){o+=Math.max(j.scrollTop,n.scrollTop);m+=Math.max(j.scrollLeft,n.scrollLeft)}return{top:o,left:m}};c.offset={initialize:function(){var a=r.body,b=r.createElement("div"), d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild); d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop}, bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left- e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a= this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==v)return this.each(function(){if(i=ua(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=ua(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}}); c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(i){var j=c(this);j[d](f.call(this,i,j[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]|| e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===v?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});z.jQuery=z.$=c})(window);
spec/components/Signup.js
boldt/react-validation-mixin
import React from 'react'; import classnames from 'classnames'; import Joi from 'joi'; var Signup = React.createClass({ displayName: 'Signup', validatorTypes: { firstName: Joi.string().required().label('First Name'), lastName: Joi.string().allow(null).label('Last Name'), email: Joi.string().email().label('Email Address'), username: Joi.string().alphanum().min(3).max(30).required().label('Username'), password: Joi.string().regex(/[a-zA-Z0-9]{3,30}/).label('Password'), verifyPassword: Joi.any().valid(Joi.ref('password')).required().label('Password Confirmation'), referral: Joi.any().valid('tv', 'radio'), rememberMe: Joi.boolean(), }, getValidatorData: function() { return this.state; }, getInitialState: function() { return { firstName: null, lastName: null, email: null, username: null, password: null, verifyPassword: null, rememberMe: 'off', referral: null, feedback: null, }; }, render: function() { return ( <section className='row'> <h3>Signup</h3> <form onSubmit={this.handleSubmit} className='form-horizontal'> <fieldset> <div className={this.getClasses('firstName')}> <label htmlFor='firstName'>First Name</label> <input type='text' id='firstName' ref='firstName' value={this.state.firstName} onChange={this.onChange('firstName')} onBlur={this.props.handleValidation('firstName')} className='form-control' placeholder='First Name' /> {this.props.getValidationMessages('firstName').map(this.renderHelpText)} </div> <div className={this.getClasses('lastName')}> <label htmlFor='lastName'>Last Name</label> <input type='text' id='lastName' ref='lastName' value={this.state.lastName} onChange={this.onChange('lastName')} onBlur={this.props.handleValidation('lastName')} className='form-control' placeholder='Last Name' /> </div> <div className={this.getClasses('email')}> <label htmlFor='email'>Email</label> <input type='email' id='email' ref='email' value={this.state.email} onChange={this.onChange('email')} onBlur={this.props.handleValidation('email')} className='form-control' placeholder='Email' /> {this.props.getValidationMessages('email').map(this.renderHelpText)} </div> <div className={this.getClasses('username')}> <label htmlFor='username'>Username</label> <input type='text' id='username' ref='username' value={this.state.username} onChange={this.onChange('username')} onBlur={this.props.handleValidation('username')} className='form-control' placeholder='Username' /> {this.props.getValidationMessages('username').map(this.renderHelpText)} </div> <div className={this.getClasses('password')}> <label htmlFor='password'>Password</label> <input type='password' id='password' ref='password' value={this.state.password} onChange={this.onChange('password')} onBlur={this.props.handleValidation('password')} className='form-control' placeholder='Password' /> {this.props.getValidationMessages('password').map(this.renderHelpText)} </div> <div className={this.getClasses('verifyPassword')}> <label htmlFor='verifyPassword'>Verify Password</label> <input type='password' id='verifyPassword' ref='verifyPassword' value={this.state.verifyPassword} onChange={this.onChange('verifyPassword')} onBlur={this.props.handleValidation('verifyPassword')} className='form-control' placeholder='Verify Password' /> {this.props.getValidationMessages('verifyPassword').map(this.renderHelpText)} </div> <div className='form-group'> <label htmlFor='referral'>How did you hear about us?</label> <label htmlFor='tv' className="radio-inline"> <input type='checkbox' id="tv" ref='tv' name='referral' value='tv' checked={this.state.referral === 'tv'} onChange={this.onRadioChange('referral')}/> {' '}tv </label> <label htmlFor='radio' className="radio-inline"> <input type='checkbox' id="radio" ref='radio' name='referral' value='radio' checked={this.state.referral === 'radio'} onChange={this.onRadioChange('referral')}/> {' '}radio </label> {this.props.getValidationMessages('referral').map(this.renderHelpText)} </div> <div className='form-group'> <label htmlFor='rememberMe'> Remember me{' '} <input type='checkbox' id='rememberMe' ref='rememberMe' value='on' checked={this.state.rememberMe === 'on'} onChange={this.onCheckboxChange('rememberMe')}/> </label> {this.props.getValidationMessages('rememberMe').map(this.renderHelpText)} </div> <div className='form-group'> <h3>{this.state.feedback}</h3> </div> <div className='text-center form-group'> <button type='submit' className='btn btn-large btn-primary'>Sign up</button> {' '} <button onClick={this.handleReset} className='btn btn-large btn-info'>Reset</button> </div> </fieldset> </form> </section> ) }, renderHelpText: function(message) { return ( <span className="help-block">{message}</span> ); }, getClasses: function(field) { return classnames({ 'form-group': true, 'has-error': !this.props.isValid(field) }); }, onChange: function(field) { return event => { let state = {}; state[field] = event.target.value; this.setState(state); }; }, onCheckboxChange: function(field) { return event => { let state = {}; state[field] = this.state[field] === 'on' ? 'off' : 'on'; this.setState(state, this.props.handleValidation(field)); }; }, onRadioChange: function(field) { return event => { let state = {}; state[field] = event.target.value; this.setState(state, this.props.handleValidation(field)); }; }, handleReset: function(event) { event.preventDefault(); this.props.clearValidations(); this.setState(this.getInitialState()); }, handleSubmit: function(event) { event.preventDefault(); var onValidate = error => { if (error) { this.setState({ feedback: 'Form is invalid do not submit' }); } else { this.setState({ feedback: 'Form is valid send to action creator' }); } }; this.props.validate(onValidate); } }); module.exports = Signup;
components/ProductCell.js
goominc/goommerce-seller-native
'use strict'; import React from 'react'; import { Image, Picker, Platform, StyleSheet, Switch, Text, TouchableHighlight, TouchableNativeFeedback, View, } from 'react-native'; import { CloudinaryImageNative } from 'react-cloudinary/lib/native'; import numeral from 'numeral'; import DefaultText from './DefaultText'; import OpenUrlButton from './OpenUrlButton'; export default React.createClass({ render() { const TouchableElement = Platform.OS === 'android' ? TouchableNativeFeedback : TouchableHighlight; const { product: { id, appImages, name, KRW, isActive } } = this.props; const image = appImages.default[0]; return ( <View> <TouchableElement onPress={this.props.onSelect} onShowUnderlay={this.props.onHighlight} onHideUnderlay={this.props.onUnhighlight} > <View style={styles.container}> <OpenUrlButton url={`https://m.linkshops.com/products/${id}`}> <CloudinaryImageNative publicId={image.publicId} options={{ width: 200, height: 200 }} style={styles.thumbnail} /> </OpenUrlButton> <View style={styles.descContainer}> <Text style={{ fontSize: 14, color: '#4c4c4c' }}>{name.ko}</Text> {KRW && <Text style={{ fontSize: 12, color: '#4c4c4c' }}>{`${numeral(KRW).format('0,0')}원`}</Text>} </View> </View> </TouchableElement> </View> ); } }); const styles = StyleSheet.create({ container: { alignItems: 'center', backgroundColor: 'white', flexDirection: 'row', height: 90, marginHorizontal: 12, }, descContainer: { flex: 1, }, thumbnail: { width: 60, height: 78, marginRight: 10, backgroundColor: '#F2F2F2', borderWidth: 1, borderColor: '#EAEAEA', }, });
src/Containers/ListPosts.js
TaylorRayHoward/ReactReduxMessageBoard
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { getPosts, savePost, deletePost } from '../Actions/PostActions'; import { Field, reduxForm, reset } from 'redux-form'; import '../Styles/App.css'; import _ from 'lodash'; import PostCard from '../Components/PostCard'; import { getUser, logout } from '../Actions/UserActions'; import { Link } from 'react-router-dom'; import { required } from '../Helpers/ReduxFormValidation'; class App extends Component { renderPosts() { return _.map(this.props.posts, (post, key) => { return ( <PostCard key={key}> <Link to={`/${key}`}><h3>{post.title}</h3></Link> <p className="card-text"> {post.body} </p> {post.uid === this.props.user.uid && <button className="btn btn-danger float-right" onClick={() => this.props.deletePost(key)}>Delete</button>} </PostCard> ); }); } renderField(field) { const errStyle = { borderColor: 'red' }; return ( <input type="text" placeholder={`Enter a ${field.label}...`} {...field.input} className={field.class} style={field.meta.touched && field.meta.error ? errStyle : null}/> ); } onSubmit(values) { this.props.savePost(values, this.props.user.uid).then(this.props.dispatch(reset('NewPost'))); } render() { const { handleSubmit } = this.props; return ( <div> <div className="navbar"> <button className="btn btn-danger" onClick={() => {this.props.logout();}}>Sign out</button> </div> <div className="container"> <div className="main"> {this.renderPosts()} </div> <div className="navbar fixed-bottom"> <form onSubmit={handleSubmit(this.onSubmit.bind(this))} className="footerForm"> <Field name="title" component={this.renderField} label="Title" class="footer-title" validate={required} /> <Field name="body" component={this.renderField} label="Body" class="footer-body" /> <button type="submit" className="btn footer-button">Post</button> </form> </div> </div> </div> ); } } let form = reduxForm({ form: 'NewPost' })(App); form = connect((state, ownProps) => ({ posts: state.posts, user: state.user }), { savePost, getPosts, deletePost, getUser, logout } )(form); export default form;
app/javascript/mastodon/features/public_timeline/index.js
ikuradon/mastodon
import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../../components/column'; import ColumnHeader from '../../components/column_header'; import { expandPublicTimeline } from '../../actions/timelines'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; import ColumnSettingsContainer from './containers/column_settings_container'; import { connectPublicStream } from '../../actions/streaming'; const messages = defineMessages({ title: { id: 'column.public', defaultMessage: 'Federated timeline' }, }); const mapStateToProps = (state, { columnId }) => { const uuid = columnId; const columns = state.getIn(['settings', 'columns']); const index = columns.findIndex(c => c.get('uuid') === uuid); const onlyMedia = (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'public', 'other', 'onlyMedia']); const onlyRemote = (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyRemote']) : state.getIn(['settings', 'public', 'other', 'onlyRemote']); const timelineState = state.getIn(['timelines', `public${onlyMedia ? ':media' : ''}`]); return { hasUnread: !!timelineState && timelineState.get('unread') > 0, onlyMedia, onlyRemote, }; }; export default @connect(mapStateToProps) @injectIntl class PublicTimeline extends React.PureComponent { static contextTypes = { router: PropTypes.object, }; static defaultProps = { onlyMedia: false, }; static propTypes = { dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, columnId: PropTypes.string, multiColumn: PropTypes.bool, hasUnread: PropTypes.bool, onlyMedia: PropTypes.bool, onlyRemote: PropTypes.bool, }; handlePin = () => { const { columnId, dispatch, onlyMedia, onlyRemote } = this.props; if (columnId) { dispatch(removeColumn(columnId)); } else { dispatch(addColumn(onlyRemote ? 'REMOTE' : 'PUBLIC', { other: { onlyMedia, onlyRemote } })); } } handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); } handleHeaderClick = () => { this.column.scrollTop(); } componentDidMount () { const { dispatch, onlyMedia, onlyRemote } = this.props; dispatch(expandPublicTimeline({ onlyMedia, onlyRemote })); this.disconnect = dispatch(connectPublicStream({ onlyMedia, onlyRemote })); } componentDidUpdate (prevProps) { if (prevProps.onlyMedia !== this.props.onlyMedia || prevProps.onlyRemote !== this.props.onlyRemote) { const { dispatch, onlyMedia, onlyRemote } = this.props; this.disconnect(); dispatch(expandPublicTimeline({ onlyMedia, onlyRemote })); this.disconnect = dispatch(connectPublicStream({ onlyMedia, onlyRemote })); } } componentWillUnmount () { if (this.disconnect) { this.disconnect(); this.disconnect = null; } } setRef = c => { this.column = c; } handleLoadMore = maxId => { const { dispatch, onlyMedia, onlyRemote } = this.props; dispatch(expandPublicTimeline({ maxId, onlyMedia, onlyRemote })); } render () { const { intl, columnId, hasUnread, multiColumn, onlyMedia, onlyRemote } = this.props; const pinned = !!columnId; return ( <Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}> <ColumnHeader icon='globe' active={hasUnread} title={intl.formatMessage(messages.title)} onPin={this.handlePin} onMove={this.handleMove} onClick={this.handleHeaderClick} pinned={pinned} multiColumn={multiColumn} > <ColumnSettingsContainer columnId={columnId} /> </ColumnHeader> <StatusListContainer timelineId={`public${onlyRemote ? ':remote' : ''}${onlyMedia ? ':media' : ''}`} onLoadMore={this.handleLoadMore} trackScroll={!pinned} scrollKey={`public_timeline-${columnId}`} emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other servers to fill it up' />} bindToDocument={!multiColumn} /> </Column> ); } }
app/javascript/mastodon/features/ui/components/column_subheading.js
mimumemo/mastodon
import React from 'react'; import PropTypes from 'prop-types'; const ColumnSubheading = ({ text }) => { return ( <div className='column-subheading'> {text} </div> ); }; ColumnSubheading.propTypes = { text: PropTypes.string.isRequired, }; export default ColumnSubheading;
dispatch/static/manager/src/js/components/PodcastEditor/EpisodeEditor/index.js
ubyssey/dispatch
import React from 'react' import R from 'ramda' import DocumentTitle from 'react-document-title' import { connect } from 'react-redux' import { withRouter } from 'react-router' import { Link } from 'react-router' import { Button, Intent } from '@blueprintjs/core' import { confirmNavigation } from '../../../util/helpers' import podcastsActions from '../../../actions/PodcastsActions' import podcastEpisodesActions from '../../../actions/PodcastEpisodesActions' import PodcastEpisodeForm from './PodcastEpisodeForm' import { Toolbar, ToolbarLeft, ToolbarRight } from '../../Toolbar' import ConfirmButtom from '../../inputs/ConfirmButton' const NEW_LISTITEM_ID = 'new' const TYPE = 'Episode' const TYPE_PLURAL = 'Episodes' const mapStateToProps = (state) => { return { token: state.app.auth.token, listItem: state.app.podcastEpisodes.single, entities: { podcasts: state.app.entities.podcasts, remote: state.app.entities.podcastEpisodes, local: state.app.entities.local.podcastEpisodes, } } } const mapDispatchToProps = (dispatch) => { return { getPodcast: (token, podcastId) => { dispatch(podcastsActions.get(token, podcastId)) }, getListItem: (token, podcastEpisodeId) => { dispatch(podcastEpisodesActions.get(token, podcastEpisodeId)) }, setListItem: (podcastEpisode) => { dispatch(podcastEpisodesActions.set(podcastEpisode)) }, saveListItem: (token, podcastEpisodeId, data) => { dispatch(podcastEpisodesActions.save(token, podcastEpisodeId, data)) }, createListItem: (token, data, listRoute) => { dispatch(podcastEpisodesActions.create(token, data, listRoute)) }, deleteListItem: (token, podcastEpisodeId, next) => { dispatch(podcastEpisodesActions.delete(token, podcastEpisodeId, next)) } } } class PodcastEpisodeEditorComponent extends React.Component { componentDidMount() { this.props.getPodcast(this.props.token, this.props.podcastId) if (this.props.isNew) { // Create empty listItem this.props.setListItem({ id: NEW_LISTITEM_ID, podcast_id: this.props.podcastId }) } else { // Fetch listItem this.props.getListItem(this.props.token, this.props.episodeId) } if (this.props.route) { confirmNavigation( this.props.router, this.props.route, () => !this.props.listItem.isSaved ) } } componentDidUpdate(prevProps) { if (!this.props.isNew) { // Fetch listItem if (prevProps.episodeId !== this.props.episodeId) { this.props.getListItem(this.props.token, this.props.episodeId) } } } getListItem() { if (!this.props.entities.local) { // need to wait for GET call to complete return } if (this.props.isNew) { return this.props.entities.local[NEW_LISTITEM_ID] } else { return this.props.entities.local[this.props.episodeId] || R.path(['entities','remote',this.props.episodeId], this.props) || false } } saveListItem(listRoute) { if (this.props.isNew) { this.props.createListItem(this.props.token, this.getListItem(), listRoute) } else { this.props.saveListItem( this.props.token, this.props.episodeId, this.getListItem() ) } } handleUpdate(field, value) { this.props.setListItem(R.assoc(field, value, this.getListItem())) } handleBulkUpdate(data) { this.props.setListItem(R.merge(this.getListItem(), data)) } render() { const podcast = R.path(['podcasts', this.props.podcastId], this.props.entities) const listItem = this.getListItem() if (!podcast || !listItem) { return (<div>Loading</div>) } const listRoute = `/podcasts/${podcast.id}/episodes` const title = this.props.isNew ? `New ${TYPE }` : `Edit - ${listItem.title}` return ( <DocumentTitle title={title}> <div className='u-container-main'> <Toolbar> <ToolbarLeft> <ul className='bp3-breadcrumbs'> <li><Link className='bp3-breadcrumb' to='/podcasts/'>Podcasts</Link></li> <li><Link className='bp3-breadcrumb' to={`/podcasts/${podcast.id}`}>{podcast.title}</Link></li> <li><Link className='bp3-breadcrumb' to={listRoute}>{TYPE_PLURAL}</Link></li> <li><span className='bp3-breadcrumb bp3-breadcrumb-current'>{this.props.isNew ? `New ${TYPE}` : listItem.title}</span></li> </ul> </ToolbarLeft> <ToolbarRight> <Button intent={Intent.SUCCESS} icon='tick' onClick={() => this.saveListItem(listRoute)}>{this.props.isNew ? 'Save' : 'Update'}</Button> <ConfirmButtom intent={Intent.DANGER} icon='trash' disabled={this.props.isNew} onConfirm={() => this.props.deleteListItem(this.props.token, this.props.episodeId, this.props.listRoute)}>Delete</ConfirmButtom> </ToolbarRight> </Toolbar> <div className='u-container u-container--padded u-container--vscroll'> <PodcastEpisodeForm listItem={listItem} errors={this.props.listItem ? this.props.listItem.errors : {}} update={(field, value) => this.handleUpdate(field, value)} bulkUpdate={(data) => this.handleBulkUpdate(data)} settings={this.props.settings ? this.props.settings : {}} /> </div> </div> </DocumentTitle> ) } } const PodcastEpisodeEditor = connect( mapStateToProps, mapDispatchToProps )(PodcastEpisodeEditorComponent) export default withRouter(PodcastEpisodeEditor)
docs/src/pages/getting-started/templates/checkout/Checkout.js
kybarg/material-ui
import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import CssBaseline from '@material-ui/core/CssBaseline'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import Paper from '@material-ui/core/Paper'; import Stepper from '@material-ui/core/Stepper'; import Step from '@material-ui/core/Step'; import StepLabel from '@material-ui/core/StepLabel'; import Button from '@material-ui/core/Button'; import Link from '@material-ui/core/Link'; import Typography from '@material-ui/core/Typography'; import AddressForm from './AddressForm'; import PaymentForm from './PaymentForm'; import Review from './Review'; function Copyright() { return ( <Typography variant="body2" color="textSecondary" align="center"> {'Copyright © '} <Link color="inherit" href="https://material-ui.com/"> Your Website </Link>{' '} {new Date().getFullYear()} {'.'} </Typography> ); } const useStyles = makeStyles(theme => ({ appBar: { position: 'relative', }, layout: { width: 'auto', marginLeft: theme.spacing(2), marginRight: theme.spacing(2), [theme.breakpoints.up(600 + theme.spacing(2) * 2)]: { width: 600, marginLeft: 'auto', marginRight: 'auto', }, }, paper: { marginTop: theme.spacing(3), marginBottom: theme.spacing(3), padding: theme.spacing(2), [theme.breakpoints.up(600 + theme.spacing(3) * 2)]: { marginTop: theme.spacing(6), marginBottom: theme.spacing(6), padding: theme.spacing(3), }, }, stepper: { padding: theme.spacing(3, 0, 5), }, buttons: { display: 'flex', justifyContent: 'flex-end', }, button: { marginTop: theme.spacing(3), marginLeft: theme.spacing(1), }, })); const steps = ['Shipping address', 'Payment details', 'Review your order']; function getStepContent(step) { switch (step) { case 0: return <AddressForm />; case 1: return <PaymentForm />; case 2: return <Review />; default: throw new Error('Unknown step'); } } export default function Checkout() { const classes = useStyles(); const [activeStep, setActiveStep] = React.useState(0); const handleNext = () => { setActiveStep(activeStep + 1); }; const handleBack = () => { setActiveStep(activeStep - 1); }; return ( <React.Fragment> <CssBaseline /> <AppBar position="absolute" color="default" className={classes.appBar}> <Toolbar> <Typography variant="h6" color="inherit" noWrap> Company name </Typography> </Toolbar> </AppBar> <main className={classes.layout}> <Paper className={classes.paper}> <Typography component="h1" variant="h4" align="center"> Checkout </Typography> <Stepper activeStep={activeStep} className={classes.stepper}> {steps.map(label => ( <Step key={label}> <StepLabel>{label}</StepLabel> </Step> ))} </Stepper> <React.Fragment> {activeStep === steps.length ? ( <React.Fragment> <Typography variant="h5" gutterBottom> Thank you for your order. </Typography> <Typography variant="subtitle1"> Your order number is #2001539. We have emailed your order confirmation, and will send you an update when your order has shipped. </Typography> </React.Fragment> ) : ( <React.Fragment> {getStepContent(activeStep)} <div className={classes.buttons}> {activeStep !== 0 && ( <Button onClick={handleBack} className={classes.button}> Back </Button> )} <Button variant="contained" color="primary" onClick={handleNext} className={classes.button} > {activeStep === steps.length - 1 ? 'Place order' : 'Next'} </Button> </div> </React.Fragment> )} </React.Fragment> </Paper> <Copyright /> </main> </React.Fragment> ); }
src/components/Medal.js
Arunvirat/Logi-heroes
'use strict'; import React from 'react'; const typeMap = { 'G': 'Gold', 'S': 'Silver', 'B': 'Bronze' }; export default class Medal extends React.Component { render() { return ( <li className="medal"> <span className={`symbol symbol-${this.props.type}`} title={typeMap[this.props.type]}>{this.props.type}</span> <span className="year">{this.props.year}</span> <span className="city"> {this.props.city}</span> <span className="event"> ({this.props.event})</span> <span className="category"> {this.props.category} points</span> </li> ); } }
js/components/loaders/Spinner.ios.js
leehyoumin/asuraCham
/* @flow */ 'use strict'; import React from 'react'; import { ActivityIndicatorIOS, Platform } from 'react-native'; import NativeBaseComponent from 'native-base/Components/Base/NativeBaseComponent'; import computeProps from 'native-base/Utils/computeProps'; export default class SpinnerNB extends NativeBaseComponent { prepareRootProps() { var type = { height: 80 } var defaultProps = { style: type } return computeProps(this.props, defaultProps); } render() { return( <ActivityIndicatorIOS {...this.prepareRootProps()} color={this.props.color ? this.props.color : this.props.inverse ? this.getTheme().inverseSpinnerColor : this.getTheme().defaultSpinnerColor} size={this.props.size ? this.props.size : "large" } /> ); } }
src/icons/SocialYoutube.js
fbfeix/react-icons
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class SocialYoutube extends React.Component { render() { if(this.props.bare) { return <g> <g> <path d="M508.6,148.8c0-45-33.1-81.2-74-81.2C379.2,65,322.7,64,265,64c-3,0-6,0-9,0s-6,0-9,0c-57.6,0-114.2,1-169.6,3.6 c-40.8,0-73.9,36.4-73.9,81.4C1,184.6-0.1,220.2,0,255.8C-0.1,291.4,1,327,3.4,362.7c0,45,33.1,81.5,73.9,81.5 c58.2,2.7,117.9,3.9,178.6,3.8c60.8,0.2,120.3-1,178.6-3.8c40.9,0,74-36.5,74-81.5c2.4-35.7,3.5-71.3,3.4-107 C512.1,220.1,511,184.5,508.6,148.8z M207,353.9V157.4l145,98.2L207,353.9z"></path> </g> </g>; } return <IconBase> <g> <path d="M508.6,148.8c0-45-33.1-81.2-74-81.2C379.2,65,322.7,64,265,64c-3,0-6,0-9,0s-6,0-9,0c-57.6,0-114.2,1-169.6,3.6 c-40.8,0-73.9,36.4-73.9,81.4C1,184.6-0.1,220.2,0,255.8C-0.1,291.4,1,327,3.4,362.7c0,45,33.1,81.5,73.9,81.5 c58.2,2.7,117.9,3.9,178.6,3.8c60.8,0.2,120.3-1,178.6-3.8c40.9,0,74-36.5,74-81.5c2.4-35.7,3.5-71.3,3.4-107 C512.1,220.1,511,184.5,508.6,148.8z M207,353.9V157.4l145,98.2L207,353.9z"></path> </g> </IconBase>; } };SocialYoutube.defaultProps = {bare: false}
templates/rubix/demo/src/routes/Chartjs.js
jeffthemaximum/jeffline
import React from 'react'; import { Row, Col, Panel, PanelBody, PanelContainer, } from '@sketchpixy/rubix'; class ChartContainer extends React.Component { render() { return ( <PanelContainer> <Panel> <PanelBody style={{padding: 25}} className='text-center'> <h4>{this.props.name}</h4> <div><canvas id={this.props.id} width={this.props.width} height={this.props.height}></canvas></div> </PanelBody> </Panel> </PanelContainer> ); } } export default class Chartjs extends React.Component { constructor(props) { super(props); this.state = { legend: '' }; } componentDidMount() { (() => { var ctx = $("#line-chart").get(0).getContext("2d"); var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; new Chart(ctx).Line(data); })(); (() => { var ctx = $("#bar-chart").get(0).getContext("2d"); var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; new Chart(ctx).Bar(data); })(); (() => { var ctx = $("#pie-chart").get(0).getContext("2d"); var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ] new Chart(ctx).Pie(data); })(); (() => { var ctx = $("#donut-chart").get(0).getContext("2d"); var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ]; new Chart(ctx).Doughnut(data); })(); (() => { var ctx = $("#radar-chart").get(0).getContext("2d"); var data = { labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 90, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 96, 27, 100] } ] }; new Chart(ctx).Radar(data); })(); (() => { var ctx = $("#polar-chart").get(0).getContext("2d"); var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" }, { value: 40, color: "#949FB1", highlight: "#A8B3C5", label: "Grey" }, { value: 120, color: "#4D5360", highlight: "#616774", label: "Dark Grey" } ]; new Chart(ctx).PolarArea(data); })(); } render() { return ( <div> <Row> <Col sm={12}> <ChartContainer id='line-chart' height='75' width='250' name='Line Chart' /> <ChartContainer id='bar-chart' height='75' width='250' name='Bar Chart' /> <ChartContainer id='radar-chart' height='75' width='250' name='Radar Chart' /> <ChartContainer id='polar-chart' height='75' width='250' name='Polar Chart' /> <PanelContainer> <Panel> <PanelBody style={{padding: 25}} className='text-center'> <h4>Pie + Donut Chart</h4> <div style={{width: '50%', display: 'inline-block'}}><canvas id='pie-chart'></canvas></div> <div style={{width: '50%', display: 'inline-block'}}><canvas id='donut-chart'></canvas></div> </PanelBody> </Panel> </PanelContainer> </Col> </Row> </div> ); } }
src/js/components/Artists.js
rmhowe/search-ui
import React from 'react'; import ArtistListItem from './ArtistListItem'; import ArtistMap from './ArtistMap'; export default class Artists extends React.Component { static propTypes = { artists: React.PropTypes.object.isRequired, filters: React.PropTypes.object.isRequired, orderBy: React.PropTypes.object.isRequired, showMap: React.PropTypes.bool.isRequired, limit: React.PropTypes.number.isRequired } getFilteredArtists() { const { artists, filters } = this.props; const [minAge, maxAge] = filters.get('age').toJS(); const [minRate, maxRate] = filters.get('rate').toJS(); return artists.filter((artist) => { return artist.get('age') >= minAge && artist.get('age') <= maxAge && artist.get('rate') >= minRate && artist.get('rate') <= maxRate && filters.getIn(['gender', artist.get('gender')]); }); } orderArtistList(artists) { const { orderBy } = this.props; const value = orderBy.get('value'); const ascending = orderBy.get('ascending'); if (value && ascending) { return artists.sort((artistA, artistB) => { return artistA.get(value) - artistB.get(value); }); } else if (value && !ascending) { return artists.sort((artistA, artistB) => { return artistB.get(value) - artistA.get(value); }); } else { return artists; } } generateArtistList(artists) { return artists.map((artist) => { return ( <ArtistListItem key={artist.get('uuid')} gender={artist.get('gender')} age={artist.get('age')} rate={artist.get('rate')} longitude={artist.get('longitude')} latitude={artist.get('latitude')} /> ); }); } generateArtistMap(artists) { return ( <ArtistMap artists={artists} /> ); } getLimitMessage(filteredArtists) { if (filteredArtists.size > this.props.limit) { return ( <div ref="limitMessage" className="artists__limit-message"> Displaying {this.props.limit} of {filteredArtists.size} possible results, try a more specific search to see the remaining results </div> ); } } render() { const filteredArtists = this.getFilteredArtists(); const limitMessage = this.getLimitMessage(filteredArtists); const limitedFilteredArtists = filteredArtists.take(this.props.limit); let content; if (this.props.showMap) { content = this.generateArtistMap(limitedFilteredArtists); } else { const orderedArtists = this.orderArtistList(limitedFilteredArtists); content = this.generateArtistList(orderedArtists); } return ( <div className="artists"> {limitMessage} {content} </div> ); } }
src/components/collection/types/Attack.js
chaoticbackup/chaoticbackup.github.io
import { observer, inject } from 'mobx-react'; import React from 'react'; import { FlavorText, Rarity, Unique, Name, ElementIcon, Ability, AttackIcon } from '../../Snippets'; import API from '../../SpreadsheetData'; import { Thumbnail } from './helpers'; @inject((stores, props, context) => props) @observer export default class Attack extends React.Component { render() { const { card } = this.props; if (this.props.ext == false) return ( <div className="card attack"> <Thumbnail {...this.props} /> <div className="left"> <Name name={card.gsx$name} /> <Rarity set={card.gsx$set} rarity={card.gsx$rarity} /> <span><AttackIcon bp={card.gsx$bp} /> Attack - {card.gsx$bp}</span><br /> <div> <span className="bp bigger" >{card.gsx$base}</span> |&nbsp; <ElementIcon element="fire" value={card.gsx$fire} />{card.gsx$fire}&nbsp; <ElementIcon element="air" value={card.gsx$air} />{card.gsx$air}&nbsp; <ElementIcon element="earth" value={card.gsx$earth} />{card.gsx$earth}&nbsp; <ElementIcon element="water" value={card.gsx$water} />{card.gsx$water} </div> </div> <br /> <div className="right" > <Ability ability={card.gsx$ability} /> <Unique data={{ unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary }} /> <FlavorText flavortext={card.gsx$flavortext} /> </div> </div> ); else return ( <div className="card attack"> <div className="fullcard"><img src={API.cardImage(card)} width="250px" height="350px" /></div> <div className="right"> <Name name={card.gsx$name} /> <Rarity set={card.gsx$set} rarity={card.gsx$rarity} id={card.gsx$id} /> <Ability ability={card.gsx$ability} /> <Unique data={{ unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary }} /> <FlavorText flavortext={card.gsx$flavortext} /> <div>Art By: {card.gsx$artist}</div> </div> </div> ); } }
utils/typography.js
Slava/ats-website
import ReactDOM from 'react-dom/server' import React from 'react' import Typography from 'typography' import { GoogleFont } from 'react-typography' import CodePlugin from 'typography-plugin-code' const options = { googleFonts: [ { name: 'Montserrat', styles: [ '700', ], }, { name: 'Arvo', styles: [ '400', '400i', '700', ], }, ], headerFontFamily: ['Montserrat', 'sans-serif'], bodyFontFamily: ['Arvo', 'sans-serif'], baseFontSize: '18px', baseLineHeight: 1.65, scaleRatio: 2.25, plugins: [ new CodePlugin(), ], } const typography = new Typography(options) // Hot reload typography in development. if (process.env.NODE_ENV !== 'production') { typography.injectStyles() if (typeof document !== 'undefined') { const googleFonts = ReactDOM.renderToStaticMarkup( React.createFactory(GoogleFont)({ typography }) ) const head = document.getElementsByTagName('head')[0] head.insertAdjacentHTML('beforeend', googleFonts) } } export default typography
ajax/libs/react/0.5.1/react-with-addons.js
artpolikarpov/cdnjs
/** * React (with addons) v0.5.1 */ !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.React=e():"undefined"!=typeof global?global.React=e():"undefined"!=typeof self&&(self.React=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<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule $ * @typechecks */ var ge = require("./ge"); var ex = require("./ex"); /** * Find a node by ID. * * If your application code depends on the existence of the element, use $, * which will throw if the element doesn't exist. * * If you're not sure whether or not the element exists, use ge instead, and * manually check for the element's existence in your application code. * * @param {string|DOMDocument|DOMElement|DOMTextNode|Comment} id * @return {DOMDocument|DOMElement|DOMTextNode|Comment} */ function $(id) { var element = ge(id); if (!element) { throw new Error(ex( 'Tried to get element with id of "%s" but it is not present on the page.', id )); } return element; } module.exports = $; },{"./ex":94,"./ge":98}],2:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule CSSCore * @typechecks */ var invariant = require("./invariant"); /** * The CSSCore module specifies the API (and implements most of the methods) * that should be used when dealing with the display of elements (via their * CSS classes and visibility on screeni. It is an API focused on mutating the * display and not reading it as no logical state should be encoded in the * display of elements. */ /** * Tests whether the element has the class specified. * * Note: This function is not exported in CSSCore because CSS classNames should * not store any logical information about the element. Use DataStore to store * information on an element. * * @param {DOMElement} element the element to set the class on * @param {string} className the CSS className * @returns {boolean} true if the element has the class, false if not */ function hasClass(element, className) { if (element.classList) { return !!className && element.classList.contains(className); } return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; } var CSSCore = { /** * Adds the class passed in to the element if it doesn't already have it. * * @param {DOMElement} element the element to set the class on * @param {string} className the CSS className * @return {DOMElement} the element passed in */ addClass: function(element, className) { invariant( !/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className ); if (className) { if (element.classList) { element.classList.add(className); } else if (!hasClass(element, className)) { element.className = element.className + ' ' + className; } } return element; }, /** * Removes the class passed in from the element * * @param {DOMElement} element the element to set the class on * @param {string} className the CSS className * @return {DOMElement} the element passed in */ removeClass: function(element, className) { invariant( !/\s/.test(className), 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className ); if (className) { if (element.classList) { element.classList.remove(className); } else if (hasClass(element, className)) { element.className = element.className .replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1') .replace(/\s+/g, ' ') // multiple spaces to one .replace(/^\s*|\s*$/g, ''); // trim the ends } } return element; }, /** * Helper to add or remove a class from an element based on a condition. * * @param {DOMElement} element the element to set the class on * @param {string} className the CSS className * @param {*} bool condition to whether to add or remove the class * @return {DOMElement} the element passed in */ conditionClass: function(element, className, bool) { return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); } }; module.exports = CSSCore; },{"./invariant":106}],3:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule CSSProperty */ "use strict"; /** * CSS properties which accept numbers but are not in units of "px". */ var isUnitlessNumber = { fillOpacity: true, fontWeight: true, lineHeight: true, opacity: true, orphans: true, zIndex: true, zoom: true }; /** * Most style properties can be unset by doing .style[prop] = '' but IE8 * doesn't like doing that with shorthand properties so for the properties that * IE8 breaks on, which are listed here, we instead unset each of the * individual properties. See http://bugs.jquery.com/ticket/12385. * The 4-value 'clock' properties like margin, padding, border-width seem to * behave without any problems. Curiously, list-style works too without any * special prodding. */ var shorthandPropertyExpansions = { background: { backgroundImage: true, backgroundPosition: true, backgroundRepeat: true, backgroundColor: true }, border: { borderWidth: true, borderStyle: true, borderColor: true }, borderBottom: { borderBottomWidth: true, borderBottomStyle: true, borderBottomColor: true }, borderLeft: { borderLeftWidth: true, borderLeftStyle: true, borderLeftColor: true }, borderRight: { borderRightWidth: true, borderRightStyle: true, borderRightColor: true }, borderTop: { borderTopWidth: true, borderTopStyle: true, borderTopColor: true }, font: { fontStyle: true, fontVariant: true, fontWeight: true, fontSize: true, lineHeight: true, fontFamily: true } }; var CSSProperty = { isUnitlessNumber: isUnitlessNumber, shorthandPropertyExpansions: shorthandPropertyExpansions }; module.exports = CSSProperty; },{}],4:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule CSSPropertyOperations * @typechecks static-only */ "use strict"; var CSSProperty = require("./CSSProperty"); var dangerousStyleValue = require("./dangerousStyleValue"); var escapeTextForBrowser = require("./escapeTextForBrowser"); var hyphenate = require("./hyphenate"); var memoizeStringOnly = require("./memoizeStringOnly"); var processStyleName = memoizeStringOnly(function(styleName) { return escapeTextForBrowser(hyphenate(styleName)); }); /** * Operations for dealing with CSS properties. */ var CSSPropertyOperations = { /** * Serializes a mapping of style properties for use as inline styles: * * > createMarkupForStyles({width: '200px', height: 0}) * "width:200px;height:0;" * * Undefined values are ignored so that declarative programming is easier. * * @param {object} styles * @return {?string} */ createMarkupForStyles: function(styles) { var serialized = ''; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = styles[styleName]; if (styleValue != null) { serialized += processStyleName(styleName) + ':'; serialized += dangerousStyleValue(styleName, styleValue) + ';'; } } return serialized || null; }, /** * Sets the value for multiple styles on a node. If a value is specified as * '' (empty string), the corresponding style property will be unset. * * @param {DOMElement} node * @param {object} styles */ setValueForStyles: function(node, styles) { var style = node.style; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = dangerousStyleValue(styleName, styles[styleName]); if (styleValue) { style[styleName] = styleValue; } else { var expansion = CSSProperty.shorthandPropertyExpansions[styleName]; if (expansion) { // Shorthand property that IE8 won't like unsetting, so unset each // component to placate it for (var individualStyleName in expansion) { style[individualStyleName] = ''; } } else { style[styleName] = ''; } } } } }; module.exports = CSSPropertyOperations; },{"./CSSProperty":3,"./dangerousStyleValue":91,"./escapeTextForBrowser":93,"./hyphenate":105,"./memoizeStringOnly":114}],5:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule CallbackRegistry * @typechecks static-only */ "use strict"; var listenerBank = {}; /** * Stores "listeners" by `registrationName`/`id`. There should be at most one * "listener" per `registrationName`/`id` in the `listenerBank`. * * Access listeners via `listenerBank[registrationName][id]`. * * @class CallbackRegistry * @internal */ var CallbackRegistry = { /** * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent. * * @param {string} id ID of the DOM element. * @param {string} registrationName Name of listener (e.g. `onClick`). * @param {?function} listener The callback to store. */ putListener: function(id, registrationName, listener) { var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); bankForRegistrationName[id] = listener; }, /** * @param {string} id ID of the DOM element. * @param {string} registrationName Name of listener (e.g. `onClick`). * @return {?function} The stored callback. */ getListener: function(id, registrationName) { var bankForRegistrationName = listenerBank[registrationName]; return bankForRegistrationName && bankForRegistrationName[id]; }, /** * Deletes a listener from the registration bank. * * @param {string} id ID of the DOM element. * @param {string} registrationName Name of listener (e.g. `onClick`). */ deleteListener: function(id, registrationName) { var bankForRegistrationName = listenerBank[registrationName]; if (bankForRegistrationName) { delete bankForRegistrationName[id]; } }, /** * Deletes all listeners for the DOM element with the supplied ID. * * @param {string} id ID of the DOM element. */ deleteAllListeners: function(id) { for (var registrationName in listenerBank) { delete listenerBank[registrationName][id]; } }, /** * This is needed for tests only. Do not use! */ __purge: function() { listenerBank = {}; } }; module.exports = CallbackRegistry; },{}],6:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ChangeEventPlugin */ "use strict"; var EventConstants = require("./EventConstants"); var EventPluginHub = require("./EventPluginHub"); var EventPropagators = require("./EventPropagators"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var SyntheticEvent = require("./SyntheticEvent"); var isEventSupported = require("./isEventSupported"); var isTextInputElement = require("./isTextInputElement"); var keyOf = require("./keyOf"); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { change: { phasedRegistrationNames: { bubbled: keyOf({onChange: null}), captured: keyOf({onChangeCapture: null}) } } }; /** * For IE shims */ var activeElement = null; var activeElementID = null; var activeElementValue = null; var activeElementValueProp = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { return ( elem.nodeName === 'SELECT' || (elem.nodeName === 'INPUT' && elem.type === 'file') ); } var doesChangeEventBubble = false; if (ExecutionEnvironment.canUseDOM) { // See `handleChange` comment below doesChangeEventBubble = isEventSupported('change') && ( !('documentMode' in document) || document.documentMode > 8 ); } function manualDispatchChangeEvent(nativeEvent) { var event = SyntheticEvent.getPooled( eventTypes.change, activeElementID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); // If change bubbled, we'd just bind to it like all the other events // and have it go through ReactEventTopLevelCallback. Since it doesn't, we // manually listen for the change event and so we have to enqueue and // process the abstract event manually. EventPluginHub.enqueueEvents(event); EventPluginHub.processEventQueue(); } function startWatchingForChangeEventIE8(target, targetID) { activeElement = target; activeElementID = targetID; activeElement.attachEvent('onchange', manualDispatchChangeEvent); } function stopWatchingForChangeEventIE8() { if (!activeElement) { return; } activeElement.detachEvent('onchange', manualDispatchChangeEvent); activeElement = null; activeElementID = null; } function getTargetIDForChangeEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topChange) { return topLevelTargetID; } } function handleEventsForChangeEventIE8( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForChangeEventIE8(); startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForChangeEventIE8(); } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (ExecutionEnvironment.canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events isInputEventSupported = isEventSupported('input') && ( !('documentMode' in document) || document.documentMode > 9 ); } /** * (For old IE.) Replacement getter/setter for the `value` property that gets * set on the active element. */ var newValueProp = { get: function() { return activeElementValueProp.get.call(this); }, set: function(val) { // Cast to a string so we can do equality checks. activeElementValue = '' + val; activeElementValueProp.set.call(this, val); } }; /** * (For old IE.) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetID) { activeElement = target; activeElementID = targetID; activeElementValue = target.value; activeElementValueProp = Object.getOwnPropertyDescriptor( target.constructor.prototype, 'value' ); Object.defineProperty(activeElement, 'value', newValueProp); activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** * (For old IE.) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } // delete restores the original property definition delete activeElement.value; activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementID = null; activeElementValue = null; activeElementValueProp = null; } /** * (For old IE.) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } var value = nativeEvent.srcElement.value; if (value === activeElementValue) { return; } activeElementValue = value; manualDispatchChangeEvent(nativeEvent); } /** * If a `change` event should be fired, returns the target's ID. */ function getTargetIDForInputEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topInput) { // In modern browsers (i.e., not IE8 or IE9), the input event is exactly // what we want so fall through here and trigger an abstract event return topLevelTargetID; } } // For IE8 and IE9. function handleEventsForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // In IE8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyName // equal to 'value' // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetIDForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. if (activeElement && activeElement.value !== activeElementValue) { activeElementValue = activeElement.value; return activeElementID; } } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. return ( elem.nodeName === 'INPUT' && (elem.type === 'checkbox' || elem.type === 'radio') ); } function getTargetIDForClickEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topClick) { return topLevelTargetID; } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - select */ var ChangeEventPlugin = { eventTypes: eventTypes, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var getTargetIDFunc, handleEventFunc; if (shouldUseChangeEvent(topLevelTarget)) { if (doesChangeEventBubble) { getTargetIDFunc = getTargetIDForChangeEvent; } else { handleEventFunc = handleEventsForChangeEventIE8; } } else if (isTextInputElement(topLevelTarget)) { if (isInputEventSupported) { getTargetIDFunc = getTargetIDForInputEvent; } else { getTargetIDFunc = getTargetIDForInputEventIE; handleEventFunc = handleEventsForInputEventIE; } } else if (shouldUseClickEvent(topLevelTarget)) { getTargetIDFunc = getTargetIDForClickEvent; } if (getTargetIDFunc) { var targetID = getTargetIDFunc( topLevelType, topLevelTarget, topLevelTargetID ); if (targetID) { var event = SyntheticEvent.getPooled( eventTypes.change, targetID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); return event; } } if (handleEventFunc) { handleEventFunc( topLevelType, topLevelTarget, topLevelTargetID ); } } }; module.exports = ChangeEventPlugin; },{"./EventConstants":15,"./EventPluginHub":17,"./EventPropagators":20,"./ExecutionEnvironment":21,"./SyntheticEvent":75,"./isEventSupported":107,"./isTextInputElement":109,"./keyOf":113}],7:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule CompositionEventPlugin * @typechecks static-only */ "use strict"; var EventConstants = require("./EventConstants"); var EventPropagators = require("./EventPropagators"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var ReactInputSelection = require("./ReactInputSelection"); var SyntheticCompositionEvent = require("./SyntheticCompositionEvent"); var getTextContentAccessor = require("./getTextContentAccessor"); var keyOf = require("./keyOf"); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; var useCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; var topLevelTypes = EventConstants.topLevelTypes; var currentComposition = null; // Events and their corresponding property names. var eventTypes = { compositionEnd: { phasedRegistrationNames: { bubbled: keyOf({onCompositionEnd: null}), captured: keyOf({onCompositionEndCapture: null}) } }, compositionStart: { phasedRegistrationNames: { bubbled: keyOf({onCompositionStart: null}), captured: keyOf({onCompositionStartCapture: null}) } }, compositionUpdate: { phasedRegistrationNames: { bubbled: keyOf({onCompositionUpdate: null}), captured: keyOf({onCompositionUpdateCapture: null}) } } }; /** * Translate native top level events into event types. * * @param {string} topLevelType * @return {object} */ function getCompositionEventType(topLevelType) { switch (topLevelType) { case topLevelTypes.topCompositionStart: return eventTypes.compositionStart; case topLevelTypes.topCompositionEnd: return eventTypes.compositionEnd; case topLevelTypes.topCompositionUpdate: return eventTypes.compositionUpdate; } } /** * Does our fallback best-guess model think this event signifies that * composition has begun? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean} */ function isFallbackStart(topLevelType, nativeEvent) { return ( topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE ); } /** * Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean} */ function isFallbackEnd(topLevelType, nativeEvent) { switch (topLevelType) { case topLevelTypes.topKeyUp: // Command keys insert or clear IME input. return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1); case topLevelTypes.topKeyDown: // Expect IME keyCode on each keydown. If we get any other // code we must have exited earlier. return (nativeEvent.keyCode !== START_KEYCODE); case topLevelTypes.topKeyPress: case topLevelTypes.topMouseDown: case topLevelTypes.topBlur: // Events are not possible without cancelling IME. return true; default: return false; } } /** * Helper class stores information about selection and document state * so we can figure out what changed at a later date. * * @param {DOMEventTarget} root */ function FallbackCompositionState(root) { this.root = root; this.startSelection = ReactInputSelection.getSelection(root); this.startValue = this.getText(); } /** * Get current text of input. * * @return {string} */ FallbackCompositionState.prototype.getText = function() { return this.root.value || this.root[getTextContentAccessor()]; }; /** * Text that has changed since the start of composition. * * @return {string} */ FallbackCompositionState.prototype.getData = function() { var endValue = this.getText(); var prefixLength = this.startSelection.start; var suffixLength = this.startValue.length - this.startSelection.end; return endValue.substr( prefixLength, endValue.length - suffixLength - prefixLength ); }; /** * This plugin creates `onCompositionStart`, `onCompositionUpdate` and * `onCompositionEnd` events on inputs, textareas and contentEditable * nodes. */ var CompositionEventPlugin = { eventTypes: eventTypes, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var eventType; var data; if (useCompositionEvent) { eventType = getCompositionEventType(topLevelType); } else if (!currentComposition) { if (isFallbackStart(topLevelType, nativeEvent)) { eventType = eventTypes.start; currentComposition = new FallbackCompositionState(topLevelTarget); } } else if (isFallbackEnd(topLevelType, nativeEvent)) { eventType = eventTypes.compositionEnd; data = currentComposition.getData(); currentComposition = null; } if (eventType) { var event = SyntheticCompositionEvent.getPooled( eventType, topLevelTargetID, nativeEvent ); if (data) { // Inject data generated from fallback path into the synthetic event. // This matches the property of native CompositionEventInterface. event.data = data; } EventPropagators.accumulateTwoPhaseDispatches(event); return event; } } }; module.exports = CompositionEventPlugin; },{"./EventConstants":15,"./EventPropagators":20,"./ExecutionEnvironment":21,"./ReactInputSelection":49,"./SyntheticCompositionEvent":74,"./getTextContentAccessor":104,"./keyOf":113}],8:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule DOMChildrenOperations * @typechecks static-only */ "use strict"; var Danger = require("./Danger"); var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes"); var getTextContentAccessor = require("./getTextContentAccessor"); /** * The DOM property to use when setting text content. * * @type {string} * @private */ var textContentAccessor = getTextContentAccessor() || 'NA'; /** * Inserts `childNode` as a child of `parentNode` at the `index`. * * @param {DOMElement} parentNode Parent node in which to insert. * @param {DOMElement} childNode Child node to insert. * @param {number} index Index at which to insert the child. * @internal */ function insertChildAt(parentNode, childNode, index) { var childNodes = parentNode.childNodes; if (childNodes[index] === childNode) { return; } // If `childNode` is already a child of `parentNode`, remove it so that // computing `childNodes[index]` takes into account the removal. if (childNode.parentNode === parentNode) { parentNode.removeChild(childNode); } if (index >= childNodes.length) { parentNode.appendChild(childNode); } else { parentNode.insertBefore(childNode, childNodes[index]); } } /** * Operations for updating with DOM children. */ var DOMChildrenOperations = { dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup, /** * Updates a component's children by processing a series of updates. The * update configurations are each expected to have a `parentNode` property. * * @param {array<object>} updates List of update configurations. * @param {array<string>} markupList List of markup strings. * @internal */ processUpdates: function(updates, markupList) { var update; // Mapping from parent IDs to initial child orderings. var initialChildren = null; // List of children that will be moved or removed. var updatedChildren = null; for (var i = 0; update = updates[i]; i++) { if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { var updatedIndex = update.fromIndex; var updatedChild = update.parentNode.childNodes[updatedIndex]; var parentID = update.parentID; initialChildren = initialChildren || {}; initialChildren[parentID] = initialChildren[parentID] || []; initialChildren[parentID][updatedIndex] = updatedChild; updatedChildren = updatedChildren || []; updatedChildren.push(updatedChild); } } var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); // Remove updated children first so that `toIndex` is consistent. if (updatedChildren) { for (var j = 0; j < updatedChildren.length; j++) { updatedChildren[j].parentNode.removeChild(updatedChildren[j]); } } for (var k = 0; update = updates[k]; k++) { switch (update.type) { case ReactMultiChildUpdateTypes.INSERT_MARKUP: insertChildAt( update.parentNode, renderedMarkup[update.markupIndex], update.toIndex ); break; case ReactMultiChildUpdateTypes.MOVE_EXISTING: insertChildAt( update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex ); break; case ReactMultiChildUpdateTypes.TEXT_CONTENT: update.parentNode[textContentAccessor] = update.textContent; break; case ReactMultiChildUpdateTypes.REMOVE_NODE: // Already removed by the for-loop above. break; } } } }; module.exports = DOMChildrenOperations; },{"./Danger":11,"./ReactMultiChildUpdateTypes":56,"./getTextContentAccessor":104}],9:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule DOMProperty * @typechecks static-only */ /*jslint bitwise: true */ "use strict"; var invariant = require("./invariant"); var DOMPropertyInjection = { /** * Mapping from normalized, camelcased property names to a configuration that * specifies how the associated DOM property should be accessed or rendered. */ MUST_USE_ATTRIBUTE: 0x1, MUST_USE_PROPERTY: 0x2, HAS_BOOLEAN_VALUE: 0x4, HAS_SIDE_EFFECTS: 0x8, /** * Inject some specialized knowledge about the DOM. This takes a config object * with the following properties: * * isCustomAttribute: function that given an attribute name will return true * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* * attributes where it's impossible to enumerate all of the possible * attribute names, * * Properties: object mapping DOM property name to one of the * DOMPropertyInjection constants or null. If your attribute isn't in here, * it won't get written to the DOM. * * DOMAttributeNames: object mapping React attribute name to the DOM * attribute name. Attribute names not specified use the **lowercase** * normalized name. * * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. * Property names not specified use the normalized name. * * DOMMutationMethods: Properties that require special mutation methods. If * `value` is undefined, the mutation method should unset the property. * * @param {object} domPropertyConfig the config as described above. */ injectDOMPropertyConfig: function(domPropertyConfig) { var Properties = domPropertyConfig.Properties || {}; var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; if (domPropertyConfig.isCustomAttribute) { DOMProperty._isCustomAttributeFunctions.push( domPropertyConfig.isCustomAttribute ); } for (var propName in Properties) { invariant( !DOMProperty.isStandardName[propName], 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName ); DOMProperty.isStandardName[propName] = true; var lowerCased = propName.toLowerCase(); DOMProperty.getPossibleStandardName[lowerCased] = propName; var attributeName = DOMAttributeNames[propName]; if (attributeName) { DOMProperty.getPossibleStandardName[attributeName] = propName; } DOMProperty.getAttributeName[propName] = attributeName || lowerCased; DOMProperty.getPropertyName[propName] = DOMPropertyNames[propName] || propName; var mutationMethod = DOMMutationMethods[propName]; if (mutationMethod) { DOMProperty.getMutationMethod[propName] = mutationMethod; } var propConfig = Properties[propName]; DOMProperty.mustUseAttribute[propName] = propConfig & DOMPropertyInjection.MUST_USE_ATTRIBUTE; DOMProperty.mustUseProperty[propName] = propConfig & DOMPropertyInjection.MUST_USE_PROPERTY; DOMProperty.hasBooleanValue[propName] = propConfig & DOMPropertyInjection.HAS_BOOLEAN_VALUE; DOMProperty.hasSideEffects[propName] = propConfig & DOMPropertyInjection.HAS_SIDE_EFFECTS; invariant( !DOMProperty.mustUseAttribute[propName] || !DOMProperty.mustUseProperty[propName], 'DOMProperty: Cannot use require using both attribute and property: %s', propName ); invariant( DOMProperty.mustUseProperty[propName] || !DOMProperty.hasSideEffects[propName], 'DOMProperty: Properties that have side effects must use property: %s', propName ); } } }; var defaultValueCache = {}; /** * DOMProperty exports lookup objects that can be used like functions: * * > DOMProperty.isValid['id'] * true * > DOMProperty.isValid['foobar'] * undefined * * Although this may be confusing, it performs better in general. * * @see http://jsperf.com/key-exists * @see http://jsperf.com/key-missing */ var DOMProperty = { /** * Checks whether a property name is a standard property. * @type {Object} */ isStandardName: {}, /** * Mapping from lowercase property names to the properly cased version, used * to warn in the case of missing properties. * @type {Object} */ getPossibleStandardName: {}, /** * Mapping from normalized names to attribute names that differ. Attribute * names are used when rendering markup or with `*Attribute()`. * @type {Object} */ getAttributeName: {}, /** * Mapping from normalized names to properties on DOM node instances. * (This includes properties that mutate due to external factors.) * @type {Object} */ getPropertyName: {}, /** * Mapping from normalized names to mutation methods. This will only exist if * mutation cannot be set simply by the property or `setAttribute()`. * @type {Object} */ getMutationMethod: {}, /** * Whether the property must be accessed and mutated as an object property. * @type {Object} */ mustUseAttribute: {}, /** * Whether the property must be accessed and mutated using `*Attribute()`. * (This includes anything that fails `<propName> in <element>`.) * @type {Object} */ mustUseProperty: {}, /** * Whether the property should be removed when set to a falsey value. * @type {Object} */ hasBooleanValue: {}, /** * Whether or not setting a value causes side effects such as triggering * resources to be loaded or text selection changes. We must ensure that * the value is only set if it has changed. * @type {Object} */ hasSideEffects: {}, /** * All of the isCustomAttribute() functions that have been injected. */ _isCustomAttributeFunctions: [], /** * Checks whether a property name is a custom attribute. * @method */ isCustomAttribute: function(attributeName) { return DOMProperty._isCustomAttributeFunctions.some( function(isCustomAttributeFn) { return isCustomAttributeFn.call(null, attributeName); } ); }, /** * Returns the default property value for a DOM property (i.e., not an * attribute). Most default values are '' or false, but not all. Worse yet, * some (in particular, `type`) vary depending on the type of element. * * TODO: Is it better to grab all the possible properties when creating an * element to avoid having to create the same element twice? */ getDefaultValueForProperty: function(nodeName, prop) { var nodeDefaults = defaultValueCache[nodeName]; var testElement; if (!nodeDefaults) { defaultValueCache[nodeName] = nodeDefaults = {}; } if (!(prop in nodeDefaults)) { testElement = document.createElement(nodeName); nodeDefaults[prop] = testElement[prop]; } return nodeDefaults[prop]; }, injection: DOMPropertyInjection }; module.exports = DOMProperty; },{"./invariant":106}],10:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule DOMPropertyOperations * @typechecks static-only */ "use strict"; var DOMProperty = require("./DOMProperty"); var escapeTextForBrowser = require("./escapeTextForBrowser"); var memoizeStringOnly = require("./memoizeStringOnly"); var processAttributeNameAndPrefix = memoizeStringOnly(function(name) { return escapeTextForBrowser(name) + '="'; }); if (true) { var reactProps = { __owner__: true, children: true, dangerouslySetInnerHTML: true, key: true, ref: true }; var warnedProperties = {}; var warnUnknownProperty = function(name) { if (reactProps[name] || warnedProperties[name]) { return; } warnedProperties[name] = true; var lowerCasedName = name.toLowerCase(); // data-* attributes should be lowercase; suggest the lowercase version var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName[lowerCasedName]; // For now, only warn when we have a suggested correction. This prevents // logging too much when using transferPropsTo. if (standardName != null) { console.warn( 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?' ); } }; } /** * Operations for dealing with DOM properties. */ var DOMPropertyOperations = { /** * Creates markup for a property. * * @param {string} name * @param {*} value * @return {?string} Markup string, or null if the property was invalid. */ createMarkupForProperty: function(name, value) { if (DOMProperty.isStandardName[name]) { if (value == null || DOMProperty.hasBooleanValue[name] && !value) { return ''; } var attributeName = DOMProperty.getAttributeName[name]; return processAttributeNameAndPrefix(attributeName) + escapeTextForBrowser(value) + '"'; } else if (DOMProperty.isCustomAttribute(name)) { if (value == null) { return ''; } return processAttributeNameAndPrefix(name) + escapeTextForBrowser(value) + '"'; } else if (true) { warnUnknownProperty(name); } return null; }, /** * Sets the value for a property on a node. * * @param {DOMElement} node * @param {string} name * @param {*} value */ setValueForProperty: function(node, name, value) { if (DOMProperty.isStandardName[name]) { var mutationMethod = DOMProperty.getMutationMethod[name]; if (mutationMethod) { mutationMethod(node, value); } else if (DOMProperty.mustUseAttribute[name]) { if (DOMProperty.hasBooleanValue[name] && !value) { node.removeAttribute(DOMProperty.getAttributeName[name]); } else { node.setAttribute(DOMProperty.getAttributeName[name], '' + value); } } else { var propName = DOMProperty.getPropertyName[name]; if (!DOMProperty.hasSideEffects[name] || node[propName] !== value) { node[propName] = value; } } } else if (DOMProperty.isCustomAttribute(name)) { node.setAttribute(name, '' + value); } else if (true) { warnUnknownProperty(name); } }, /** * Deletes the value for a property on a node. * * @param {DOMElement} node * @param {string} name */ deleteValueForProperty: function(node, name) { if (DOMProperty.isStandardName[name]) { var mutationMethod = DOMProperty.getMutationMethod[name]; if (mutationMethod) { mutationMethod(node, undefined); } else if (DOMProperty.mustUseAttribute[name]) { node.removeAttribute(DOMProperty.getAttributeName[name]); } else { var propName = DOMProperty.getPropertyName[name]; node[propName] = DOMProperty.getDefaultValueForProperty( node.nodeName, name ); } } else if (DOMProperty.isCustomAttribute(name)) { node.removeAttribute(name); } else if (true) { warnUnknownProperty(name); } } }; module.exports = DOMPropertyOperations; },{"./DOMProperty":9,"./escapeTextForBrowser":93,"./memoizeStringOnly":114}],11:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule Danger * @typechecks static-only */ /*jslint evil: true, sub: true */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); var createNodesFromMarkup = require("./createNodesFromMarkup"); var emptyFunction = require("./emptyFunction"); var getMarkupWrap = require("./getMarkupWrap"); var invariant = require("./invariant"); var mutateHTMLNodeWithMarkup = require("./mutateHTMLNodeWithMarkup"); var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; var RESULT_INDEX_ATTR = 'data-danger-index'; /** * Extracts the `nodeName` from a string of markup. * * NOTE: Extracting the `nodeName` does not require a regular expression match * because we make assumptions about React-generated markup (i.e. there are no * spaces surrounding the opening tag and there is at least one attribute). * * @param {string} markup String of markup. * @return {string} Node name of the supplied markup. * @see http://jsperf.com/extract-nodename */ function getNodeName(markup) { return markup.substring(1, markup.indexOf(' ')); } var Danger = { /** * Renders markup into an array of nodes. The markup is expected to render * into a list of root nodes. Also, the length of `resultList` and * `markupList` should be the same. * * @param {array<string>} markupList List of markup strings to render. * @return {array<DOMElement>} List of rendered nodes. * @internal */ dangerouslyRenderMarkup: function(markupList) { invariant( ExecutionEnvironment.canUseDOM, 'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' + 'thread. This is likely a bug in the framework. Please report ' + 'immediately.' ); var nodeName; var markupByNodeName = {}; // Group markup by `nodeName` if a wrap is necessary, else by '*'. for (var i = 0; i < markupList.length; i++) { invariant( markupList[i], 'dangerouslyRenderMarkup(...): Missing markup.' ); nodeName = getNodeName(markupList[i]); nodeName = getMarkupWrap(nodeName) ? nodeName : '*'; markupByNodeName[nodeName] = markupByNodeName[nodeName] || []; markupByNodeName[nodeName][i] = markupList[i]; } var resultList = []; var resultListAssignmentCount = 0; for (nodeName in markupByNodeName) { if (!markupByNodeName.hasOwnProperty(nodeName)) { continue; } var markupListByNodeName = markupByNodeName[nodeName]; // This for-in loop skips the holes of the sparse array. The order of // iteration should follow the order of assignment, which happens to match // numerical index order, but we don't rely on that. for (var resultIndex in markupListByNodeName) { if (markupListByNodeName.hasOwnProperty(resultIndex)) { var markup = markupListByNodeName[resultIndex]; // Push the requested markup with an additional RESULT_INDEX_ATTR // attribute. If the markup does not start with a < character, it // will be discarded below (with an appropriate console.error). markupListByNodeName[resultIndex] = markup.replace( OPEN_TAG_NAME_EXP, // This index will be parsed back out below. '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ' ); } } // Render each group of markup with similar wrapping `nodeName`. var renderNodes = createNodesFromMarkup( markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags. ); for (i = 0; i < renderNodes.length; ++i) { var renderNode = renderNodes[i]; if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) { resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR); renderNode.removeAttribute(RESULT_INDEX_ATTR); invariant( !resultList.hasOwnProperty(resultIndex), 'Danger: Assigning to an already-occupied result index.' ); resultList[resultIndex] = renderNode; // This should match resultList.length and markupList.length when // we're done. resultListAssignmentCount += 1; } else if (true) { console.error( "Danger: Discarding unexpected node:", renderNode ); } } } // Although resultList was populated out of order, it should now be a dense // array. invariant( resultListAssignmentCount === resultList.length, 'Danger: Did not assign to every index of resultList.' ); invariant( resultList.length === markupList.length, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length ); return resultList; }, /** * Replaces a node with a string of markup at its current position within its * parent. The markup must render into a single root node. * * @param {DOMElement} oldChild Child node to replace. * @param {string} markup Markup to render in place of the child node. * @internal */ dangerouslyReplaceNodeWithMarkup: function(oldChild, markup) { invariant( ExecutionEnvironment.canUseDOM, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. This is likely a bug in the framework. Please report ' + 'immediately.' ); invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.'); // createNodesFromMarkup() won't work if the markup is rooted by <html> // since it has special semantic meaning. So we use an alternatie strategy. if (oldChild.tagName.toLowerCase() === 'html') { mutateHTMLNodeWithMarkup(oldChild, markup); return; } var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; oldChild.parentNode.replaceChild(newChild, oldChild); } }; module.exports = Danger; },{"./ExecutionEnvironment":21,"./createNodesFromMarkup":88,"./emptyFunction":92,"./getMarkupWrap":101,"./invariant":106,"./mutateHTMLNodeWithMarkup":119}],12:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule DefaultDOMPropertyConfig */ /*jslint bitwise: true*/ "use strict"; var DOMProperty = require("./DOMProperty"); var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; var DefaultDOMPropertyConfig = { isCustomAttribute: RegExp.prototype.test.bind( /^(data|aria)-[a-z_][a-z\d_.\-]*$/ ), Properties: { /** * Standard Properties */ accept: null, accessKey: null, action: null, allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, allowTransparency: MUST_USE_ATTRIBUTE, alt: null, autoComplete: null, autoFocus: HAS_BOOLEAN_VALUE, autoPlay: HAS_BOOLEAN_VALUE, cellPadding: null, cellSpacing: null, charSet: MUST_USE_ATTRIBUTE, checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, className: MUST_USE_PROPERTY, colSpan: null, content: null, contentEditable: null, contextMenu: MUST_USE_ATTRIBUTE, controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, data: null, // For `<object />` acts as `src`. dateTime: MUST_USE_ATTRIBUTE, dir: null, disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, draggable: null, encType: null, form: MUST_USE_ATTRIBUTE, frameBorder: MUST_USE_ATTRIBUTE, height: MUST_USE_ATTRIBUTE, hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, href: null, htmlFor: null, httpEquiv: null, icon: null, id: MUST_USE_PROPERTY, label: null, lang: null, list: null, max: null, maxLength: MUST_USE_ATTRIBUTE, method: null, min: null, multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, name: null, pattern: null, placeholder: null, poster: null, preload: null, radioGroup: null, readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, rel: null, required: HAS_BOOLEAN_VALUE, role: MUST_USE_ATTRIBUTE, rowSpan: null, scrollLeft: MUST_USE_PROPERTY, scrollTop: MUST_USE_PROPERTY, selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, size: null, spellCheck: null, src: null, step: null, style: null, tabIndex: null, target: null, title: null, type: null, value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS, width: MUST_USE_ATTRIBUTE, wmode: MUST_USE_ATTRIBUTE, /** * Non-standard Properties */ autoCapitalize: null, // Supported in Mobile Safari for keyboard hints /** * SVG Properties */ cx: MUST_USE_ATTRIBUTE, cy: MUST_USE_ATTRIBUTE, d: MUST_USE_ATTRIBUTE, fill: MUST_USE_ATTRIBUTE, fx: MUST_USE_ATTRIBUTE, fy: MUST_USE_ATTRIBUTE, gradientTransform: MUST_USE_ATTRIBUTE, gradientUnits: MUST_USE_ATTRIBUTE, offset: MUST_USE_ATTRIBUTE, points: MUST_USE_ATTRIBUTE, r: MUST_USE_ATTRIBUTE, rx: MUST_USE_ATTRIBUTE, ry: MUST_USE_ATTRIBUTE, spreadMethod: MUST_USE_ATTRIBUTE, stopColor: MUST_USE_ATTRIBUTE, stopOpacity: MUST_USE_ATTRIBUTE, stroke: MUST_USE_ATTRIBUTE, strokeLinecap: MUST_USE_ATTRIBUTE, strokeWidth: MUST_USE_ATTRIBUTE, transform: MUST_USE_ATTRIBUTE, version: MUST_USE_ATTRIBUTE, viewBox: MUST_USE_ATTRIBUTE, x1: MUST_USE_ATTRIBUTE, x2: MUST_USE_ATTRIBUTE, x: MUST_USE_ATTRIBUTE, y1: MUST_USE_ATTRIBUTE, y2: MUST_USE_ATTRIBUTE, y: MUST_USE_ATTRIBUTE }, DOMAttributeNames: { className: 'class', gradientTransform: 'gradientTransform', gradientUnits: 'gradientUnits', htmlFor: 'for', spreadMethod: 'spreadMethod', stopColor: 'stop-color', stopOpacity: 'stop-opacity', strokeLinecap: 'stroke-linecap', strokeWidth: 'stroke-width', viewBox: 'viewBox' }, DOMPropertyNames: { autoCapitalize: 'autocapitalize', autoComplete: 'autocomplete', autoFocus: 'autofocus', autoPlay: 'autoplay', encType: 'enctype', radioGroup: 'radiogroup', spellCheck: 'spellcheck' }, DOMMutationMethods: { /** * Setting `className` to null may cause it to be set to the string "null". * * @param {DOMElement} node * @param {*} value */ className: function(node, value) { node.className = value || ''; } } }; module.exports = DefaultDOMPropertyConfig; },{"./DOMProperty":9}],13:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule DefaultEventPluginOrder */ "use strict"; var keyOf = require("./keyOf"); /** * Module that is injectable into `EventPluginHub`, that specifies a * deterministic ordering of `EventPlugin`s. A convenient way to reason about * plugins, without having to package every one of them. This is better than * having plugins be ordered in the same order that they are injected because * that ordering would be influenced by the packaging order. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that * preventing default on events is convenient in `SimpleEventPlugin` handlers. */ var DefaultEventPluginOrder = [ keyOf({ResponderEventPlugin: null}), keyOf({SimpleEventPlugin: null}), keyOf({TapEventPlugin: null}), keyOf({EnterLeaveEventPlugin: null}), keyOf({ChangeEventPlugin: null}), keyOf({SelectEventPlugin: null}), keyOf({CompositionEventPlugin: null}), keyOf({AnalyticsEventPlugin: null}), keyOf({MobileSafariClickEventPlugin: null}) ]; module.exports = DefaultEventPluginOrder; },{"./keyOf":113}],14:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EnterLeaveEventPlugin * @typechecks static-only */ "use strict"; var EventConstants = require("./EventConstants"); var EventPropagators = require("./EventPropagators"); var SyntheticMouseEvent = require("./SyntheticMouseEvent"); var ReactMount = require("./ReactMount"); var keyOf = require("./keyOf"); var topLevelTypes = EventConstants.topLevelTypes; var getFirstReactDOM = ReactMount.getFirstReactDOM; var eventTypes = { mouseEnter: {registrationName: keyOf({onMouseEnter: null})}, mouseLeave: {registrationName: keyOf({onMouseLeave: null})} }; var extractedEvents = [null, null]; var EnterLeaveEventPlugin = { eventTypes: eventTypes, /** * For almost every interaction we care about, there will be both a top-level * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that * we do not extract duplicate events. However, moving the mouse into the * browser from outside will not fire a `mouseout` event. In this case, we use * the `mouseover` top-level event. * * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { return null; } if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) { // Must not be a mouse in or mouse out - ignoring. return null; } var from, to; if (topLevelType === topLevelTypes.topMouseOut) { from = topLevelTarget; to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement) || window; } else { from = window; to = topLevelTarget; } if (from === to) { // Nothing pertains to our managed components. return null; } var fromID = from ? ReactMount.getID(from) : ''; var toID = to ? ReactMount.getID(to) : ''; var leave = SyntheticMouseEvent.getPooled( eventTypes.mouseLeave, fromID, nativeEvent ); var enter = SyntheticMouseEvent.getPooled( eventTypes.mouseEnter, toID, nativeEvent ); EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID); extractedEvents[0] = leave; extractedEvents[1] = enter; return extractedEvents; } }; module.exports = EnterLeaveEventPlugin; },{"./EventConstants":15,"./EventPropagators":20,"./ReactMount":53,"./SyntheticMouseEvent":78,"./keyOf":113}],15:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventConstants */ "use strict"; var keyMirror = require("./keyMirror"); var PropagationPhases = keyMirror({bubbled: null, captured: null}); /** * Types of raw signals from the browser caught at the top level. */ var topLevelTypes = keyMirror({ topBlur: null, topChange: null, topClick: null, topCompositionEnd: null, topCompositionStart: null, topCompositionUpdate: null, topCopy: null, topCut: null, topDoubleClick: null, topDrag: null, topDragEnd: null, topDragEnter: null, topDragExit: null, topDragLeave: null, topDragOver: null, topDragStart: null, topDrop: null, topFocus: null, topInput: null, topKeyDown: null, topKeyPress: null, topKeyUp: null, topMouseDown: null, topMouseMove: null, topMouseOut: null, topMouseOver: null, topMouseUp: null, topPaste: null, topScroll: null, topSelectionChange: null, topSubmit: null, topTouchCancel: null, topTouchEnd: null, topTouchMove: null, topTouchStart: null, topWheel: null }); var EventConstants = { topLevelTypes: topLevelTypes, PropagationPhases: PropagationPhases }; module.exports = EventConstants; },{"./keyMirror":112}],16:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventListener */ /** * Upstream version of event listener. Does not take into account specific * nature of platform. */ var EventListener = { /** * Listens to bubbled events on a DOM node. * * @param {Element} el DOM element to register listener on. * @param {string} handlerBaseName 'click'/'mouseover' * @param {Function!} cb Callback function */ listen: function(el, handlerBaseName, cb) { if (el.addEventListener) { el.addEventListener(handlerBaseName, cb, false); } else if (el.attachEvent) { el.attachEvent('on' + handlerBaseName, cb); } }, /** * Listens to captured events on a DOM node. * * @see `EventListener.listen` for params. * @throws Exception if addEventListener is not supported. */ capture: function(el, handlerBaseName, cb) { if (!el.addEventListener) { if (true) { console.error( 'You are attempting to use addEventlistener ' + 'in a browser that does not support it support it.' + 'This likely means that you will not receive events that ' + 'your application relies on (such as scroll).'); } return; } else { el.addEventListener(handlerBaseName, cb, true); } } }; module.exports = EventListener; },{}],17:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventPluginHub */ "use strict"; var CallbackRegistry = require("./CallbackRegistry"); var EventPluginRegistry = require("./EventPluginRegistry"); var EventPluginUtils = require("./EventPluginUtils"); var EventPropagators = require("./EventPropagators"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var accumulate = require("./accumulate"); var forEachAccumulated = require("./forEachAccumulated"); var invariant = require("./invariant"); /** * Internal queue of events that have accumulated their dispatches and are * waiting to have their dispatches executed. */ var eventQueue = null; /** * Dispatches an event and releases it back into the pool, unless persistent. * * @param {?object} event Synthetic event to be dispatched. * @private */ var executeDispatchesAndRelease = function(event) { if (event) { var executeDispatch = EventPluginUtils.executeDispatch; // Plugins can provide custom behavior when dispatching events. var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event); if (PluginModule && PluginModule.executeDispatch) { executeDispatch = PluginModule.executeDispatch; } EventPluginUtils.executeDispatchesInOrder(event, executeDispatch); if (!event.isPersistent()) { event.constructor.release(event); } } }; /** * This is a unified interface for event plugins to be installed and configured. * * Event plugins can implement the following properties: * * `extractEvents` {function(string, DOMEventTarget, string, object): *} * Required. When a top-level event is fired, this method is expected to * extract synthetic events that will in turn be queued and dispatched. * * `eventTypes` {object} * Optional, plugins that fire events must publish a mapping of registration * names that are used to register listeners. Values of this mapping must * be objects that contain `registrationName` or `phasedRegistrationNames`. * * `executeDispatch` {function(object, function, string)} * Optional, allows plugins to override how an event gets dispatched. By * default, the listener is simply invoked. * * Each plugin that is injected into `EventsPluginHub` is immediately operable. * * @public */ var EventPluginHub = { /** * Methods for injecting dependencies. */ injection: { /** * @param {object} InjectedInstanceHandle * @public */ injectInstanceHandle: EventPropagators.injection.injectInstanceHandle, /** * @param {array} InjectedEventPluginOrder * @public */ injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, /** * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName }, registrationNames: EventPluginRegistry.registrationNames, putListener: CallbackRegistry.putListener, getListener: CallbackRegistry.getListener, deleteListener: CallbackRegistry.deleteListener, deleteAllListeners: CallbackRegistry.deleteAllListeners, /** * Allows registered plugins an opportunity to extract events from top-level * native browser events. * * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @internal */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var events; var plugins = EventPluginRegistry.plugins; for (var i = 0, l = plugins.length; i < l; i++) { // Not every plugin in the ordering may be loaded at runtime. var possiblePlugin = plugins[i]; if (possiblePlugin) { var extractedEvents = possiblePlugin.extractEvents( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent ); if (extractedEvents) { events = accumulate(events, extractedEvents); } } } return events; }, /** * Enqueues a synthetic event that should be dispatched when * `processEventQueue` is invoked. * * @param {*} events An accumulation of synthetic events. * @internal */ enqueueEvents: function(events) { if (events) { eventQueue = accumulate(eventQueue, events); } }, /** * Dispatches all synthetic events on the event queue. * * @internal */ processEventQueue: function() { // Set `eventQueue` to null before processing it so that we can tell if more // events get enqueued while processing. var processingEventQueue = eventQueue; eventQueue = null; forEachAccumulated(processingEventQueue, executeDispatchesAndRelease); invariant( !eventQueue, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.' ); } }; if (ExecutionEnvironment.canUseDOM) { window.EventPluginHub = EventPluginHub; } module.exports = EventPluginHub; },{"./CallbackRegistry":5,"./EventPluginRegistry":18,"./EventPluginUtils":19,"./EventPropagators":20,"./ExecutionEnvironment":21,"./accumulate":84,"./forEachAccumulated":97,"./invariant":106}],18:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventPluginRegistry * @typechecks static-only */ "use strict"; var invariant = require("./invariant"); /** * Injectable ordering of event plugins. */ var EventPluginOrder = null; /** * Injectable mapping from names to event plugin modules. */ var namesToPlugins = {}; /** * Recomputes the plugin list using the injected plugins and plugin ordering. * * @private */ function recomputePluginOrdering() { if (!EventPluginOrder) { // Wait until an `EventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { var PluginModule = namesToPlugins[pluginName]; var pluginIndex = EventPluginOrder.indexOf(pluginName); invariant( pluginIndex > -1, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName ); if (EventPluginRegistry.plugins[pluginIndex]) { continue; } invariant( PluginModule.extractEvents, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName ); EventPluginRegistry.plugins[pluginIndex] = PluginModule; var publishedEvents = PluginModule.eventTypes; for (var eventName in publishedEvents) { invariant( publishEventForPlugin(publishedEvents[eventName], PluginModule), 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName ); } } } /** * Publishes an event so that it can be dispatched by the supplied plugin. * * @param {object} dispatchConfig Dispatch configuration for the event. * @param {object} PluginModule Plugin publishing the event. * @return {boolean} True if the event was successfully published. * @private */ function publishEventForPlugin(dispatchConfig, PluginModule) { var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { for (var phaseName in phasedRegistrationNames) { if (phasedRegistrationNames.hasOwnProperty(phaseName)) { var phasedRegistrationName = phasedRegistrationNames[phaseName]; publishRegistrationName(phasedRegistrationName, PluginModule); } } return true; } else if (dispatchConfig.registrationName) { publishRegistrationName(dispatchConfig.registrationName, PluginModule); return true; } return false; } /** * Publishes a registration name that is used to identify dispatched events and * can be used with `EventPluginHub.putListener` to register listeners. * * @param {string} registrationName Registration name to add. * @param {object} PluginModule Plugin publishing the event. * @private */ function publishRegistrationName(registrationName, PluginModule) { invariant( !EventPluginRegistry.registrationNames[registrationName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName ); EventPluginRegistry.registrationNames[registrationName] = PluginModule; EventPluginRegistry.registrationNamesKeys.push(registrationName); } /** * Registers plugins so that they can extract and dispatch events. * * @see {EventPluginHub} */ var EventPluginRegistry = { /** * Ordered list of injected plugins. */ plugins: [], /** * Mapping from registration names to plugin modules. */ registrationNames: {}, /** * The keys of `registrationNames`. */ registrationNamesKeys: [], /** * Injects an ordering of plugins (by plugin name). This allows the ordering * to be decoupled from injection of the actual plugins so that ordering is * always deterministic regardless of packaging, on-the-fly injection, etc. * * @param {array} InjectedEventPluginOrder * @internal * @see {EventPluginHub.injection.injectEventPluginOrder} */ injectEventPluginOrder: function(InjectedEventPluginOrder) { invariant( !EventPluginOrder, 'EventPluginRegistry: Cannot inject event plugin ordering more than once.' ); // Clone the ordering so it cannot be dynamically mutated. EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); recomputePluginOrdering(); }, /** * Injects plugins to be used by `EventPluginHub`. The plugin names must be * in the ordering injected by `injectEventPluginOrder`. * * Plugins can be injected as part of page initialization or on-the-fly. * * @param {object} injectedNamesToPlugins Map from names to plugin modules. * @internal * @see {EventPluginHub.injection.injectEventPluginsByName} */ injectEventPluginsByName: function(injectedNamesToPlugins) { var isOrderingDirty = false; for (var pluginName in injectedNamesToPlugins) { if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { continue; } var PluginModule = injectedNamesToPlugins[pluginName]; if (namesToPlugins[pluginName] !== PluginModule) { invariant( !namesToPlugins[pluginName], 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName ); namesToPlugins[pluginName] = PluginModule; isOrderingDirty = true; } } if (isOrderingDirty) { recomputePluginOrdering(); } }, /** * Looks up the plugin for the supplied event. * * @param {object} event A synthetic event. * @return {?object} The plugin that created the supplied event. * @internal */ getPluginModuleForEvent: function(event) { var dispatchConfig = event.dispatchConfig; if (dispatchConfig.registrationName) { return EventPluginRegistry.registrationNames[ dispatchConfig.registrationName ] || null; } for (var phase in dispatchConfig.phasedRegistrationNames) { if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) { continue; } var PluginModule = EventPluginRegistry.registrationNames[ dispatchConfig.phasedRegistrationNames[phase] ]; if (PluginModule) { return PluginModule; } } return null; }, /** * Exposed for unit testing. * @private */ _resetEventPlugins: function() { EventPluginOrder = null; for (var pluginName in namesToPlugins) { if (namesToPlugins.hasOwnProperty(pluginName)) { delete namesToPlugins[pluginName]; } } EventPluginRegistry.plugins.length = 0; var registrationNames = EventPluginRegistry.registrationNames; for (var registrationName in registrationNames) { if (registrationNames.hasOwnProperty(registrationName)) { delete registrationNames[registrationName]; } } EventPluginRegistry.registrationNamesKeys.length = 0; } }; module.exports = EventPluginRegistry; },{"./invariant":106}],19:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventPluginUtils */ "use strict"; var EventConstants = require("./EventConstants"); var invariant = require("./invariant"); var topLevelTypes = EventConstants.topLevelTypes; function isEndish(topLevelType) { return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel; } function isMoveish(topLevelType) { return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove; } function isStartish(topLevelType) { return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart; } var validateEventDispatches; if (true) { validateEventDispatches = function(event) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; var listenersIsArr = Array.isArray(dispatchListeners); var idsIsArr = Array.isArray(dispatchIDs); var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0; var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; invariant( idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.' ); }; } /** * Invokes `cb(event, listener, id)`. Avoids using call if no scope is * provided. The `(listener,id)` pair effectively forms the "dispatch" but are * kept separate to conserve memory. */ function forEachEventDispatch(event, cb) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; if (true) { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and IDs are two parallel arrays that are always in sync. cb(event, dispatchListeners[i], dispatchIDs[i]); } } else if (dispatchListeners) { cb(event, dispatchListeners, dispatchIDs); } } /** * Default implementation of PluginModule.executeDispatch(). * @param {SyntheticEvent} SyntheticEvent to handle * @param {function} Application-level callback * @param {string} domID DOM id to pass to the callback. */ function executeDispatch(event, listener, domID) { listener(event, domID); } /** * Standard/simple iteration through an event's collected dispatches. */ function executeDispatchesInOrder(event, executeDispatch) { forEachEventDispatch(event, executeDispatch); event._dispatchListeners = null; event._dispatchIDs = null; } /** * Standard/simple iteration through an event's collected dispatches, but stops * at the first dispatch execution returning true, and returns that id. * * @return id of the first dispatch execution who's listener returns true, or * null if no listener returned true. */ function executeDispatchesInOrderStopAtTrue(event) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; if (true) { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and IDs are two parallel arrays that are always in sync. if (dispatchListeners[i](event, dispatchIDs[i])) { return dispatchIDs[i]; } } } else if (dispatchListeners) { if (dispatchListeners(event, dispatchIDs)) { return dispatchIDs; } } return null; } /** * Execution of a "direct" dispatch - there must be at most one dispatch * accumulated on the event or it is considered an error. It doesn't really make * sense for an event with multiple dispatches (bubbled) to keep track of the * return values at each dispatch execution, but it does tend to make sense when * dealing with "direct" dispatches. * * @return The return value of executing the single dispatch. */ function executeDirectDispatch(event) { if (true) { validateEventDispatches(event); } var dispatchListener = event._dispatchListeners; var dispatchID = event._dispatchIDs; invariant( !Array.isArray(dispatchListener), 'executeDirectDispatch(...): Invalid `event`.' ); var res = dispatchListener ? dispatchListener(event, dispatchID) : null; event._dispatchListeners = null; event._dispatchIDs = null; return res; } /** * @param {SyntheticEvent} event * @return {bool} True iff number of dispatches accumulated is greater than 0. */ function hasDispatches(event) { return !!event._dispatchListeners; } /** * General utilities that are useful in creating custom Event Plugins. */ var EventPluginUtils = { isEndish: isEndish, isMoveish: isMoveish, isStartish: isStartish, executeDispatchesInOrder: executeDispatchesInOrder, executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, executeDirectDispatch: executeDirectDispatch, hasDispatches: hasDispatches, executeDispatch: executeDispatch }; module.exports = EventPluginUtils; },{"./EventConstants":15,"./invariant":106}],20:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule EventPropagators */ "use strict"; var CallbackRegistry = require("./CallbackRegistry"); var EventConstants = require("./EventConstants"); var accumulate = require("./accumulate"); var forEachAccumulated = require("./forEachAccumulated"); var getListener = CallbackRegistry.getListener; var PropagationPhases = EventConstants.PropagationPhases; /** * Injected dependencies: */ /** * - `InstanceHandle`: [required] Module that performs logical traversals of DOM * hierarchy given ids of the logical DOM elements involved. */ var injection = { InstanceHandle: null, injectInstanceHandle: function(InjectedInstanceHandle) { injection.InstanceHandle = InjectedInstanceHandle; if (true) { injection.validate(); } }, validate: function() { var invalid = !injection.InstanceHandle|| !injection.InstanceHandle.traverseTwoPhase || !injection.InstanceHandle.traverseEnterLeave; if (invalid) { throw new Error('InstanceHandle not injected before use!'); } } }; /** * Some event types have a notion of different registration names for different * "phases" of propagation. This finds listeners by a given phase. */ function listenerAtPhase(id, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(id, registrationName); } /** * Tags a `SyntheticEvent` with dispatched listeners. Creating this function * here, allows us to not have to bind or create functions for each event. * Mutating the event's members allows us to not have to create a wrapping * "dispatch" object that pairs the event with the listener. */ function accumulateDirectionalDispatches(domID, upwards, event) { if (true) { if (!domID) { throw new Error('Dispatching id must not be null'); } injection.validate(); } var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; var listener = listenerAtPhase(domID, event, phase); if (listener) { event._dispatchListeners = accumulate(event._dispatchListeners, listener); event._dispatchIDs = accumulate(event._dispatchIDs, domID); } } /** * Collect dispatches (must be entirely collected before dispatching - see unit * tests). Lazily allocate the array to conserve memory. We must loop through * each event and perform the traversal for each one. We can not perform a * single traversal for the entire collection of events because each event may * have a different target. */ function accumulateTwoPhaseDispatchesSingle(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { injection.InstanceHandle.traverseTwoPhase( event.dispatchMarker, accumulateDirectionalDispatches, event ); } } /** * Accumulates without regard to direction, does not look for phased * registration names. Same as `accumulateDirectDispatchesSingle` but without * requiring that the `dispatchMarker` be the same as the dispatched ID. */ function accumulateDispatches(id, ignoredDirection, event) { if (event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName; var listener = getListener(id, registrationName); if (listener) { event._dispatchListeners = accumulate(event._dispatchListeners, listener); event._dispatchIDs = accumulate(event._dispatchIDs, id); } } } /** * Accumulates dispatches on an `SyntheticEvent`, but only for the * `dispatchMarker`. * @param {SyntheticEvent} event */ function accumulateDirectDispatchesSingle(event) { if (event && event.dispatchConfig.registrationName) { accumulateDispatches(event.dispatchMarker, null, event); } } function accumulateTwoPhaseDispatches(events) { if (true) { injection.validate(); } forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); } function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) { if (true) { injection.validate(); } injection.InstanceHandle.traverseEnterLeave( fromID, toID, accumulateDispatches, leave, enter ); } function accumulateDirectDispatches(events) { if (true) { injection.validate(); } forEachAccumulated(events, accumulateDirectDispatchesSingle); } /** * A small set of propagation patterns, each of which will accept a small amount * of information, and generate a set of "dispatch ready event objects" - which * are sets of events that have already been annotated with a set of dispatched * listener functions/ids. The API is designed this way to discourage these * propagation strategies from actually executing the dispatches, since we * always want to collect the entire set of dispatches before executing event a * single one. * * @constructor EventPropagators */ var EventPropagators = { accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, accumulateDirectDispatches: accumulateDirectDispatches, accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches, injection: injection }; module.exports = EventPropagators; },{"./CallbackRegistry":5,"./EventConstants":15,"./accumulate":84,"./forEachAccumulated":97}],21:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ExecutionEnvironment */ /*jslint evil: true */ "use strict"; var canUseDOM = typeof window !== 'undefined'; /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; },{}],22:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule LinkedStateMixin * @typechecks static-only */ "use strict"; var ReactLink = require("./ReactLink"); var ReactStateSetters = require("./ReactStateSetters"); /** * A simple mixin around ReactLink.forState(). */ var LinkedStateMixin = { /** * Create a ReactLink that's linked to part of this component's state. The * ReactLink will have the current value of this.state[key] and will call * setState() when a change is requested. * * @param {string} key state key to update. Note: you may want to use keyOf() * if you're using Google Closure Compiler advanced mode. * @return {ReactLink} ReactLink instance linking to the state. */ linkState: function(key) { return new ReactLink( this.state[key], ReactStateSetters.createStateKeySetter(this, key) ); } }; module.exports = LinkedStateMixin; },{"./ReactLink":51,"./ReactStateSetters":63}],23:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule LinkedValueMixin * @typechecks static-only */ "use strict"; var invariant = require("./invariant"); /** * Provide a linked `value` attribute for controlled forms. You should not use * this outside of the ReactDOM controlled form components. */ var LinkedValueMixin = { _assertLink: function() { invariant( this.props.value == null && this.props.onChange == null, 'Cannot provide a valueLink and a value or onChange event. If you ' + 'want to use value or onChange, you probably don\'t want to use ' + 'valueLink' ); }, /** * @return {*} current value of the input either from value prop or link. */ getValue: function() { if (this.props.valueLink) { this._assertLink(); return this.props.valueLink.value; } return this.props.value; }, /** * @return {function} change callback either from onChange prop or link. */ getOnChange: function() { if (this.props.valueLink) { this._assertLink(); return this._handleLinkedValueChange; } return this.props.onChange; }, /** * @param {SyntheticEvent} e change event to handle */ _handleLinkedValueChange: function(e) { this.props.valueLink.requestChange(e.target.value); } }; module.exports = LinkedValueMixin; },{"./invariant":106}],24:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule MobileSafariClickEventPlugin * @typechecks static-only */ "use strict"; var EventConstants = require("./EventConstants"); var emptyFunction = require("./emptyFunction"); var topLevelTypes = EventConstants.topLevelTypes; /** * Mobile Safari does not fire properly bubble click events on non-interactive * elements, which means delegated click listeners do not fire. The workaround * for this bug involves attaching an empty click listener on the target node. * * This particular plugin works around the bug by attaching an empty click * listener on `touchstart` (which does fire on every element). */ var MobileSafariClickEventPlugin = { eventTypes: null, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { if (topLevelType === topLevelTypes.topTouchStart) { var target = nativeEvent.target; if (target && !target.onclick) { target.onclick = emptyFunction; } } } }; module.exports = MobileSafariClickEventPlugin; },{"./EventConstants":15,"./emptyFunction":92}],25:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule PooledClass */ "use strict"; /** * Static poolers. Several custom versions for each potential number of * arguments. A completely generic pooler is easy to implement, but would * require accessing the `arguments` object. In each of these, `this` refers to * the Class itself, not an instance. If any others are needed, simply add them * here, or in their own files. */ var oneArgumentPooler = function(copyFieldsFrom) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, copyFieldsFrom); return instance; } else { return new Klass(copyFieldsFrom); } }; var twoArgumentPooler = function(a1, a2) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2); return instance; } else { return new Klass(a1, a2); } }; var threeArgumentPooler = function(a1, a2, a3) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3); return instance; } else { return new Klass(a1, a2, a3); } }; var fiveArgumentPooler = function(a1, a2, a3, a4, a5) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3, a4, a5); return instance; } else { return new Klass(a1, a2, a3, a4, a5); } }; var standardReleaser = function(instance) { var Klass = this; if (instance.destructor) { instance.destructor(); } if (Klass.instancePool.length < Klass.poolSize) { Klass.instancePool.push(instance); } }; var DEFAULT_POOL_SIZE = 10; var DEFAULT_POOLER = oneArgumentPooler; /** * Augments `CopyConstructor` to be a poolable class, augmenting only the class * itself (statically) not adding any prototypical fields. Any CopyConstructor * you give this may have a `poolSize` property, and will look for a * prototypical `destructor` on instances (optional). * * @param {Function} CopyConstructor Constructor that can be used to reset. * @param {Function} pooler Customizable pooler. */ var addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; NewKlass.instancePool = []; NewKlass.getPooled = pooler || DEFAULT_POOLER; if (!NewKlass.poolSize) { NewKlass.poolSize = DEFAULT_POOL_SIZE; } NewKlass.release = standardReleaser; return NewKlass; }; var PooledClass = { addPoolingTo: addPoolingTo, oneArgumentPooler: oneArgumentPooler, twoArgumentPooler: twoArgumentPooler, threeArgumentPooler: threeArgumentPooler, fiveArgumentPooler: fiveArgumentPooler }; module.exports = PooledClass; },{}],26:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule React */ "use strict"; var ReactComponent = require("./ReactComponent"); var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactCurrentOwner = require("./ReactCurrentOwner"); var ReactDOM = require("./ReactDOM"); var ReactDOMComponent = require("./ReactDOMComponent"); var ReactDefaultInjection = require("./ReactDefaultInjection"); var ReactInstanceHandles = require("./ReactInstanceHandles"); var ReactMount = require("./ReactMount"); var ReactMultiChild = require("./ReactMultiChild"); var ReactPerf = require("./ReactPerf"); var ReactPropTypes = require("./ReactPropTypes"); var ReactServerRendering = require("./ReactServerRendering"); var ReactTextComponent = require("./ReactTextComponent"); ReactDefaultInjection.inject(); var React = { DOM: ReactDOM, PropTypes: ReactPropTypes, initializeTouchEvents: function(shouldUseTouch) { ReactMount.useTouchEvents = shouldUseTouch; }, createClass: ReactCompositeComponent.createClass, constructAndRenderComponent: ReactMount.constructAndRenderComponent, constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID, renderComponent: ReactPerf.measure( 'React', 'renderComponent', ReactMount.renderComponent ), renderComponentToString: ReactServerRendering.renderComponentToString, unmountComponentAtNode: ReactMount.unmountComponentAtNode, unmountAndReleaseReactRootNode: ReactMount.unmountAndReleaseReactRootNode, isValidClass: ReactCompositeComponent.isValidClass, isValidComponent: ReactComponent.isValidComponent, __internals: { Component: ReactComponent, CurrentOwner: ReactCurrentOwner, DOMComponent: ReactDOMComponent, InstanceHandles: ReactInstanceHandles, Mount: ReactMount, MultiChild: ReactMultiChild, TextComponent: ReactTextComponent } }; // Version exists only in the open-source version of React, not in Facebook's // internal version. React.version = '0.5.1'; module.exports = React; },{"./ReactComponent":28,"./ReactCompositeComponent":31,"./ReactCurrentOwner":32,"./ReactDOM":33,"./ReactDOMComponent":35,"./ReactDefaultInjection":44,"./ReactInstanceHandles":50,"./ReactMount":53,"./ReactMultiChild":55,"./ReactPerf":58,"./ReactPropTypes":60,"./ReactServerRendering":62,"./ReactTextComponent":64}],27:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactChildren */ "use strict"; var PooledClass = require("./PooledClass"); var invariant = require("./invariant"); var traverseAllChildren = require("./traverseAllChildren"); var twoArgumentPooler = PooledClass.twoArgumentPooler; var threeArgumentPooler = PooledClass.threeArgumentPooler; /** * PooledClass representing the bookkeeping associated with performing a child * traversal. Allows avoiding binding callbacks. * * @constructor ForEachBookKeeping * @param {!function} forEachFunction Function to perform traversal with. * @param {?*} forEachContext Context to perform context with. */ function ForEachBookKeeping(forEachFunction, forEachContext) { this.forEachFunction = forEachFunction; this.forEachContext = forEachContext; } PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild(traverseContext, child, name, i) { var forEachBookKeeping = traverseContext; forEachBookKeeping.forEachFunction.call( forEachBookKeeping.forEachContext, child, i); } /** * Iterates through children that are typically specified as `props.children`. * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {array} children * @param {function(*, int)} forEachFunc. * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); ForEachBookKeeping.release(traverseContext); } /** * PooledClass representing the bookkeeping associated with performing a child * mapping. Allows avoiding binding callbacks. * * @constructor MapBookKeeping * @param {!*} mapResult Object containing the ordered map of results. * @param {!function} mapFunction Function to perform mapping with. * @param {?*} mapContext Context to perform mapping with. */ function MapBookKeeping(mapResult, mapFunction, mapContext) { this.mapResult = mapResult; this.mapFunction = mapFunction; this.mapContext = mapContext; } PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler); function mapSingleChildIntoContext(traverseContext, child, name, i) { var mapBookKeeping = traverseContext; var mapResult = mapBookKeeping.mapResult; var mappedChild = mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i); // We found a component instance invariant( !mapResult.hasOwnProperty(name), 'ReactChildren.map(...): Encountered two children with the same key, ' + '`%s`. Children keys must be unique.', name ); mapResult[name] = mappedChild; } /** * Maps children that are typically specified as `props.children`. * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * TODO: This may likely break any calls to `ReactChildren.map` that were * previously relying on the fact that we guarded against null children. * * @param {array} children * @param {function(*, int)} mapFunction. * @param {*} mapContext Context for mapFunction. * @return {array} mirrored array with mapped children. */ function mapChildren(children, func, context) { if (children == null) { return children; } var mapResult = {}; var traverseContext = MapBookKeeping.getPooled(mapResult, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); MapBookKeeping.release(traverseContext); return mapResult; } var ReactChildren = { forEach: forEachChildren, map: mapChildren }; module.exports = ReactChildren; },{"./PooledClass":25,"./invariant":106,"./traverseAllChildren":125}],28:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactComponent */ "use strict"; var ReactComponentEnvironment = require("./ReactComponentEnvironment"); var ReactCurrentOwner = require("./ReactCurrentOwner"); var ReactOwner = require("./ReactOwner"); var ReactUpdates = require("./ReactUpdates"); var invariant = require("./invariant"); var keyMirror = require("./keyMirror"); var merge = require("./merge"); /** * Every React component is in one of these life cycles. */ var ComponentLifeCycle = keyMirror({ /** * Mounted components have a DOM node representation and are capable of * receiving new props. */ MOUNTED: null, /** * Unmounted components are inactive and cannot receive new props. */ UNMOUNTED: null }); /** * Warn if there's no key explicitly set on dynamic arrays of children. * This allows us to keep track of children between updates. */ var ownerHasWarned = {}; /** * Warn if the component doesn't have an explicit key assigned to it. * This component is in an array. The array could grow and shrink or be * reordered. All children, that hasn't already been validated, are required to * have a "key" property assigned to it. * * @internal * @param {ReactComponent} component Component that requires a key. */ function validateExplicitKey(component) { if (component.__keyValidated__ || component.props.key != null) { return; } component.__keyValidated__ = true; // We can't provide friendly warnings for top level components. if (!ReactCurrentOwner.current) { return; } // Name of the component whose render method tried to pass children. var currentName = ReactCurrentOwner.current.constructor.displayName; if (ownerHasWarned.hasOwnProperty(currentName)) { return; } ownerHasWarned[currentName] = true; var message = 'Each child in an array should have a unique "key" prop. ' + 'Check the render method of ' + currentName + '.'; if (!component.isOwnedBy(ReactCurrentOwner.current)) { // Name of the component that originally created this child. var childOwnerName = component.props.__owner__ && component.props.__owner__.constructor.displayName; // Usually the current owner is the offender, but if it accepts // children as a property, it may be the creator of the child that's // responsible for assigning it a key. message += ' It was passed a child from ' + childOwnerName + '.'; } console.warn(message); } /** * Ensure that every component either is passed in a static location or, if * if it's passed in an array, has an explicit key property defined. * * @internal * @param {*} component Statically passed child of any type. * @return {boolean} */ function validateChildKeys(component) { if (Array.isArray(component)) { for (var i = 0; i < component.length; i++) { var child = component[i]; if (ReactComponent.isValidComponent(child)) { validateExplicitKey(child); } } } else if (ReactComponent.isValidComponent(component)) { // This component was passed in a valid location. component.__keyValidated__ = true; } } /** * Components are the basic units of composition in React. * * Every component accepts a set of keyed input parameters known as "props" that * are initialized by the constructor. Once a component is mounted, the props * can be mutated using `setProps` or `replaceProps`. * * Every component is capable of the following operations: * * `mountComponent` * Initializes the component, renders markup, and registers event listeners. * * `receiveProps` * Updates the rendered DOM nodes given a new set of props. * * `unmountComponent` * Releases any resources allocated by this component. * * Components can also be "owned" by other components. Being owned by another * component means being constructed by that component. This is different from * being the child of a component, which means having a DOM representation that * is a child of the DOM representation of that component. * * @class ReactComponent */ var ReactComponent = { /** * @param {?object} object * @return {boolean} True if `object` is a valid component. * @final */ isValidComponent: function(object) { return !!( object && typeof object.mountComponentIntoNode === 'function' && typeof object.receiveProps === 'function' ); }, /** * Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} * @internal */ getKey: function(component, index) { if (component && component.props && component.props.key != null) { // Explicit key return '{' + component.props.key + '}'; } // Implicit key determined by the index in the set return '[' + index + ']'; }, /** * @internal */ LifeCycle: ComponentLifeCycle, /** * Injected module that provides ability to mutate individual properties. * Injected into the base class because many different subclasses need access * to this. * * @internal */ DOMIDOperations: ReactComponentEnvironment.DOMIDOperations, /** * Optionally injectable environment dependent cleanup hook. (server vs. * browser etc). Example: A browser system caches DOM nodes based on component * ID and must remove that cache entry when this instance is unmounted. * * @private */ unmountIDFromEnvironment: ReactComponentEnvironment.unmountIDFromEnvironment, /** * The "image" of a component tree, is the platform specific (typically * serialized) data that represents a tree of lower level UI building blocks. * On the web, this "image" is HTML markup which describes a construction of * low level `div` and `span` nodes. Other platforms may have different * encoding of this "image". This must be injected. * * @private */ mountImageIntoNode: ReactComponentEnvironment.mountImageIntoNode, /** * React references `ReactReconcileTransaction` using this property in order * to allow dependency injection. * * @internal */ ReactReconcileTransaction: ReactComponentEnvironment.ReactReconcileTransaction, /** * Base functionality for every ReactComponent constructor. Mixed into the * `ReactComponent` prototype, but exposed statically for easy access. * * @lends {ReactComponent.prototype} */ Mixin: merge(ReactComponentEnvironment.Mixin, { /** * Checks whether or not this component is mounted. * * @return {boolean} True if mounted, false otherwise. * @final * @protected */ isMounted: function() { return this._lifeCycleState === ComponentLifeCycle.MOUNTED; }, /** * Sets a subset of the props. * * @param {object} partialProps Subset of the next props. * @param {?function} callback Called after props are updated. * @final * @public */ setProps: function(partialProps, callback) { // Merge with `_pendingProps` if it exists, otherwise with existing props. this.replaceProps( merge(this._pendingProps || this.props, partialProps), callback ); }, /** * Replaces all of the props. * * @param {object} props New props. * @param {?function} callback Called after props are updated. * @final * @public */ replaceProps: function(props, callback) { invariant( !this.props.__owner__, 'replaceProps(...): You called `setProps` or `replaceProps` on a ' + 'component with an owner. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.' ); invariant( this.isMounted(), 'replaceProps(...): Can only update a mounted component.' ); this._pendingProps = props; ReactUpdates.enqueueUpdate(this, callback); }, /** * Base constructor for all React component. * * Subclasses that override this method should make sure to invoke * `ReactComponent.Mixin.construct.call(this, ...)`. * * @param {?object} initialProps * @param {*} children * @internal */ construct: function(initialProps, children) { this.props = initialProps || {}; // Record the component responsible for creating this component. this.props.__owner__ = ReactCurrentOwner.current; // All components start unmounted. this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; this._pendingProps = null; this._pendingCallbacks = null; // Children can be more than one argument var childrenLength = arguments.length - 1; if (childrenLength === 1) { if (true) { validateChildKeys(children); } this.props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { if (true) { validateChildKeys(arguments[i + 1]); } childArray[i] = arguments[i + 1]; } this.props.children = childArray; } }, /** * Initializes the component, renders markup, and registers event listeners. * * NOTE: This does not insert any nodes into the DOM. * * Subclasses that override this method should make sure to invoke * `ReactComponent.Mixin.mountComponent.call(this, ...)`. * * @param {string} rootID DOM ID of the root node. * @param {ReactReconcileTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy. * @return {?string} Rendered markup to be inserted into the DOM. * @internal */ mountComponent: function(rootID, transaction, mountDepth) { invariant( !this.isMounted(), 'mountComponent(%s, ...): Can only mount an unmounted component.', rootID ); var props = this.props; if (props.ref != null) { ReactOwner.addComponentAsRefTo(this, props.ref, props.__owner__); } this._rootNodeID = rootID; this._lifeCycleState = ComponentLifeCycle.MOUNTED; this._mountDepth = mountDepth; // Effectively: return ''; }, /** * Releases any resources allocated by `mountComponent`. * * NOTE: This does not remove any nodes from the DOM. * * Subclasses that override this method should make sure to invoke * `ReactComponent.Mixin.unmountComponent.call(this)`. * * @internal */ unmountComponent: function() { invariant( this.isMounted(), 'unmountComponent(): Can only unmount a mounted component.' ); var props = this.props; if (props.ref != null) { ReactOwner.removeComponentAsRefFrom(this, props.ref, props.__owner__); } ReactComponent.unmountIDFromEnvironment(this._rootNodeID); this._rootNodeID = null; this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; }, /** * Updates the rendered DOM nodes given a new set of props. * * Subclasses that override this method should make sure to invoke * `ReactComponent.Mixin.receiveProps.call(this, ...)`. * * @param {object} nextProps Next set of properties. * @param {ReactReconcileTransaction} transaction * @internal */ receiveProps: function(nextProps, transaction) { invariant( this.isMounted(), 'receiveProps(...): Can only update a mounted component.' ); this._pendingProps = nextProps; this._performUpdateIfNecessary(transaction); }, /** * Call `_performUpdateIfNecessary` within a new transaction. * * @param {ReactReconcileTransaction} transaction * @internal */ performUpdateIfNecessary: function() { var transaction = ReactComponent.ReactReconcileTransaction.getPooled(); transaction.perform(this._performUpdateIfNecessary, this, transaction); ReactComponent.ReactReconcileTransaction.release(transaction); }, /** * If `_pendingProps` is set, update the component. * * @param {ReactReconcileTransaction} transaction * @internal */ _performUpdateIfNecessary: function(transaction) { if (this._pendingProps == null) { return; } var prevProps = this.props; this.props = this._pendingProps; this._pendingProps = null; this.updateComponent(transaction, prevProps); }, /** * Updates the component's currently mounted representation. * * @param {ReactReconcileTransaction} transaction * @param {object} prevProps * @internal */ updateComponent: function(transaction, prevProps) { var props = this.props; // If either the owner or a `ref` has changed, make sure the newest owner // has stored a reference to `this`, and the previous owner (if different) // has forgotten the reference to `this`. if (props.__owner__ !== prevProps.__owner__ || props.ref !== prevProps.ref) { if (prevProps.ref != null) { ReactOwner.removeComponentAsRefFrom( this, prevProps.ref, prevProps.__owner__ ); } // Correct, even if the owner is the same, and only the ref has changed. if (props.ref != null) { ReactOwner.addComponentAsRefTo(this, props.ref, props.__owner__); } } }, /** * Mounts this component and inserts it into the DOM. * * @param {string} rootID DOM ID of the root node. * @param {DOMElement} container DOM element to mount into. * @param {boolean} shouldReuseMarkup If true, do not insert markup * @final * @internal * @see {ReactMount.renderComponent} */ mountComponentIntoNode: function(rootID, container, shouldReuseMarkup) { var transaction = ReactComponent.ReactReconcileTransaction.getPooled(); transaction.perform( this._mountComponentIntoNode, this, rootID, container, transaction, shouldReuseMarkup ); ReactComponent.ReactReconcileTransaction.release(transaction); }, /** * @param {string} rootID DOM ID of the root node. * @param {DOMElement} container DOM element to mount into. * @param {ReactReconcileTransaction} transaction * @param {boolean} shouldReuseMarkup If true, do not insert markup * @final * @private */ _mountComponentIntoNode: function( rootID, container, transaction, shouldReuseMarkup) { var markup = this.mountComponent(rootID, transaction, 0); ReactComponent.mountImageIntoNode(markup, container, shouldReuseMarkup); }, /** * Checks if this component is owned by the supplied `owner` component. * * @param {ReactComponent} owner Component to check. * @return {boolean} True if `owners` owns this component. * @final * @internal */ isOwnedBy: function(owner) { return this.props.__owner__ === owner; }, /** * Gets another component, that shares the same owner as this one, by ref. * * @param {string} ref of a sibling Component. * @return {?ReactComponent} the actual sibling Component. * @final * @internal */ getSiblingByRef: function(ref) { var owner = this.props.__owner__; if (!owner || !owner.refs) { return null; } return owner.refs[ref]; } }) }; module.exports = ReactComponent; },{"./ReactComponentEnvironment":30,"./ReactCurrentOwner":32,"./ReactOwner":57,"./ReactUpdates":69,"./invariant":106,"./keyMirror":112,"./merge":115}],29:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactComponentBrowserEnvironment */ /*jslint evil: true */ "use strict"; var ReactDOMIDOperations = require("./ReactDOMIDOperations"); var ReactMarkupChecksum = require("./ReactMarkupChecksum"); var ReactMount = require("./ReactMount"); var ReactReconcileTransaction = require("./ReactReconcileTransaction"); var getReactRootElementInContainer = require("./getReactRootElementInContainer"); var invariant = require("./invariant"); var mutateHTMLNodeWithMarkup = require("./mutateHTMLNodeWithMarkup"); var ELEMENT_NODE_TYPE = 1; var DOC_NODE_TYPE = 9; /** * Abstracts away all functionality of `ReactComponent` requires knowledge of * the browser context. */ var ReactComponentBrowserEnvironment = { /** * Mixed into every component instance. */ Mixin: { /** * Returns the DOM node rendered by this component. * * @return {DOMElement} The root node of this component. * @final * @protected */ getDOMNode: function() { invariant( this.isMounted(), 'getDOMNode(): A component must be mounted to have a DOM node.' ); return ReactMount.getNode(this._rootNodeID); } }, ReactReconcileTransaction: ReactReconcileTransaction, DOMIDOperations: ReactDOMIDOperations, /** * If a particular environment requires that some resources be cleaned up, * specify this in the injected Mixin. In the DOM, we would likely want to * purge any cached node ID lookups. * * @private */ unmountIDFromEnvironment: function(rootNodeID) { ReactMount.purgeID(rootNodeID); }, /** * @param {string} markup Markup string to place into the DOM Element. * @param {DOMElement} container DOM Element to insert markup into. * @param {boolean} shouldReuseMarkup Should reuse the existing markup in the * container if possible. */ mountImageIntoNode: function(markup, container, shouldReuseMarkup) { invariant( container && ( container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE && ReactMount.allowFullPageRender ), 'mountComponentIntoNode(...): Target container is not valid.' ); if (shouldReuseMarkup) { if (ReactMarkupChecksum.canReuseMarkup( markup, getReactRootElementInContainer(container))) { return; } else { if (true) { console.warn( 'React attempted to use reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are using ' + 'server rendering and the markup generated on the server was ' + 'not what the client was expecting. React injected new markup ' + 'to compensate which works but you have lost many of the ' + 'benefits of server rendering. Instead, figure out why the ' + 'markup being generated is different on the client or server.' ); } } } // You can't naively set the innerHTML of the entire document. You need // to mutate documentElement which requires doing some crazy tricks. See // mutateHTMLNodeWithMarkup() if (container.nodeType === DOC_NODE_TYPE) { mutateHTMLNodeWithMarkup(container.documentElement, markup); return; } // Asynchronously inject markup by ensuring that the container is not in // the document when settings its `innerHTML`. var parent = container.parentNode; if (parent) { var next = container.nextSibling; parent.removeChild(container); container.innerHTML = markup; if (next) { parent.insertBefore(container, next); } else { parent.appendChild(container); } } else { container.innerHTML = markup; } } }; module.exports = ReactComponentBrowserEnvironment; },{"./ReactDOMIDOperations":37,"./ReactMarkupChecksum":52,"./ReactMount":53,"./ReactReconcileTransaction":61,"./getReactRootElementInContainer":103,"./invariant":106,"./mutateHTMLNodeWithMarkup":119}],30:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactComponentEnvironment */ var ReactComponentBrowserEnvironment = require("./ReactComponentBrowserEnvironment"); var ReactComponentEnvironment = ReactComponentBrowserEnvironment; module.exports = ReactComponentEnvironment; },{"./ReactComponentBrowserEnvironment":29}],31:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactCompositeComponent */ "use strict"; var ReactComponent = require("./ReactComponent"); var ReactCurrentOwner = require("./ReactCurrentOwner"); var ReactOwner = require("./ReactOwner"); var ReactPerf = require("./ReactPerf"); var ReactPropTransferer = require("./ReactPropTransferer"); var ReactUpdates = require("./ReactUpdates"); var invariant = require("./invariant"); var keyMirror = require("./keyMirror"); var merge = require("./merge"); var mixInto = require("./mixInto"); var objMap = require("./objMap"); /** * Policies that describe methods in `ReactCompositeComponentInterface`. */ var SpecPolicy = keyMirror({ /** * These methods may be defined only once by the class specification or mixin. */ DEFINE_ONCE: null, /** * These methods may be defined by both the class specification and mixins. * Subsequent definitions will be chained. These methods must return void. */ DEFINE_MANY: null, /** * These methods are overriding the base ReactCompositeComponent class. */ OVERRIDE_BASE: null, /** * These methods are similar to DEFINE_MANY, except we assume they return * objects. We try to merge the keys of the return values of all the mixed in * functions. If there is a key conflict we throw. */ DEFINE_MANY_MERGED: null }); /** * Composite components are higher-level components that compose other composite * or native components. * * To create a new type of `ReactCompositeComponent`, pass a specification of * your new class to `React.createClass`. The only requirement of your class * specification is that you implement a `render` method. * * var MyComponent = React.createClass({ * render: function() { * return <div>Hello World</div>; * } * }); * * The class specification supports a specific protocol of methods that have * special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for * more the comprehensive protocol. Any other properties and methods in the * class specification will available on the prototype. * * @interface ReactCompositeComponentInterface * @internal */ var ReactCompositeComponentInterface = { /** * An array of Mixin objects to include when defining your component. * * @type {array} * @optional */ mixins: SpecPolicy.DEFINE_MANY, /** * Definition of prop types for this component. * * @type {object} * @optional */ propTypes: SpecPolicy.DEFINE_ONCE, // ==== Definition methods ==== /** * Invoked when the component is mounted. Values in the mapping will be set on * `this.props` if that prop is not specified (i.e. using an `in` check). * * This method is invoked before `getInitialState` and therefore cannot rely * on `this.state` or use `this.setState`. * * @return {object} * @optional */ getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, /** * Invoked once before the component is mounted. The return value will be used * as the initial value of `this.state`. * * getInitialState: function() { * return { * isOn: false, * fooBaz: new BazFoo() * } * } * * @return {object} * @optional */ getInitialState: SpecPolicy.DEFINE_MANY_MERGED, /** * Uses props from `this.props` and state from `this.state` to render the * structure of the component. * * No guarantees are made about when or how often this method is invoked, so * it must not have side effects. * * render: function() { * var name = this.props.name; * return <div>Hello, {name}!</div>; * } * * @return {ReactComponent} * @nosideeffects * @required */ render: SpecPolicy.DEFINE_ONCE, // ==== Delegate methods ==== /** * Invoked when the component is initially created and about to be mounted. * This may have side effects, but any external subscriptions or data created * by this method must be cleaned up in `componentWillUnmount`. * * @optional */ componentWillMount: SpecPolicy.DEFINE_MANY, /** * Invoked when the component has been mounted and has a DOM representation. * However, there is no guarantee that the DOM node is in the document. * * Use this as an opportunity to operate on the DOM when the component has * been mounted (initialized and rendered) for the first time. * * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidMount: SpecPolicy.DEFINE_MANY, /** * Invoked before the component receives new props. * * Use this as an opportunity to react to a prop transition by updating the * state using `this.setState`. Current props are accessed via `this.props`. * * componentWillReceiveProps: function(nextProps) { * this.setState({ * likesIncreasing: nextProps.likeCount > this.props.likeCount * }); * } * * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop * transition may cause a state change, but the opposite is not true. If you * need it, you are probably looking for `componentWillUpdate`. * * @param {object} nextProps * @optional */ componentWillReceiveProps: SpecPolicy.DEFINE_MANY, /** * Invoked while deciding if the component should be updated as a result of * receiving new props and state. * * Use this as an opportunity to `return false` when you're certain that the * transition to the new props and state will not require a component update. * * shouldComponentUpdate: function(nextProps, nextState) { * return !equal(nextProps, this.props) || !equal(nextState, this.state); * } * * @param {object} nextProps * @param {?object} nextState * @return {boolean} True if the component should update. * @optional */ shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, /** * Invoked when the component is about to update due to a transition from * `this.props` and `this.state` to `nextProps` and `nextState`. * * Use this as an opportunity to perform preparation before an update occurs. * * NOTE: You **cannot** use `this.setState()` in this method. * * @param {object} nextProps * @param {?object} nextState * @param {ReactReconcileTransaction} transaction * @optional */ componentWillUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component's DOM representation has been updated. * * Use this as an opportunity to operate on the DOM when the component has * been updated. * * @param {object} prevProps * @param {?object} prevState * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component is about to be removed from its parent and have * its DOM representation destroyed. * * Use this as an opportunity to deallocate any external resources. * * NOTE: There is no `componentDidUnmount` since your component will have been * destroyed by that point. * * @optional */ componentWillUnmount: SpecPolicy.DEFINE_MANY, // ==== Advanced methods ==== /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @internal * @overridable */ updateComponent: SpecPolicy.OVERRIDE_BASE }; /** * Mapping from class specification keys to special processing functions. * * Although these are declared in the specification when defining classes * using `React.createClass`, they will not be on the component's prototype. */ var RESERVED_SPEC_KEYS = { displayName: function(Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function(Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, propTypes: function(Constructor, propTypes) { Constructor.propTypes = propTypes; } }; function validateMethodOverride(proto, name) { var specPolicy = ReactCompositeComponentInterface[name]; // Disallow overriding of base class methods unless explicitly allowed. if (ReactCompositeComponentMixin.hasOwnProperty(name)) { invariant( specPolicy === SpecPolicy.OVERRIDE_BASE, 'ReactCompositeComponentInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name ); } // Disallow defining methods more than once unless explicitly allowed. if (proto.hasOwnProperty(name)) { invariant( specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED, 'ReactCompositeComponentInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name ); } } function validateLifeCycleOnReplaceState(instance) { var compositeLifeCycleState = instance._compositeLifeCycleState; invariant( instance.isMounted() || compositeLifeCycleState === CompositeLifeCycle.MOUNTING, 'replaceState(...): Can only update a mounted or mounting component.' ); invariant( compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE && compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, 'replaceState(...): Cannot update while unmounting component or during ' + 'an existing state transition (such as within `render`).' ); } /** * Custom version of `mixInto` which handles policy validation and reserved * specification keys when building `ReactCompositeComponent` classses. */ function mixSpecIntoComponent(Constructor, spec) { var proto = Constructor.prototype; for (var name in spec) { var property = spec[name]; if (!spec.hasOwnProperty(name) || !property) { continue; } validateMethodOverride(proto, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactCompositeComponent methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isCompositeComponentMethod = name in ReactCompositeComponentInterface; var isInherited = name in proto; var markedDontBind = property.__reactDontBind; var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isCompositeComponentMethod && !isInherited && !markedDontBind; if (shouldAutoBind) { if (!proto.__reactAutoBindMap) { proto.__reactAutoBindMap = {}; } proto.__reactAutoBindMap[name] = property; proto[name] = property; } else { if (isInherited) { // For methods which are defined more than once, call the existing // methods before calling the new property. if (ReactCompositeComponentInterface[name] === SpecPolicy.DEFINE_MANY_MERGED) { proto[name] = createMergedResultFunction(proto[name], property); } else { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; } } } } } /** * Merge two objects, but throw if both contain the same key. * * @param {object} one The first object, which is mutated. * @param {object} two The second object * @return {object} one after it has been mutated to contain everything in two. */ function mergeObjectsWithNoDuplicateKeys(one, two) { invariant( one && two && typeof one === 'object' && typeof two === 'object', 'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects' ); objMap(two, function(value, key) { invariant( one[key] === undefined, 'mergeObjectsWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: %s', key ); one[key] = value; }); return one; } /** * Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createMergedResultFunction(one, two) { return function mergedResult() { return mergeObjectsWithNoDuplicateKeys( one.apply(this, arguments), two.apply(this, arguments) ); }; } /** * Creates a function that invokes two functions and ignores their return vales. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } /** * `ReactCompositeComponent` maintains an auxiliary life cycle state in * `this._compositeLifeCycleState` (which can be null). * * This is different from the life cycle state maintained by `ReactComponent` in * `this._lifeCycleState`. The following diagram shows how the states overlap in * time. There are times when the CompositeLifeCycle is null - at those times it * is only meaningful to look at ComponentLifeCycle alone. * * Top Row: ReactComponent.ComponentLifeCycle * Low Row: ReactComponent.CompositeLifeCycle * * +-------+------------------------------------------------------+--------+ * | UN | MOUNTED | UN | * |MOUNTED| | MOUNTED| * +-------+------------------------------------------------------+--------+ * | ^--------+ +------+ +------+ +------+ +--------^ | * | | | | | | | | | | | | * | 0--|MOUNTING|-0-|RECEIV|-0-|RECEIV|-0-|RECEIV|-0-| UN |--->0 | * | | | |PROPS | | PROPS| | STATE| |MOUNTING| | * | | | | | | | | | | | | * | | | | | | | | | | | | * | +--------+ +------+ +------+ +------+ +--------+ | * | | | | * +-------+------------------------------------------------------+--------+ */ var CompositeLifeCycle = keyMirror({ /** * Components in the process of being mounted respond to state changes * differently. */ MOUNTING: null, /** * Components in the process of being unmounted are guarded against state * changes. */ UNMOUNTING: null, /** * Components that are mounted and receiving new props respond to state * changes differently. */ RECEIVING_PROPS: null, /** * Components that are mounted and receiving new state are guarded against * additional state changes. */ RECEIVING_STATE: null }); /** * @lends {ReactCompositeComponent.prototype} */ var ReactCompositeComponentMixin = { /** * Base constructor for all composite component. * * @param {?object} initialProps * @param {*} children * @final * @internal */ construct: function(initialProps, children) { // Children can be either an array or more than one argument ReactComponent.Mixin.construct.apply(this, arguments); this.state = null; this._pendingState = null; this._compositeLifeCycleState = null; }, /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function() { return ReactComponent.Mixin.isMounted.call(this) && this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING; }, /** * Initializes the component, renders markup, and registers event listeners. * * @param {string} rootID DOM ID of the root node. * @param {ReactReconcileTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy * @return {?string} Rendered markup to be inserted into the DOM. * @final * @internal */ mountComponent: ReactPerf.measure( 'ReactCompositeComponent', 'mountComponent', function(rootID, transaction, mountDepth) { ReactComponent.Mixin.mountComponent.call( this, rootID, transaction, mountDepth ); this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING; this._defaultProps = this.getDefaultProps ? this.getDefaultProps() : null; this._processProps(this.props); if (this.__reactAutoBindMap) { this._bindAutoBindMethods(); } this.state = this.getInitialState ? this.getInitialState() : null; this._pendingState = null; this._pendingForceUpdate = false; if (this.componentWillMount) { this.componentWillMount(); // When mounting, calls to `setState` by `componentWillMount` will set // `this._pendingState` without triggering a re-render. if (this._pendingState) { this.state = this._pendingState; this._pendingState = null; } } this._renderedComponent = this._renderValidatedComponent(); // Done with mounting, `setState` will now trigger UI changes. this._compositeLifeCycleState = null; var markup = this._renderedComponent.mountComponent( rootID, transaction, mountDepth + 1 ); if (this.componentDidMount) { transaction.getReactMountReady().enqueue(this, this.componentDidMount); } return markup; } ), /** * Releases any resources allocated by `mountComponent`. * * @final * @internal */ unmountComponent: function() { this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING; if (this.componentWillUnmount) { this.componentWillUnmount(); } this._compositeLifeCycleState = null; this._defaultProps = null; ReactComponent.Mixin.unmountComponent.call(this); this._renderedComponent.unmountComponent(); this._renderedComponent = null; if (this.refs) { this.refs = null; } // Some existing components rely on this.props even after they've been // destroyed (in event handlers). // TODO: this.props = null; // TODO: this.state = null; }, /** * Sets a subset of the state. Always use this or `replaceState` to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after state is updated. * @final * @protected */ setState: function(partialState, callback) { // Merge with `_pendingState` if it exists, otherwise with existing state. this.replaceState( merge(this._pendingState || this.state, partialState), callback ); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {object} completeState Next state. * @param {?function} callback Called after state is updated. * @final * @protected */ replaceState: function(completeState, callback) { validateLifeCycleOnReplaceState(this); this._pendingState = completeState; ReactUpdates.enqueueUpdate(this, callback); }, /** * Processes props by setting default values for unspecified props and * asserting that the props are valid. * * @param {object} props * @private */ _processProps: function(props) { var propName; var defaultProps = this._defaultProps; for (propName in defaultProps) { if (!(propName in props)) { props[propName] = defaultProps[propName]; } } var propTypes = this.constructor.propTypes; if (propTypes) { var componentName = this.constructor.displayName; for (propName in propTypes) { var checkProp = propTypes[propName]; if (checkProp) { checkProp(props, propName, componentName); } } } }, performUpdateIfNecessary: function() { var compositeLifeCycleState = this._compositeLifeCycleState; // Do not trigger a state transition if we are in the middle of mounting or // receiving props because both of those will already be doing this. if (compositeLifeCycleState === CompositeLifeCycle.MOUNTING || compositeLifeCycleState === CompositeLifeCycle.RECEIVING_PROPS) { return; } ReactComponent.Mixin.performUpdateIfNecessary.call(this); }, /** * If any of `_pendingProps`, `_pendingState`, or `_pendingForceUpdate` is * set, update the component. * * @param {ReactReconcileTransaction} transaction * @internal */ _performUpdateIfNecessary: function(transaction) { if (this._pendingProps == null && this._pendingState == null && !this._pendingForceUpdate) { return; } var nextProps = this.props; if (this._pendingProps != null) { nextProps = this._pendingProps; this._processProps(nextProps); this._pendingProps = null; this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS; if (this.componentWillReceiveProps) { this.componentWillReceiveProps(nextProps, transaction); } } this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_STATE; var nextState = this._pendingState || this.state; this._pendingState = null; if (this._pendingForceUpdate || !this.shouldComponentUpdate || this.shouldComponentUpdate(nextProps, nextState)) { this._pendingForceUpdate = false; // Will set `this.props` and `this.state`. this._performComponentUpdate(nextProps, nextState, transaction); } else { // If it's determined that a component should not update, we still want // to set props and state. this.props = nextProps; this.state = nextState; } this._compositeLifeCycleState = null; }, /** * Merges new props and state, notifies delegate methods of update and * performs update. * * @param {object} nextProps Next object to set as properties. * @param {?object} nextState Next object to set as state. * @param {ReactReconcileTransaction} transaction * @private */ _performComponentUpdate: function(nextProps, nextState, transaction) { var prevProps = this.props; var prevState = this.state; if (this.componentWillUpdate) { this.componentWillUpdate(nextProps, nextState, transaction); } this.props = nextProps; this.state = nextState; this.updateComponent(transaction, prevProps, prevState); if (this.componentDidUpdate) { transaction.getReactMountReady().enqueue( this, this.componentDidUpdate.bind(this, prevProps, prevState) ); } }, /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @param {object} prevProps * @param {?object} prevState * @internal * @overridable */ updateComponent: ReactPerf.measure( 'ReactCompositeComponent', 'updateComponent', function(transaction, prevProps, prevState) { ReactComponent.Mixin.updateComponent.call(this, transaction, prevProps); var currentComponent = this._renderedComponent; var nextComponent = this._renderValidatedComponent(); if (currentComponent.constructor === nextComponent.constructor) { currentComponent.receiveProps(nextComponent.props, transaction); } else { // These two IDs are actually the same! But nothing should rely on that. var thisID = this._rootNodeID; var currentComponentID = currentComponent._rootNodeID; currentComponent.unmountComponent(); this._renderedComponent = nextComponent; var nextMarkup = nextComponent.mountComponent( thisID, transaction, this._mountDepth + 1 ); ReactComponent.DOMIDOperations.dangerouslyReplaceNodeWithMarkupByID( currentComponentID, nextMarkup ); } } ), /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldUpdateComponent`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ forceUpdate: function(callback) { var compositeLifeCycleState = this._compositeLifeCycleState; invariant( this.isMounted() || compositeLifeCycleState === CompositeLifeCycle.MOUNTING, 'forceUpdate(...): Can only force an update on mounted or mounting ' + 'components.' ); invariant( compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE && compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, 'forceUpdate(...): Cannot force an update while unmounting component ' + 'or during an existing state transition (such as within `render`).' ); this._pendingForceUpdate = true; ReactUpdates.enqueueUpdate(this, callback); }, /** * @private */ _renderValidatedComponent: function() { var renderedComponent; ReactCurrentOwner.current = this; try { renderedComponent = this.render(); } catch (error) { // IE8 requires `catch` in order to use `finally`. throw error; } finally { ReactCurrentOwner.current = null; } invariant( ReactComponent.isValidComponent(renderedComponent), '%s.render(): A valid ReactComponent must be returned.', this.constructor.displayName || 'ReactCompositeComponent' ); return renderedComponent; }, /** * @private */ _bindAutoBindMethods: function() { for (var autoBindKey in this.__reactAutoBindMap) { if (!this.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { continue; } var method = this.__reactAutoBindMap[autoBindKey]; this[autoBindKey] = this._bindAutoBindMethod(method); } }, /** * Binds a method to the component. * * @param {function} method Method to be bound. * @private */ _bindAutoBindMethod: function(method) { var component = this; var boundMethod = function() { return method.apply(component, arguments); }; if (true) { boundMethod.__reactBoundContext = component; boundMethod.__reactBoundMethod = method; boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; boundMethod.bind = function(newThis) { // User is trying to bind() an autobound method; we effectively will // ignore the value of "this" that the user is trying to use, so // let's warn. if (newThis !== component && newThis !== null) { console.warn( 'bind(): React component methods may only be bound to the ' + 'component instance. See ' + componentName ); } else if (arguments.length === 1) { console.warn( 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See ' + componentName ); return boundMethod; } var reboundMethod = _bind.apply(boundMethod, arguments); reboundMethod.__reactBoundContext = component; reboundMethod.__reactBoundMethod = method; reboundMethod.__reactBoundArguments = Array.prototype.slice.call(arguments, 1); return reboundMethod; }; } return boundMethod; } }; var ReactCompositeComponentBase = function() {}; mixInto(ReactCompositeComponentBase, ReactComponent.Mixin); mixInto(ReactCompositeComponentBase, ReactOwner.Mixin); mixInto(ReactCompositeComponentBase, ReactPropTransferer.Mixin); mixInto(ReactCompositeComponentBase, ReactCompositeComponentMixin); /** * Module for creating composite components. * * @class ReactCompositeComponent * @extends ReactComponent * @extends ReactOwner * @extends ReactPropTransferer */ var ReactCompositeComponent = { LifeCycle: CompositeLifeCycle, Base: ReactCompositeComponentBase, /** * Creates a composite component class given a class specification. * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. * @public */ createClass: function(spec) { var Constructor = function() {}; Constructor.prototype = new ReactCompositeComponentBase(); Constructor.prototype.constructor = Constructor; mixSpecIntoComponent(Constructor, spec); invariant( Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.' ); if (true) { if (Constructor.prototype.componentShouldUpdate) { console.warn( (spec.displayName || 'A component') + ' has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.' ); } } // Reduce time spent doing lookups by setting these on the prototype. for (var methodName in ReactCompositeComponentInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } } var ConvenienceConstructor = function(props, children) { var instance = new Constructor(); instance.construct.apply(instance, arguments); return instance; }; ConvenienceConstructor.componentConstructor = Constructor; ConvenienceConstructor.originalSpec = spec; return ConvenienceConstructor; }, /** * Checks if a value is a valid component constructor. * * @param {*} * @return {boolean} * @public */ isValidClass: function(componentClass) { return componentClass instanceof Function && 'componentConstructor' in componentClass && componentClass.componentConstructor instanceof Function; } }; module.exports = ReactCompositeComponent; },{"./ReactComponent":28,"./ReactCurrentOwner":32,"./ReactOwner":57,"./ReactPerf":58,"./ReactPropTransferer":59,"./ReactUpdates":69,"./invariant":106,"./keyMirror":112,"./merge":115,"./mixInto":118,"./objMap":121}],32:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactCurrentOwner */ "use strict"; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. * * The depth indicate how many composite components are above this render level. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; module.exports = ReactCurrentOwner; },{}],33:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOM * @typechecks static-only */ "use strict"; var ReactDOMComponent = require("./ReactDOMComponent"); var mergeInto = require("./mergeInto"); var objMapKeyVal = require("./objMapKeyVal"); /** * Creates a new React class that is idempotent and capable of containing other * React components. It accepts event listeners and DOM properties that are * valid according to `DOMProperty`. * * - Event listeners: `onClick`, `onMouseDown`, etc. * - DOM properties: `className`, `name`, `title`, etc. * * The `style` property functions differently from the DOM API. It accepts an * object mapping of style properties to values. * * @param {string} tag Tag name (e.g. `div`). * @param {boolean} omitClose True if the close tag should be omitted. * @private */ function createDOMComponentClass(tag, omitClose) { var Constructor = function() {}; Constructor.prototype = new ReactDOMComponent(tag, omitClose); Constructor.prototype.constructor = Constructor; Constructor.displayName = tag; var ConvenienceConstructor = function(props, children) { var instance = new Constructor(); instance.construct.apply(instance, arguments); return instance; }; ConvenienceConstructor.componentConstructor = Constructor; return ConvenienceConstructor; } /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. * This is also accessible via `React.DOM`. * * @public */ var ReactDOM = objMapKeyVal({ a: false, abbr: false, address: false, area: false, article: false, aside: false, audio: false, b: false, base: false, bdi: false, bdo: false, big: false, blockquote: false, body: false, br: true, button: false, canvas: false, caption: false, cite: false, code: false, col: true, colgroup: false, data: false, datalist: false, dd: false, del: false, details: false, dfn: false, div: false, dl: false, dt: false, em: false, embed: true, fieldset: false, figcaption: false, figure: false, footer: false, form: false, // NOTE: Injected, see `ReactDOMForm`. h1: false, h2: false, h3: false, h4: false, h5: false, h6: false, head: false, header: false, hr: true, html: false, i: false, iframe: false, img: true, input: true, ins: false, kbd: false, keygen: true, label: false, legend: false, li: false, link: false, main: false, map: false, mark: false, menu: false, menuitem: false, // NOTE: Close tag should be omitted, but causes problems. meta: true, meter: false, nav: false, noscript: false, object: false, ol: false, optgroup: false, option: false, output: false, p: false, param: true, pre: false, progress: false, q: false, rp: false, rt: false, ruby: false, s: false, samp: false, script: false, section: false, select: false, small: false, source: false, span: false, strong: false, style: false, sub: false, summary: false, sup: false, table: false, tbody: false, td: false, textarea: false, // NOTE: Injected, see `ReactDOMTextarea`. tfoot: false, th: false, thead: false, time: false, title: false, tr: false, track: true, u: false, ul: false, 'var': false, video: false, wbr: false, // SVG circle: false, g: false, line: false, path: false, polyline: false, rect: false, svg: false, text: false }, createDOMComponentClass); var injection = { injectComponentClasses: function(componentClasses) { mergeInto(ReactDOM, componentClasses); } }; ReactDOM.injection = injection; module.exports = ReactDOM; },{"./ReactDOMComponent":35,"./mergeInto":117,"./objMapKeyVal":122}],34:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMButton */ "use strict"; var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); var keyMirror = require("./keyMirror"); // Store a reference to the <button> `ReactDOMComponent`. var button = ReactDOM.button; var mouseListenerNames = keyMirror({ onClick: true, onDoubleClick: true, onMouseDown: true, onMouseMove: true, onMouseUp: true, onClickCapture: true, onDoubleClickCapture: true, onMouseDownCapture: true, onMouseMoveCapture: true, onMouseUpCapture: true }); /** * Implements a <button> native component that does not receive mouse events * when `disabled` is set. */ var ReactDOMButton = ReactCompositeComponent.createClass({ render: function() { var props = {}; // Copy the props; except the mouse listeners if we're disabled for (var key in this.props) { if (this.props.hasOwnProperty(key) && (!this.props.disabled || !mouseListenerNames[key])) { props[key] = this.props[key]; } } return button(props, this.props.children); } }); module.exports = ReactDOMButton; },{"./ReactCompositeComponent":31,"./ReactDOM":33,"./keyMirror":112}],35:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMComponent * @typechecks static-only */ "use strict"; var CSSPropertyOperations = require("./CSSPropertyOperations"); var DOMProperty = require("./DOMProperty"); var DOMPropertyOperations = require("./DOMPropertyOperations"); var ReactComponent = require("./ReactComponent"); var ReactEventEmitter = require("./ReactEventEmitter"); var ReactMultiChild = require("./ReactMultiChild"); var ReactMount = require("./ReactMount"); var ReactPerf = require("./ReactPerf"); var escapeTextForBrowser = require("./escapeTextForBrowser"); var invariant = require("./invariant"); var keyOf = require("./keyOf"); var merge = require("./merge"); var mixInto = require("./mixInto"); var putListener = ReactEventEmitter.putListener; var deleteListener = ReactEventEmitter.deleteListener; var registrationNames = ReactEventEmitter.registrationNames; // For quickly matching children type, to test if can be treated as content. var CONTENT_TYPES = {'string': true, 'number': true}; var STYLE = keyOf({style: null}); /** * @param {?object} props */ function assertValidProps(props) { if (!props) { return; } // Note the use of `==` which checks for null or undefined. invariant( props.children == null || props.dangerouslySetInnerHTML == null, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ); invariant( props.style == null || typeof props.style === 'object', 'The `style` prop expects a mapping from style properties to values, ' + 'not a string.' ); } /** * @constructor ReactDOMComponent * @extends ReactComponent * @extends ReactMultiChild */ function ReactDOMComponent(tag, omitClose) { this._tagOpen = '<' + tag; this._tagClose = omitClose ? '' : '</' + tag + '>'; this.tagName = tag.toUpperCase(); } ReactDOMComponent.Mixin = { /** * Generates root tag markup then recurses. This method has side effects and * is not idempotent. * * @internal * @param {string} rootID The root DOM ID for this node. * @param {ReactReconcileTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy * @return {string} The computed markup. */ mountComponent: ReactPerf.measure( 'ReactDOMComponent', 'mountComponent', function(rootID, transaction, mountDepth) { ReactComponent.Mixin.mountComponent.call( this, rootID, transaction, mountDepth ); assertValidProps(this.props); return ( this._createOpenTagMarkup() + this._createContentMarkup(transaction) + this._tagClose ); } ), /** * Creates markup for the open tag and all attributes. * * This method has side effects because events get registered. * * Iterating over object properties is faster than iterating over arrays. * @see http://jsperf.com/obj-vs-arr-iteration * * @private * @return {string} Markup of opening tag. */ _createOpenTagMarkup: function() { var props = this.props; var ret = this._tagOpen; for (var propKey in props) { if (!props.hasOwnProperty(propKey)) { continue; } var propValue = props[propKey]; if (propValue == null) { continue; } if (registrationNames[propKey]) { putListener(this._rootNodeID, propKey, propValue); } else { if (propKey === STYLE) { if (propValue) { propValue = props.style = merge(props.style); } propValue = CSSPropertyOperations.createMarkupForStyles(propValue); } var markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue); if (markup) { ret += ' ' + markup; } } } var escapedID = escapeTextForBrowser(this._rootNodeID); return ret + ' ' + ReactMount.ATTR_NAME + '="' + escapedID + '">'; }, /** * Creates markup for the content between the tags. * * @private * @param {ReactReconcileTransaction} transaction * @return {string} Content markup. */ _createContentMarkup: function(transaction) { // Intentional use of != to avoid catching zero/false. var innerHTML = this.props.dangerouslySetInnerHTML; if (innerHTML != null) { if (innerHTML.__html != null) { return innerHTML.__html; } } else { var contentToUse = CONTENT_TYPES[typeof this.props.children] ? this.props.children : null; var childrenToUse = contentToUse != null ? null : this.props.children; if (contentToUse != null) { return escapeTextForBrowser(contentToUse); } else if (childrenToUse != null) { var mountImages = this.mountChildren( childrenToUse, transaction ); return mountImages.join(''); } } return ''; }, receiveProps: function(nextProps, transaction) { assertValidProps(nextProps); ReactComponent.Mixin.receiveProps.call(this, nextProps, transaction); }, /** * Updates a native DOM component after it has already been allocated and * attached to the DOM. Reconciles the root DOM node, then recurses. * * @param {ReactReconcileTransaction} transaction * @param {object} prevProps * @internal * @overridable */ updateComponent: ReactPerf.measure( 'ReactDOMComponent', 'updateComponent', function(transaction, prevProps) { ReactComponent.Mixin.updateComponent.call(this, transaction, prevProps); this._updateDOMProperties(prevProps); this._updateDOMChildren(prevProps, transaction); } ), /** * Reconciles the properties by detecting differences in property values and * updating the DOM as necessary. This function is probably the single most * critical path for performance optimization. * * TODO: Benchmark whether checking for changed values in memory actually * improves performance (especially statically positioned elements). * TODO: Benchmark the effects of putting this at the top since 99% of props * do not change for a given reconciliation. * TODO: Benchmark areas that can be improved with caching. * * @private * @param {object} lastProps */ _updateDOMProperties: function(lastProps) { var nextProps = this.props; var propKey; var styleName; var styleUpdates; for (propKey in lastProps) { if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) { continue; } if (propKey === STYLE) { var lastStyle = lastProps[propKey]; for (styleName in lastStyle) { if (lastStyle.hasOwnProperty(styleName)) { styleUpdates = styleUpdates || {}; styleUpdates[styleName] = ''; } } } else if (registrationNames[propKey]) { deleteListener(this._rootNodeID, propKey); } else if ( DOMProperty.isStandardName[propKey] || DOMProperty.isCustomAttribute(propKey)) { ReactComponent.DOMIDOperations.deletePropertyByID( this._rootNodeID, propKey ); } } for (propKey in nextProps) { var nextProp = nextProps[propKey]; var lastProp = lastProps[propKey]; if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) { continue; } if (propKey === STYLE) { if (nextProp) { nextProp = nextProps.style = merge(nextProp); } if (lastProp) { // Unset styles on `lastProp` but not on `nextProp`. for (styleName in lastProp) { if (lastProp.hasOwnProperty(styleName) && !nextProp.hasOwnProperty(styleName)) { styleUpdates = styleUpdates || {}; styleUpdates[styleName] = ''; } } // Update styles that changed since `lastProp`. for (styleName in nextProp) { if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { styleUpdates = styleUpdates || {}; styleUpdates[styleName] = nextProp[styleName]; } } } else { // Relies on `updateStylesByID` not mutating `styleUpdates`. styleUpdates = nextProp; } } else if (registrationNames[propKey]) { putListener(this._rootNodeID, propKey, nextProp); } else if ( DOMProperty.isStandardName[propKey] || DOMProperty.isCustomAttribute(propKey)) { ReactComponent.DOMIDOperations.updatePropertyByID( this._rootNodeID, propKey, nextProp ); } } if (styleUpdates) { ReactComponent.DOMIDOperations.updateStylesByID( this._rootNodeID, styleUpdates ); } }, /** * Reconciles the children with the various properties that affect the * children content. * * @param {object} lastProps * @param {ReactReconcileTransaction} transaction */ _updateDOMChildren: function(lastProps, transaction) { var nextProps = this.props; var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null; var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null; var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html; var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html; // Note the use of `!=` which checks for null or undefined. var lastChildren = lastContent != null ? null : lastProps.children; var nextChildren = nextContent != null ? null : nextProps.children; // If we're switching from children to content/html or vice versa, remove // the old content var lastHasContentOrHtml = lastContent != null || lastHtml != null; var nextHasContentOrHtml = nextContent != null || nextHtml != null; if (lastChildren != null && nextChildren == null) { this.updateChildren(null, transaction); } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { this.updateTextContent(''); } if (nextContent != null) { if (lastContent !== nextContent) { this.updateTextContent('' + nextContent); } } else if (nextHtml != null) { if (lastHtml !== nextHtml) { ReactComponent.DOMIDOperations.updateInnerHTMLByID( this._rootNodeID, nextHtml ); } } else if (nextChildren != null) { this.updateChildren(nextChildren, transaction); } }, /** * Destroys all event registrations for this instance. Does not remove from * the DOM. That must be done by the parent. * * @internal */ unmountComponent: function() { ReactEventEmitter.deleteAllListeners(this._rootNodeID); ReactComponent.Mixin.unmountComponent.call(this); this.unmountChildren(); } }; mixInto(ReactDOMComponent, ReactComponent.Mixin); mixInto(ReactDOMComponent, ReactDOMComponent.Mixin); mixInto(ReactDOMComponent, ReactMultiChild.Mixin); module.exports = ReactDOMComponent; },{"./CSSPropertyOperations":4,"./DOMProperty":9,"./DOMPropertyOperations":10,"./ReactComponent":28,"./ReactEventEmitter":46,"./ReactMount":53,"./ReactMultiChild":55,"./ReactPerf":58,"./escapeTextForBrowser":93,"./invariant":106,"./keyOf":113,"./merge":115,"./mixInto":118}],36:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMForm */ "use strict"; var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); var ReactEventEmitter = require("./ReactEventEmitter"); var EventConstants = require("./EventConstants"); // Store a reference to the <form> `ReactDOMComponent`. var form = ReactDOM.form; /** * Since onSubmit doesn't bubble OR capture on the top level in IE8, we need * to capture it on the <form> element itself. There are lots of hacks we could * do to accomplish this, but the most reliable is to make <form> a * composite component and use `componentDidMount` to attach the event handlers. */ var ReactDOMForm = ReactCompositeComponent.createClass({ render: function() { // TODO: Instead of using `ReactDOM` directly, we should use JSX. However, // `jshint` fails to parse JSX so in order for linting to work in the open // source repo, we need to just use `ReactDOM.form`. return this.transferPropsTo(form(null, this.props.children)); }, componentDidMount: function(node) { ReactEventEmitter.trapBubbledEvent( EventConstants.topLevelTypes.topSubmit, 'submit', node ); } }); module.exports = ReactDOMForm; },{"./EventConstants":15,"./ReactCompositeComponent":31,"./ReactDOM":33,"./ReactEventEmitter":46}],37:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMIDOperations * @typechecks static-only */ /*jslint evil: true */ "use strict"; var CSSPropertyOperations = require("./CSSPropertyOperations"); var DOMChildrenOperations = require("./DOMChildrenOperations"); var DOMPropertyOperations = require("./DOMPropertyOperations"); var ReactMount = require("./ReactMount"); var getTextContentAccessor = require("./getTextContentAccessor"); var invariant = require("./invariant"); /** * Errors for properties that should not be updated with `updatePropertyById()`. * * @type {object} * @private */ var INVALID_PROPERTY_ERRORS = { dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', style: '`style` must be set using `updateStylesByID()`.' }; /** * The DOM property to use when setting text content. * * @type {string} * @private */ var textContentAccessor = getTextContentAccessor() || 'NA'; var LEADING_SPACE = /^ /; /** * Operations used to process updates to DOM nodes. This is made injectable via * `ReactComponent.DOMIDOperations`. */ var ReactDOMIDOperations = { /** * Updates a DOM node with new property values. This should only be used to * update DOM properties in `DOMProperty`. * * @param {string} id ID of the node to update. * @param {string} name A valid property name, see `DOMProperty`. * @param {*} value New value of the property. * @internal */ updatePropertyByID: function(id, name, value) { var node = ReactMount.getNode(id); invariant( !INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name] ); // If we're updating to null or undefined, we should remove the property // from the DOM node instead of inadvertantly setting to a string. This // brings us in line with the same behavior we have on initial render. if (value != null) { DOMPropertyOperations.setValueForProperty(node, name, value); } else { DOMPropertyOperations.deleteValueForProperty(node, name); } }, /** * Updates a DOM node to remove a property. This should only be used to remove * DOM properties in `DOMProperty`. * * @param {string} id ID of the node to update. * @param {string} name A property name to remove, see `DOMProperty`. * @internal */ deletePropertyByID: function(id, name, value) { var node = ReactMount.getNode(id); invariant( !INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name] ); DOMPropertyOperations.deleteValueForProperty(node, name, value); }, /** * This should almost never be used instead of `updatePropertyByID()` due to * the extra object allocation required by the API. That said, this is useful * for batching up several operations across worker thread boundaries. * * @param {string} id ID of the node to update. * @param {object} properties A mapping of valid property names. * @internal * @see {ReactDOMIDOperations.updatePropertyByID} */ updatePropertiesByID: function(id, properties) { for (var name in properties) { if (!properties.hasOwnProperty(name)) { continue; } ReactDOMIDOperations.updatePropertiesByID(id, name, properties[name]); } }, /** * Updates a DOM node with new style values. If a value is specified as '', * the corresponding style property will be unset. * * @param {string} id ID of the node to update. * @param {object} styles Mapping from styles to values. * @internal */ updateStylesByID: function(id, styles) { var node = ReactMount.getNode(id); CSSPropertyOperations.setValueForStyles(node, styles); }, /** * Updates a DOM node's innerHTML. * * @param {string} id ID of the node to update. * @param {string} html An HTML string. * @internal */ updateInnerHTMLByID: function(id, html) { var node = ReactMount.getNode(id); // HACK: IE8- normalize whitespace in innerHTML, removing leading spaces. // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html node.innerHTML = html.replace(LEADING_SPACE, '&nbsp;'); }, /** * Updates a DOM node's text content set by `props.content`. * * @param {string} id ID of the node to update. * @param {string} content Text content. * @internal */ updateTextContentByID: function(id, content) { var node = ReactMount.getNode(id); node[textContentAccessor] = content; }, /** * Replaces a DOM node that exists in the document with markup. * * @param {string} id ID of child to be replaced. * @param {string} markup Dangerous markup to inject in place of child. * @internal * @see {Danger.dangerouslyReplaceNodeWithMarkup} */ dangerouslyReplaceNodeWithMarkupByID: function(id, markup) { var node = ReactMount.getNode(id); DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); }, /** * Updates a component's children by processing a series of updates. * * @param {array<object>} updates List of update configurations. * @param {array<string>} markup List of markup strings. * @internal */ dangerouslyProcessChildrenUpdates: function(updates, markup) { for (var i = 0; i < updates.length; i++) { updates[i].parentNode = ReactMount.getNode(updates[i].parentID); } DOMChildrenOperations.processUpdates(updates, markup); } }; module.exports = ReactDOMIDOperations; },{"./CSSPropertyOperations":4,"./DOMChildrenOperations":8,"./DOMPropertyOperations":10,"./ReactMount":53,"./getTextContentAccessor":104,"./invariant":106}],38:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMInput */ "use strict"; var DOMPropertyOperations = require("./DOMPropertyOperations"); var LinkedValueMixin = require("./LinkedValueMixin"); var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); var ReactMount = require("./ReactMount"); var invariant = require("./invariant"); var merge = require("./merge"); // Store a reference to the <input> `ReactDOMComponent`. var input = ReactDOM.input; var instancesByReactID = {}; /** * Implements an <input> native component that allows setting these optional * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. * * If `checked` or `value` are not supplied (or null/undefined), user actions * that affect the checked state or value will trigger updates to the element. * * If they are supplied (and not null/undefined), the rendered element will not * trigger updates to the element. Instead, the props must change in order for * the rendered element to be updated. * * The rendered element will be initialized as unchecked (or `defaultChecked`) * with an empty value (or `defaultValue`). * * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html */ var ReactDOMInput = ReactCompositeComponent.createClass({ mixins: [LinkedValueMixin], getInitialState: function() { var defaultValue = this.props.defaultValue; return { checked: this.props.defaultChecked || false, value: defaultValue != null ? defaultValue : '' }; }, shouldComponentUpdate: function() { // Defer any updates to this component during the `onChange` handler. return !this._isChanging; }, render: function() { // Clone `this.props` so we don't mutate the input. var props = merge(this.props); props.defaultChecked = null; props.defaultValue = null; props.checked = this.props.checked != null ? this.props.checked : this.state.checked; var value = this.getValue(); props.value = value != null ? value : this.state.value; props.onChange = this._handleChange; return input(props, this.props.children); }, componentDidMount: function(rootNode) { var id = ReactMount.getID(rootNode); instancesByReactID[id] = this; }, componentWillUnmount: function() { var rootNode = this.getDOMNode(); var id = ReactMount.getID(rootNode); delete instancesByReactID[id]; }, componentDidUpdate: function(prevProps, prevState, rootNode) { if (this.props.checked != null) { DOMPropertyOperations.setValueForProperty( rootNode, 'checked', this.props.checked || false ); } var value = this.getValue(); if (value != null) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value); } }, _handleChange: function(event) { var returnValue; var onChange = this.getOnChange(); if (onChange) { this._isChanging = true; returnValue = onChange(event); this._isChanging = false; } this.setState({ checked: event.target.checked, value: event.target.value }); var name = this.props.name; if (this.props.type === 'radio' && name != null) { var rootNode = this.getDOMNode(); // If `rootNode.form` was non-null, then we could try `form.elements`, // but that sometimes behaves strangely in IE8. We could also try using // `form.getElementsByName`, but that will only return direct children // and won't include inputs that use the HTML5 `form=` attribute. Since // the input might not even be in a form, let's just use the global // `getElementsByName` to ensure we don't miss anything. var group = document.getElementsByName(name); for (var i = 0, groupLen = group.length; i < groupLen; i++) { var otherNode = group[i]; if (otherNode === rootNode || otherNode.nodeName !== 'INPUT' || otherNode.type !== 'radio' || otherNode.form !== rootNode.form) { continue; } var otherID = ReactMount.getID(otherNode); invariant( otherID, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.' ); var otherInstance = instancesByReactID[otherID]; invariant( otherInstance, 'ReactDOMInput: Unknown radio button ID %s.', otherID ); // In some cases, this will actually change the `checked` state value. // In other cases, there's no change but this forces a reconcile upon // which componentDidUpdate will reset the DOM property to whatever it // should be. otherInstance.setState({ checked: false }); } } return returnValue; } }); module.exports = ReactDOMInput; },{"./DOMPropertyOperations":10,"./LinkedValueMixin":23,"./ReactCompositeComponent":31,"./ReactDOM":33,"./ReactMount":53,"./invariant":106,"./merge":115}],39:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMOption */ "use strict"; var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); // Store a reference to the <option> `ReactDOMComponent`. var option = ReactDOM.option; /** * Implements an <option> native component that warns when `selected` is set. */ var ReactDOMOption = ReactCompositeComponent.createClass({ componentWillMount: function() { // TODO (yungsters): Remove support for `selected` in <option>. if (this.props.selected != null) { if (true) { console.warn( 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.' ); } } }, render: function() { return option(this.props, this.props.children); } }); module.exports = ReactDOMOption; },{"./ReactCompositeComponent":31,"./ReactDOM":33}],40:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMSelect */ "use strict"; var LinkedValueMixin = require("./LinkedValueMixin"); var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); var invariant = require("./invariant"); var merge = require("./merge"); // Store a reference to the <select> `ReactDOMComponent`. var select = ReactDOM.select; /** * Validation function for `value` and `defaultValue`. * @private */ function selectValueType(props, propName, componentName) { if (props[propName] == null) { return; } if (props.multiple) { invariant( Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if `multiple` is ' + 'true.', propName ); } else { invariant( !Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar value if ' + '`multiple` is false.', propName ); } } /** * If `value` is supplied, updates <option> elements on mount and update. * @private */ function updateOptions() { /*jshint validthis:true */ var propValue = this.getValue(); var value = propValue != null ? propValue : this.state.value; var options = this.getDOMNode().options; var selectedValue = '' + value; for (var i = 0, l = options.length; i < l; i++) { var selected = this.props.multiple ? selectedValue.indexOf(options[i].value) >= 0 : selected = options[i].value === selectedValue; if (selected !== options[i].selected) { options[i].selected = selected; } } } /** * Implements a <select> native component that allows optionally setting the * props `value` and `defaultValue`. If `multiple` is false, the prop must be a * string. If `multiple` is true, the prop must be an array of strings. * * If `value` is not supplied (or null/undefined), user actions that change the * selected option will trigger updates to the rendered options. * * If it is supplied (and not null/undefined), the rendered options will not * update in response to user actions. Instead, the `value` prop must change in * order for the rendered options to update. * * If `defaultValue` is provided, any options with the supplied values will be * selected. */ var ReactDOMSelect = ReactCompositeComponent.createClass({ mixins: [LinkedValueMixin], propTypes: { defaultValue: selectValueType, value: selectValueType }, getInitialState: function() { return {value: this.props.defaultValue || (this.props.multiple ? [] : '')}; }, componentWillReceiveProps: function(nextProps) { if (!this.props.multiple && nextProps.multiple) { this.setState({value: [this.state.value]}); } else if (this.props.multiple && !nextProps.multiple) { this.setState({value: this.state.value[0]}); } }, shouldComponentUpdate: function() { // Defer any updates to this component during the `onChange` handler. return !this._isChanging; }, render: function() { // Clone `this.props` so we don't mutate the input. var props = merge(this.props); props.onChange = this._handleChange; props.value = null; return select(props, this.props.children); }, componentDidMount: updateOptions, componentDidUpdate: updateOptions, _handleChange: function(event) { var returnValue; var onChange = this.getOnChange(); if (onChange) { this._isChanging = true; returnValue = onChange(event); this._isChanging = false; } var selectedValue; if (this.props.multiple) { selectedValue = []; var options = event.target.options; for (var i = 0, l = options.length; i < l; i++) { if (options[i].selected) { selectedValue.push(options[i].value); } } } else { selectedValue = event.target.value; } this.setState({value: selectedValue}); return returnValue; } }); module.exports = ReactDOMSelect; },{"./LinkedValueMixin":23,"./ReactCompositeComponent":31,"./ReactDOM":33,"./invariant":106,"./merge":115}],41:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMSelection */ "use strict"; var getNodeForCharacterOffset = require("./getNodeForCharacterOffset"); var getTextContentAccessor = require("./getTextContentAccessor"); /** * Get the appropriate anchor and focus node/offset pairs for IE. * * The catch here is that IE's selection API doesn't provide information * about whether the selection is forward or backward, so we have to * behave as though it's always forward. * * IE text differs from modern selection in that it behaves as though * block elements end with a new line. This means character offsets will * differ between the two APIs. * * @param {DOMElement} node * @return {object} */ function getIEOffsets(node) { var selection = document.selection; var selectedRange = selection.createRange(); var selectedLength = selectedRange.text.length; // Duplicate selection so we can move range without breaking user selection. var fromStart = selectedRange.duplicate(); fromStart.moveToElementText(node); fromStart.setEndPoint('EndToStart', selectedRange); var startOffset = fromStart.text.length; var endOffset = startOffset + selectedLength; return { start: startOffset, end: endOffset }; } /** * @param {DOMElement} node * @return {?object} */ function getModernOffsets(node) { var selection = window.getSelection(); if (selection.rangeCount === 0) { return null; } var anchorNode = selection.anchorNode; var anchorOffset = selection.anchorOffset; var focusNode = selection.focusNode; var focusOffset = selection.focusOffset; var currentRange = selection.getRangeAt(0); var rangeLength = currentRange.toString().length; var tempRange = currentRange.cloneRange(); tempRange.selectNodeContents(node); tempRange.setEnd(currentRange.startContainer, currentRange.startOffset); var start = tempRange.toString().length; var end = start + rangeLength; // Detect whether the selection is backward. var detectionRange = document.createRange(); detectionRange.setStart(anchorNode, anchorOffset); detectionRange.setEnd(focusNode, focusOffset); var isBackward = detectionRange.collapsed; detectionRange.detach(); return { start: isBackward ? end : start, end: isBackward ? start : end }; } /** * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ function setIEOffsets(node, offsets) { var range = document.selection.createRange().duplicate(); var start, end; if (typeof offsets.end === 'undefined') { start = offsets.start; end = start; } else if (offsets.start > offsets.end) { start = offsets.end; end = offsets.start; } else { start = offsets.start; end = offsets.end; } range.moveToElementText(node); range.moveStart('character', start); range.setEndPoint('EndToStart', range); range.moveEnd('character', end - start); range.select(); } /** * In modern non-IE browsers, we can support both forward and backward * selections. * * Note: IE10+ supports the Selection object, but it does not support * the `extend` method, which means that even in modern IE, it's not possible * to programatically create a backward selection. Thus, for all IE * versions, we use the old IE API to create our selections. * * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ function setModernOffsets(node, offsets) { var selection = window.getSelection(); var length = node[getTextContentAccessor()].length; var start = Math.min(offsets.start, length); var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length); var startMarker = getNodeForCharacterOffset(node, start); var endMarker = getNodeForCharacterOffset(node, end); if (startMarker && endMarker) { var range = document.createRange(); range.setStart(startMarker.node, startMarker.offset); selection.removeAllRanges(); selection.addRange(range); selection.extend(endMarker.node, endMarker.offset); range.detach(); } } var ReactDOMSelection = { /** * @param {DOMElement} node */ getOffsets: function(node) { var getOffsets = document.selection ? getIEOffsets : getModernOffsets; return getOffsets(node); }, /** * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ setOffsets: function(node, offsets) { var setOffsets = document.selection ? setIEOffsets : setModernOffsets; setOffsets(node, offsets); } }; module.exports = ReactDOMSelection; },{"./getNodeForCharacterOffset":102,"./getTextContentAccessor":104}],42:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDOMTextarea */ "use strict"; var DOMPropertyOperations = require("./DOMPropertyOperations"); var LinkedValueMixin = require("./LinkedValueMixin"); var ReactCompositeComponent = require("./ReactCompositeComponent"); var ReactDOM = require("./ReactDOM"); var invariant = require("./invariant"); var merge = require("./merge"); // Store a reference to the <textarea> `ReactDOMComponent`. var textarea = ReactDOM.textarea; /** * Implements a <textarea> native component that allows setting `value`, and * `defaultValue`. This differs from the traditional DOM API because value is * usually set as PCDATA children. * * If `value` is not supplied (or null/undefined), user actions that affect the * value will trigger updates to the element. * * If `value` is supplied (and not null/undefined), the rendered element will * not trigger updates to the element. Instead, the `value` prop must change in * order for the rendered element to be updated. * * The rendered element will be initialized with an empty value, the prop * `defaultValue` if specified, or the children content (deprecated). */ var ReactDOMTextarea = ReactCompositeComponent.createClass({ mixins: [LinkedValueMixin], getInitialState: function() { var defaultValue = this.props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>. var children = this.props.children; if (children != null) { if (true) { console.warn( 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.' ); } invariant( defaultValue == null, 'If you supply `defaultValue` on a <textarea>, do not pass children.' ); if (Array.isArray(children)) { invariant( children.length <= 1, '<textarea> can only have at most one child.' ); children = children[0]; } defaultValue = '' + children; } if (defaultValue == null) { defaultValue = ''; } var value = this.getValue(); return { // We save the initial value so that `ReactDOMComponent` doesn't update // `textContent` (unnecessary since we update value). // The initial value can be a boolean or object so that's why it's // forced to be a string. initialValue: '' + (value != null ? value : defaultValue), value: defaultValue }; }, shouldComponentUpdate: function() { // Defer any updates to this component during the `onChange` handler. return !this._isChanging; }, render: function() { // Clone `this.props` so we don't mutate the input. var props = merge(this.props); var value = this.getValue(); invariant( props.dangerouslySetInnerHTML == null, '`dangerouslySetInnerHTML` does not make sense on <textarea>.' ); props.defaultValue = null; props.value = value != null ? value : this.state.value; props.onChange = this._handleChange; // Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is mutated. return textarea(props, this.state.initialValue); }, componentDidUpdate: function(prevProps, prevState, rootNode) { var value = this.getValue(); if (value != null) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value); } }, _handleChange: function(event) { var returnValue; var onChange = this.getOnChange(); if (onChange) { this._isChanging = true; returnValue = onChange(event); this._isChanging = false; } this.setState({value: event.target.value}); return returnValue; } }); module.exports = ReactDOMTextarea; },{"./DOMPropertyOperations":10,"./LinkedValueMixin":23,"./ReactCompositeComponent":31,"./ReactDOM":33,"./invariant":106,"./merge":115}],43:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDefaultBatchingStrategy */ "use strict"; var ReactUpdates = require("./ReactUpdates"); var Transaction = require("./Transaction"); var emptyFunction = require("./emptyFunction"); var mixInto = require("./mixInto"); var RESET_BATCHED_UPDATES = { initialize: emptyFunction, close: function() { ReactDefaultBatchingStrategy.isBatchingUpdates = false; } }; var FLUSH_BATCHED_UPDATES = { initialize: emptyFunction, close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) }; var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; function ReactDefaultBatchingStrategyTransaction() { this.reinitializeTransaction(); } mixInto(ReactDefaultBatchingStrategyTransaction, Transaction.Mixin); mixInto(ReactDefaultBatchingStrategyTransaction, { getTransactionWrappers: function() { return TRANSACTION_WRAPPERS; } }); var transaction = new ReactDefaultBatchingStrategyTransaction(); var ReactDefaultBatchingStrategy = { isBatchingUpdates: false, /** * Call the provided function in a context within which calls to `setState` * and friends are batched such that components aren't updated unnecessarily. */ batchedUpdates: function(callback, param) { var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; ReactDefaultBatchingStrategy.isBatchingUpdates = true; // The code is written this way to avoid extra allocations if (alreadyBatchingUpdates) { callback(param); } else { transaction.perform(callback, null, param); } } }; module.exports = ReactDefaultBatchingStrategy; },{"./ReactUpdates":69,"./Transaction":82,"./emptyFunction":92,"./mixInto":118}],44:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDefaultInjection */ "use strict"; var ReactDOM = require("./ReactDOM"); var ReactDOMButton = require("./ReactDOMButton"); var ReactDOMForm = require("./ReactDOMForm"); var ReactDOMInput = require("./ReactDOMInput"); var ReactDOMOption = require("./ReactDOMOption"); var ReactDOMSelect = require("./ReactDOMSelect"); var ReactDOMTextarea = require("./ReactDOMTextarea"); var ReactEventEmitter = require("./ReactEventEmitter"); var ReactEventTopLevelCallback = require("./ReactEventTopLevelCallback"); var ReactPerf = require("./ReactPerf"); var DefaultDOMPropertyConfig = require("./DefaultDOMPropertyConfig"); var DOMProperty = require("./DOMProperty"); var ChangeEventPlugin = require("./ChangeEventPlugin"); var CompositionEventPlugin = require("./CompositionEventPlugin"); var DefaultEventPluginOrder = require("./DefaultEventPluginOrder"); var EnterLeaveEventPlugin = require("./EnterLeaveEventPlugin"); var EventPluginHub = require("./EventPluginHub"); var MobileSafariClickEventPlugin = require("./MobileSafariClickEventPlugin"); var ReactInstanceHandles = require("./ReactInstanceHandles"); var SelectEventPlugin = require("./SelectEventPlugin"); var SimpleEventPlugin = require("./SimpleEventPlugin"); var ReactDefaultBatchingStrategy = require("./ReactDefaultBatchingStrategy"); var ReactUpdates = require("./ReactUpdates"); function inject() { ReactEventEmitter.TopLevelCallbackCreator = ReactEventTopLevelCallback; /** * Inject module for resolving DOM hierarchy and plugin ordering. */ EventPluginHub.injection.injectEventPluginOrder(DefaultEventPluginOrder); EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles); /** * Some important event plugins included by default (without having to require * them). */ EventPluginHub.injection.injectEventPluginsByName({ SimpleEventPlugin: SimpleEventPlugin, EnterLeaveEventPlugin: EnterLeaveEventPlugin, ChangeEventPlugin: ChangeEventPlugin, CompositionEventPlugin: CompositionEventPlugin, MobileSafariClickEventPlugin: MobileSafariClickEventPlugin, SelectEventPlugin: SelectEventPlugin }); ReactDOM.injection.injectComponentClasses({ button: ReactDOMButton, form: ReactDOMForm, input: ReactDOMInput, option: ReactDOMOption, select: ReactDOMSelect, textarea: ReactDOMTextarea }); DOMProperty.injection.injectDOMPropertyConfig(DefaultDOMPropertyConfig); if (true) { ReactPerf.injection.injectMeasure(require("./ReactDefaultPerf").measure); } ReactUpdates.injection.injectBatchingStrategy( ReactDefaultBatchingStrategy ); } module.exports = { inject: inject }; },{"./ChangeEventPlugin":6,"./CompositionEventPlugin":7,"./DOMProperty":9,"./DefaultDOMPropertyConfig":12,"./DefaultEventPluginOrder":13,"./EnterLeaveEventPlugin":14,"./EventPluginHub":17,"./MobileSafariClickEventPlugin":24,"./ReactDOM":33,"./ReactDOMButton":34,"./ReactDOMForm":36,"./ReactDOMInput":38,"./ReactDOMOption":39,"./ReactDOMSelect":40,"./ReactDOMTextarea":42,"./ReactDefaultBatchingStrategy":43,"./ReactDefaultPerf":45,"./ReactEventEmitter":46,"./ReactEventTopLevelCallback":48,"./ReactInstanceHandles":50,"./ReactPerf":58,"./ReactUpdates":69,"./SelectEventPlugin":71,"./SimpleEventPlugin":72}],45:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactDefaultPerf * @typechecks static-only */ "use strict"; var performanceNow = require("./performanceNow"); var ReactDefaultPerf = {}; if (true) { ReactDefaultPerf = { /** * Gets the stored information for a given object's function. * * @param {string} objName * @param {string} fnName * @return {?object} */ getInfo: function(objName, fnName) { if (!this.info[objName] || !this.info[objName][fnName]) { return null; } return this.info[objName][fnName]; }, /** * Gets the logs pertaining to a given object's function. * * @param {string} objName * @param {string} fnName * @return {?array<object>} */ getLogs: function(objName, fnName) { if (!this.getInfo(objName, fnName)) { return null; } return this.logs.filter(function(log) { return log.objName === objName && log.fnName === fnName; }); }, /** * Runs through the logs and builds an array of arrays, where each array * walks through the mounting/updating of each component underneath. * * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]' * @return {array<array>} */ getRawRenderHistory: function(rootID) { var history = []; /** * Since logs are added after the method returns, the logs are in a sense * upside-down: the inner-most elements from mounting/updating are logged * first, and the last addition to the log is the top renderComponent. * Therefore, we flip the logs upside down for ease of processing, and * reverse the history array at the end so the earliest event has index 0. */ var logs = this.logs.filter(function(log) { return log.reactID.indexOf(rootID) === 0; }).reverse(); var subHistory = []; logs.forEach(function(log, i) { if (i && log.reactID === rootID && logs[i - 1].reactID !== rootID) { subHistory.length && history.push(subHistory); subHistory = []; } subHistory.push(log); }); if (subHistory.length) { history.push(subHistory); } return history.reverse(); }, /** * Runs through the logs and builds an array of strings, where each string * is a multiline formatted way of walking through the mounting/updating * underneath. * * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]' * @return {array<string>} */ getRenderHistory: function(rootID) { var history = this.getRawRenderHistory(rootID); return history.map(function(subHistory) { var headerString = ( 'log# Component (execution time) [bloat from logging]\n' + '================================================================\n' ); return headerString + subHistory.map(function(log) { // Add two spaces for every layer in the reactID. var indents = '\t' + Array(log.reactID.split('.[').length).join(' '); var delta = _microTime(log.timing.delta); var bloat = _microTime(log.timing.timeToLog); return log.index + indents + log.name + ' (' + delta + 'ms)' + ' [' + bloat + 'ms]'; }).join('\n'); }); }, /** * Print the render history from `getRenderHistory` using console.log. * This is currently the best way to display perf data from * any React component; working on that. * * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]' * @param {number} index */ printRenderHistory: function(rootID, index) { var history = this.getRenderHistory(rootID); if (!history[index]) { console.warn( 'Index', index, 'isn\'t available! ' + 'The render history is', history.length, 'long.' ); return; } console.log( 'Loading render history #' + (index + 1) + ' of ' + history.length + ':\n' + history[index] ); }, /** * Prints the heatmap legend to console, showing how the colors correspond * with render times. This relies on console.log styles. */ printHeatmapLegend: function() { if (!this.options.heatmap.enabled) { return; } var max = this.info.React && this.info.React.renderComponent && this.info.React.renderComponent.max; if (max) { var logStr = 'Heatmap: '; for (var ii = 0; ii <= 10 * max; ii += max) { logStr += '%c ' + (Math.round(ii) / 10) + 'ms '; } console.log( logStr, 'background-color: hsla(100, 100%, 50%, 0.6);', 'background-color: hsla( 90, 100%, 50%, 0.6);', 'background-color: hsla( 80, 100%, 50%, 0.6);', 'background-color: hsla( 70, 100%, 50%, 0.6);', 'background-color: hsla( 60, 100%, 50%, 0.6);', 'background-color: hsla( 50, 100%, 50%, 0.6);', 'background-color: hsla( 40, 100%, 50%, 0.6);', 'background-color: hsla( 30, 100%, 50%, 0.6);', 'background-color: hsla( 20, 100%, 50%, 0.6);', 'background-color: hsla( 10, 100%, 50%, 0.6);', 'background-color: hsla( 0, 100%, 50%, 0.6);' ); } }, /** * Measure a given function with logging information, and calls a callback * if there is one. * * @param {string} objName * @param {string} fnName * @param {function} func * @return {function} */ measure: function(objName, fnName, func) { var info = _getNewInfo(objName, fnName); var fnArgs = _getFnArguments(func); return function() { var timeBeforeFn = performanceNow(); var fnReturn = func.apply(this, arguments); var timeAfterFn = performanceNow(); /** * Hold onto arguments in a readable way: args[1] -> args.component. * args is also passed to the callback, so if you want to save an * argument in the log, do so in the callback. */ var args = {}; for (var i = 0; i < arguments.length; i++) { args[fnArgs[i]] = arguments[i]; } var log = { index: ReactDefaultPerf.logs.length, fnName: fnName, objName: objName, timing: { before: timeBeforeFn, after: timeAfterFn, delta: timeAfterFn - timeBeforeFn } }; ReactDefaultPerf.logs.push(log); /** * The callback gets: * - this (the component) * - the original method's arguments * - what the method returned * - the log object, and * - the wrapped method's info object. */ var callback = _getCallback(objName, fnName); callback && callback(this, args, fnReturn, log, info); log.timing.timeToLog = performanceNow() - timeAfterFn; return fnReturn; }; }, /** * Holds information on wrapped objects/methods. * For instance, ReactDefaultPerf.info.React.renderComponent */ info: {}, /** * Holds all of the logs. Filter this to pull desired information. */ logs: [], /** * Toggle settings for ReactDefaultPerf */ options: { /** * The heatmap sets the background color of the React containers * according to how much total time has been spent rendering them. * The most temporally expensive component is set as pure red, * and the others are colored from green to red as a fraction * of that max component time. */ heatmap: { enabled: true } } }; /** * Gets a info area for a given object's function, adding a new one if * necessary. * * @param {string} objName * @param {string} fnName * @return {object} */ var _getNewInfo = function(objName, fnName) { var info = ReactDefaultPerf.getInfo(objName, fnName); if (info) { return info; } ReactDefaultPerf.info[objName] = ReactDefaultPerf.info[objName] || {}; return ReactDefaultPerf.info[objName][fnName] = { getLogs: function() { return ReactDefaultPerf.getLogs(objName, fnName); } }; }; /** * Gets a list of the argument names from a function's definition. * This is useful for storing arguments by their names within wrapFn(). * * @param {function} fn * @return {array<string>} */ var _getFnArguments = function(fn) { var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; var fnStr = fn.toString().replace(STRIP_COMMENTS, ''); fnStr = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')); return fnStr.match(/([^\s,]+)/g); }; /** * Store common callbacks within ReactDefaultPerf. * * @param {string} objName * @param {string} fnName * @return {?function} */ var _getCallback = function(objName, fnName) { switch (objName + '.' + fnName) { case 'React.renderComponent': return _renderComponentCallback; case 'ReactDOMComponent.mountComponent': case 'ReactDOMComponent.updateComponent': return _nativeComponentCallback; case 'ReactCompositeComponent.mountComponent': case 'ReactCompositeComponent.updateComponent': return _compositeComponentCallback; default: return null; } }; /** * Callback function for React.renderComponent * * @param {object} component * @param {object} args * @param {?object} fnReturn * @param {object} log * @param {object} info */ var _renderComponentCallback = function(component, args, fnReturn, log, info) { log.name = args.nextComponent.constructor.displayName || '[unknown]'; log.reactID = fnReturn._rootNodeID || null; if (ReactDefaultPerf.options.heatmap.enabled) { var container = args.container; if (!container.loggedByReactDefaultPerf) { container.loggedByReactDefaultPerf = true; info.components = info.components || []; info.components.push(container); } container.count = container.count || 0; container.count += log.timing.delta; info.max = info.max || 0; if (container.count > info.max) { info.max = container.count; info.components.forEach(function(component) { _setHue(component, 100 - 100 * component.count / info.max); }); } else { _setHue(container, 100 - 100 * container.count / info.max); } } }; /** * Callback function for ReactDOMComponent * * @param {object} component * @param {object} args * @param {?object} fnReturn * @param {object} log * @param {object} info */ var _nativeComponentCallback = function(component, args, fnReturn, log, info) { log.name = component.tagName || '[unknown]'; log.reactID = component._rootNodeID; }; /** * Callback function for ReactCompositeComponent * * @param {object} component * @param {object} args * @param {?object} fnReturn * @param {object} log * @param {object} info */ var _compositeComponentCallback = function(component, args, fnReturn, log, info) { log.name = component.constructor.displayName || '[unknown]'; log.reactID = component._rootNodeID; }; /** * Using the hsl() background-color attribute, colors an element. * * @param {DOMElement} el * @param {number} hue [0 for red, 120 for green, 240 for blue] */ var _setHue = function(el, hue) { el.style.backgroundColor = 'hsla(' + hue + ', 100%, 50%, 0.6)'; }; /** * Round to the thousandth place. * @param {number} time * @return {number} */ var _microTime = function(time) { return Math.round(time * 1000) / 1000; }; } module.exports = ReactDefaultPerf; },{"./performanceNow":123}],46:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactEventEmitter * @typechecks static-only */ "use strict"; var EventConstants = require("./EventConstants"); var EventListener = require("./EventListener"); var EventPluginHub = require("./EventPluginHub"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var ReactEventEmitterMixin = require("./ReactEventEmitterMixin"); var ViewportMetrics = require("./ViewportMetrics"); var invariant = require("./invariant"); var isEventSupported = require("./isEventSupported"); var merge = require("./merge"); /** * Summary of `ReactEventEmitter` event handling: * * - Top-level delegation is used to trap native browser events. We normalize * and de-duplicate events to account for browser quirks. * * - Forward these native events (with the associated top-level type used to * trap it) to `EventPluginHub`, which in turn will ask plugins if they want * to extract any synthetic events. * * - The `EventPluginHub` will then process each event by annotating them with * "dispatches", a sequence of listeners and IDs that care about that event. * * - The `EventPluginHub` then dispatches the events. * * Overview of React and the event system: * * . * +------------+ . * | DOM | . * +------------+ . +-----------+ * + . +--------+|SimpleEvent| * | . | |Plugin | * +-----|------+ . v +-----------+ * | | | . +--------------+ +------------+ * | +-----------.--->|EventPluginHub| | Event | * | | . | | +-----------+ | Propagators| * | ReactEvent | . | | |TapEvent | |------------| * | Emitter | . | |<---+|Plugin | |other plugin| * | | . | | +-----------+ | utilities | * | +-----------.---------+ | +------------+ * | | | . +----|---------+ * +-----|------+ . | ^ +-----------+ * | . | | |Enter/Leave| * + . | +-------+|Plugin | * +-------------+ . v +-----------+ * | application | . +----------+ * |-------------| . | callback | * | | . | registry | * | | . +----------+ * +-------------+ . * . * React Core . General Purpose Event Plugin System */ /** * Traps top-level events by using event bubbling. * * @param {string} topLevelType Record from `EventConstants`. * @param {string} handlerBaseName Event name (e.g. "click"). * @param {DOMEventTarget} element Element on which to attach listener. * @internal */ function trapBubbledEvent(topLevelType, handlerBaseName, element) { EventListener.listen( element, handlerBaseName, ReactEventEmitter.TopLevelCallbackCreator.createTopLevelCallback( topLevelType ) ); } /** * Traps a top-level event by using event capturing. * * @param {string} topLevelType Record from `EventConstants`. * @param {string} handlerBaseName Event name (e.g. "click"). * @param {DOMEventTarget} element Element on which to attach listener. * @internal */ function trapCapturedEvent(topLevelType, handlerBaseName, element) { EventListener.capture( element, handlerBaseName, ReactEventEmitter.TopLevelCallbackCreator.createTopLevelCallback( topLevelType ) ); } /** * Listens to window scroll and resize events. We cache scroll values so that * application code can access them without triggering reflows. * * NOTE: Scroll events do not bubble. * * @private * @see http://www.quirksmode.org/dom/events/scroll.html */ function registerScrollValueMonitoring() { var refresh = ViewportMetrics.refreshScrollValues; EventListener.listen(window, 'scroll', refresh); EventListener.listen(window, 'resize', refresh); } /** * `ReactEventEmitter` is used to attach top-level event listeners. For example: * * ReactEventEmitter.putListener('myID', 'onClick', myFunction); * * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. * * @internal */ var ReactEventEmitter = merge(ReactEventEmitterMixin, { /** * React references `ReactEventTopLevelCallback` using this property in order * to allow dependency injection. */ TopLevelCallbackCreator: null, /** * Ensures that top-level event delegation listeners are installed. * * There are issues with listening to both touch events and mouse events on * the top-level, so we make the caller choose which one to listen to. (If * there's a touch top-level listeners, anchors don't receive clicks for some * reason, and only in some cases). * * @param {boolean} touchNotMouse Listen to touch events instead of mouse. * @param {DOMDocument} contentDocument DOM document to listen on */ ensureListening: function(touchNotMouse, contentDocument) { invariant( ExecutionEnvironment.canUseDOM, 'ensureListening(...): Cannot toggle event listening in a Worker ' + 'thread. This is likely a bug in the framework. Please report ' + 'immediately.' ); invariant( ReactEventEmitter.TopLevelCallbackCreator, 'ensureListening(...): Cannot be called without a top level callback ' + 'creator being injected.' ); // Call out to base implementation. ReactEventEmitterMixin.ensureListening.call( ReactEventEmitter, { touchNotMouse: touchNotMouse, contentDocument: contentDocument } ); }, /** * Sets whether or not any created callbacks should be enabled. * * @param {boolean} enabled True if callbacks should be enabled. */ setEnabled: function(enabled) { invariant( ExecutionEnvironment.canUseDOM, 'setEnabled(...): Cannot toggle event listening in a Worker thread. ' + 'This is likely a bug in the framework. Please report immediately.' ); if (ReactEventEmitter.TopLevelCallbackCreator) { ReactEventEmitter.TopLevelCallbackCreator.setEnabled(enabled); } }, /** * @return {boolean} True if callbacks are enabled. */ isEnabled: function() { return !!( ReactEventEmitter.TopLevelCallbackCreator && ReactEventEmitter.TopLevelCallbackCreator.isEnabled() ); }, /** * We listen for bubbled touch events on the document object. * * Firefox v8.01 (and possibly others) exhibited strange behavior when * mounting `onmousemove` events at some node that was not the document * element. The symptoms were that if your mouse is not moving over something * contained within that mount point (for example on the background) the * top-level listeners for `onmousemove` won't be called. However, if you * register the `mousemove` on the document object, then it will of course * catch all `mousemove`s. This along with iOS quirks, justifies restricting * top-level listeners to the document object only, at least for these * movement types of events and possibly all events. * * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html * * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but * they bubble to document. * * @param {boolean} touchNotMouse Listen to touch events instead of mouse. * @param {DOMDocument} contentDocument Document which owns the container * @private * @see http://www.quirksmode.org/dom/events/keys.html. */ listenAtTopLevel: function(touchNotMouse, contentDocument) { invariant( !contentDocument._isListening, 'listenAtTopLevel(...): Cannot setup top-level listener more than once.' ); var topLevelTypes = EventConstants.topLevelTypes; var mountAt = contentDocument; registerScrollValueMonitoring(); trapBubbledEvent(topLevelTypes.topMouseOver, 'mouseover', mountAt); trapBubbledEvent(topLevelTypes.topMouseDown, 'mousedown', mountAt); trapBubbledEvent(topLevelTypes.topMouseUp, 'mouseup', mountAt); trapBubbledEvent(topLevelTypes.topMouseMove, 'mousemove', mountAt); trapBubbledEvent(topLevelTypes.topMouseOut, 'mouseout', mountAt); trapBubbledEvent(topLevelTypes.topClick, 'click', mountAt); trapBubbledEvent(topLevelTypes.topDoubleClick, 'dblclick', mountAt); if (touchNotMouse) { trapBubbledEvent(topLevelTypes.topTouchStart, 'touchstart', mountAt); trapBubbledEvent(topLevelTypes.topTouchEnd, 'touchend', mountAt); trapBubbledEvent(topLevelTypes.topTouchMove, 'touchmove', mountAt); trapBubbledEvent(topLevelTypes.topTouchCancel, 'touchcancel', mountAt); } trapBubbledEvent(topLevelTypes.topKeyUp, 'keyup', mountAt); trapBubbledEvent(topLevelTypes.topKeyPress, 'keypress', mountAt); trapBubbledEvent(topLevelTypes.topKeyDown, 'keydown', mountAt); trapBubbledEvent(topLevelTypes.topInput, 'input', mountAt); trapBubbledEvent(topLevelTypes.topChange, 'change', mountAt); trapBubbledEvent( topLevelTypes.topSelectionChange, 'selectionchange', mountAt ); trapBubbledEvent( topLevelTypes.topCompositionEnd, 'compositionend', mountAt ); trapBubbledEvent( topLevelTypes.topCompositionStart, 'compositionstart', mountAt ); trapBubbledEvent( topLevelTypes.topCompositionUpdate, 'compositionupdate', mountAt ); if (isEventSupported('drag')) { trapBubbledEvent(topLevelTypes.topDrag, 'drag', mountAt); trapBubbledEvent(topLevelTypes.topDragEnd, 'dragend', mountAt); trapBubbledEvent(topLevelTypes.topDragEnter, 'dragenter', mountAt); trapBubbledEvent(topLevelTypes.topDragExit, 'dragexit', mountAt); trapBubbledEvent(topLevelTypes.topDragLeave, 'dragleave', mountAt); trapBubbledEvent(topLevelTypes.topDragOver, 'dragover', mountAt); trapBubbledEvent(topLevelTypes.topDragStart, 'dragstart', mountAt); trapBubbledEvent(topLevelTypes.topDrop, 'drop', mountAt); } if (isEventSupported('wheel')) { trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt); } else if (isEventSupported('mousewheel')) { trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt); } else { // Firefox needs to capture a different mouse scroll event. // @see http://www.quirksmode.org/dom/events/tests/scroll.html trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt); } // IE<9 does not support capturing so just trap the bubbled event there. if (isEventSupported('scroll', true)) { trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt); } else { trapBubbledEvent(topLevelTypes.topScroll, 'scroll', window); } if (isEventSupported('focus', true)) { trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt); trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt); } else if (isEventSupported('focusin')) { // IE has `focusin` and `focusout` events which bubble. // @see // http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt); trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt); } if (isEventSupported('copy')) { trapBubbledEvent(topLevelTypes.topCopy, 'copy', mountAt); trapBubbledEvent(topLevelTypes.topCut, 'cut', mountAt); trapBubbledEvent(topLevelTypes.topPaste, 'paste', mountAt); } }, registrationNames: EventPluginHub.registrationNames, putListener: EventPluginHub.putListener, getListener: EventPluginHub.getListener, deleteListener: EventPluginHub.deleteListener, deleteAllListeners: EventPluginHub.deleteAllListeners, trapBubbledEvent: trapBubbledEvent, trapCapturedEvent: trapCapturedEvent }); module.exports = ReactEventEmitter; },{"./EventConstants":15,"./EventListener":16,"./EventPluginHub":17,"./ExecutionEnvironment":21,"./ReactEventEmitterMixin":47,"./ViewportMetrics":83,"./invariant":106,"./isEventSupported":107,"./merge":115}],47:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactEventEmitterMixin */ "use strict"; var EventPluginHub = require("./EventPluginHub"); var ReactUpdates = require("./ReactUpdates"); function runEventQueueInBatch(events) { EventPluginHub.enqueueEvents(events); EventPluginHub.processEventQueue(); } var ReactEventEmitterMixin = { /** * Whether or not `ensureListening` has been invoked. * @type {boolean} * @private */ _isListening: false, /** * Function, must be implemented. Listens to events on the top level of the * application. * * @abstract * * listenAtTopLevel: null, */ /** * Ensures that top-level event delegation listeners are installed. * * There are issues with listening to both touch events and mouse events on * the top-level, so we make the caller choose which one to listen to. (If * there's a touch top-level listeners, anchors don't receive clicks for some * reason, and only in some cases). * * @param {*} config Configuration passed through to `listenAtTopLevel`. */ ensureListening: function(config) { if (!config.contentDocument._reactIsListening) { this.listenAtTopLevel(config.touchNotMouse, config.contentDocument); config.contentDocument._reactIsListening = true; } }, /** * Streams a fired top-level event to `EventPluginHub` where plugins have the * opportunity to create `ReactEvent`s to be dispatched. * * @param {string} topLevelType Record from `EventConstants`. * @param {object} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native environment event. */ handleTopLevel: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var events = EventPluginHub.extractEvents( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent ); // Event queue being processed in the same cycle allows `preventDefault`. ReactUpdates.batchedUpdates(runEventQueueInBatch, events); } }; module.exports = ReactEventEmitterMixin; },{"./EventPluginHub":17,"./ReactUpdates":69}],48:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactEventTopLevelCallback * @typechecks static-only */ "use strict"; var ReactEventEmitter = require("./ReactEventEmitter"); var ReactMount = require("./ReactMount"); var getEventTarget = require("./getEventTarget"); /** * @type {boolean} * @private */ var _topLevelListenersEnabled = true; /** * Top-level callback creator used to implement event handling using delegation. * This is used via dependency injection. */ var ReactEventTopLevelCallback = { /** * Sets whether or not any created callbacks should be enabled. * * @param {boolean} enabled True if callbacks should be enabled. */ setEnabled: function(enabled) { _topLevelListenersEnabled = !!enabled; }, /** * @return {boolean} True if callbacks are enabled. */ isEnabled: function() { return _topLevelListenersEnabled; }, /** * Creates a callback for the supplied `topLevelType` that could be added as * a listener to the document. The callback computes a `topLevelTarget` which * should be the root node of a mounted React component where the listener * is attached. * * @param {string} topLevelType Record from `EventConstants`. * @return {function} Callback for handling top-level events. */ createTopLevelCallback: function(topLevelType) { return function(nativeEvent) { if (!_topLevelListenersEnabled) { return; } // TODO: Remove when synthetic events are ready, this is for IE<9. if (nativeEvent.srcElement && nativeEvent.srcElement !== nativeEvent.target) { nativeEvent.target = nativeEvent.srcElement; } var topLevelTarget = ReactMount.getFirstReactDOM( getEventTarget(nativeEvent) ) || window; var topLevelTargetID = ReactMount.getID(topLevelTarget) || ''; ReactEventEmitter.handleTopLevel( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent ); }; } }; module.exports = ReactEventTopLevelCallback; },{"./ReactEventEmitter":46,"./ReactMount":53,"./getEventTarget":100}],49:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactInputSelection */ "use strict"; var ReactDOMSelection = require("./ReactDOMSelection"); var getActiveElement = require("./getActiveElement"); var nodeContains = require("./nodeContains"); function isInDocument(node) { return nodeContains(document.documentElement, node); } /** * @ReactInputSelection: React input selection module. Based on Selection.js, * but modified to be suitable for react and has a couple of bug fixes (doesn't * assume buttons have range selections allowed). * Input selection module for React. */ var ReactInputSelection = { hasSelectionCapabilities: function(elem) { return elem && ( (elem.nodeName === 'INPUT' && elem.type === 'text') || elem.nodeName === 'TEXTAREA' || elem.contentEditable === 'true' ); }, getSelectionInformation: function() { var focusedElem = getActiveElement(); return { focusedElem: focusedElem, selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null }; }, /** * @restoreSelection: If any selection information was potentially lost, * restore it. This is useful when performing operations that could remove dom * nodes and place them back in, resulting in focus being lost. */ restoreSelection: function(priorSelectionInformation) { var curFocusedElem = getActiveElement(); var priorFocusedElem = priorSelectionInformation.focusedElem; var priorSelectionRange = priorSelectionInformation.selectionRange; if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { ReactInputSelection.setSelection( priorFocusedElem, priorSelectionRange ); } priorFocusedElem.focus(); } }, /** * @getSelection: Gets the selection bounds of a focused textarea, input or * contentEditable node. * -@input: Look up selection bounds of this input * -@return {start: selectionStart, end: selectionEnd} */ getSelection: function(input) { var selection; if ('selectionStart' in input) { // Modern browser with input or textarea. selection = { start: input.selectionStart, end: input.selectionEnd }; } else if (document.selection && input.nodeName === 'INPUT') { // IE8 input. var range = document.selection.createRange(); // There can only be one selection per document in IE, so it must // be in our element. if (range.parentElement() === input) { selection = { start: -range.moveStart('character', -input.value.length), end: -range.moveEnd('character', -input.value.length) }; } } else { // Content editable or old IE textarea. selection = ReactDOMSelection.getOffsets(input); } return selection || {start: 0, end: 0}; }, /** * @setSelection: Sets the selection bounds of a textarea or input and focuses * the input. * -@input Set selection bounds of this input or textarea * -@offsets Object of same form that is returned from get* */ setSelection: function(input, offsets) { var start = offsets.start; var end = offsets.end; if (typeof end === 'undefined') { end = start; } if ('selectionStart' in input) { input.selectionStart = start; input.selectionEnd = Math.min(end, input.value.length); } else if (document.selection && input.nodeName === 'INPUT') { var range = input.createTextRange(); range.collapse(true); range.moveStart('character', start); range.moveEnd('character', end - start); range.select(); } else { ReactDOMSelection.setOffsets(input, offsets); } } }; module.exports = ReactInputSelection; },{"./ReactDOMSelection":41,"./getActiveElement":99,"./nodeContains":120}],50:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactInstanceHandles * @typechecks static-only */ "use strict"; var invariant = require("./invariant"); var SEPARATOR = '.'; var SEPARATOR_LENGTH = SEPARATOR.length; /** * Maximum depth of traversals before we consider the possibility of a bad ID. */ var MAX_TREE_DEPTH = 100; /** * Size of the reactRoot ID space. We generate random numbers for React root * IDs and if there's a collision the events and DOM update system will * get confused. If we assume 100 React components per page, and a user * loads 1 page per minute 24/7 for 50 years, with a mount point space of * 9,999,999 the likelihood of never having a collision is 99.997%. */ var GLOBAL_MOUNT_POINT_MAX = 9999999; /** * Creates a DOM ID prefix to use when mounting React components. * * @param {number} index A unique integer * @return {string} React root ID. * @internal */ function getReactRootIDString(index) { return SEPARATOR + 'r[' + index.toString(36) + ']'; } /** * Checks if a character in the supplied ID is a separator or the end. * * @param {string} id A React DOM ID. * @param {number} index Index of the character to check. * @return {boolean} True if the character is a separator or end of the ID. * @private */ function isBoundary(id, index) { return id.charAt(index) === SEPARATOR || index === id.length; } /** * Checks if the supplied string is a valid React DOM ID. * * @param {string} id A React DOM ID, maybe. * @return {boolean} True if the string is a valid React DOM ID. * @private */ function isValidID(id) { return id === '' || ( id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR ); } /** * Checks if the first ID is an ancestor of or equal to the second ID. * * @param {string} ancestorID * @param {string} descendantID * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`. * @internal */ function isAncestorIDOf(ancestorID, descendantID) { return ( descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length) ); } /** * Gets the parent ID of the supplied React DOM ID, `id`. * * @param {string} id ID of a component. * @return {string} ID of the parent, or an empty string. * @private */ function getParentID(id) { return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : ''; } /** * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the * supplied `destinationID`. If they are equal, the ID is returned. * * @param {string} ancestorID ID of an ancestor node of `destinationID`. * @param {string} destinationID ID of the destination node. * @return {string} Next ID on the path from `ancestorID` to `destinationID`. * @private */ function getNextDescendantID(ancestorID, destinationID) { invariant( isValidID(ancestorID) && isValidID(destinationID), 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID ); invariant( isAncestorIDOf(ancestorID, destinationID), 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID ); if (ancestorID === destinationID) { return ancestorID; } // Skip over the ancestor and the immediate separator. Traverse until we hit // another separator or we reach the end of `destinationID`. var start = ancestorID.length + SEPARATOR_LENGTH; for (var i = start; i < destinationID.length; i++) { if (isBoundary(destinationID, i)) { break; } } return destinationID.substr(0, i); } /** * Gets the nearest common ancestor ID of two IDs. * * Using this ID scheme, the nearest common ancestor ID is the longest common * prefix of the two IDs that immediately preceded a "marker" in both strings. * * @param {string} oneID * @param {string} twoID * @return {string} Nearest common ancestor ID, or the empty string if none. * @private */ function getFirstCommonAncestorID(oneID, twoID) { var minLength = Math.min(oneID.length, twoID.length); if (minLength === 0) { return ''; } var lastCommonMarkerIndex = 0; // Use `<=` to traverse until the "EOL" of the shorter string. for (var i = 0; i <= minLength; i++) { if (isBoundary(oneID, i) && isBoundary(twoID, i)) { lastCommonMarkerIndex = i; } else if (oneID.charAt(i) !== twoID.charAt(i)) { break; } } var longestCommonID = oneID.substr(0, lastCommonMarkerIndex); invariant( isValidID(longestCommonID), 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID ); return longestCommonID; } /** * Traverses the parent path between two IDs (either up or down). The IDs must * not be the same, and there must exist a parent path between them. * * @param {?string} start ID at which to start traversal. * @param {?string} stop ID at which to end traversal. * @param {function} cb Callback to invoke each ID with. * @param {?boolean} skipFirst Whether or not to skip the first node. * @param {?boolean} skipLast Whether or not to skip the last node. * @private */ function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) { start = start || ''; stop = stop || ''; invariant( start !== stop, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start ); var traverseUp = isAncestorIDOf(stop, start); invariant( traverseUp || isAncestorIDOf(start, stop), 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop ); // Traverse from `start` to `stop` one depth at a time. var depth = 0; var traverse = traverseUp ? getParentID : getNextDescendantID; for (var id = start; /* until break */; id = traverse(id, stop)) { if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) { cb(id, traverseUp, arg); } if (id === stop) { // Only break //after// visiting `stop`. break; } invariant( depth++ < MAX_TREE_DEPTH, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop ); } } /** * Manages the IDs assigned to DOM representations of React components. This * uses a specific scheme in order to traverse the DOM efficiently (e.g. in * order to simulate events). * * @internal */ var ReactInstanceHandles = { createReactRootID: function() { return getReactRootIDString( Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX) ); }, /** * Constructs a React ID by joining a root ID with a name. * * @param {string} rootID Root ID of a parent component. * @param {string} name A component's name (as flattened children). * @return {string} A React ID. * @internal */ createReactID: function(rootID, name) { return rootID + SEPARATOR + name; }, /** * Gets the DOM ID of the React component that is the root of the tree that * contains the React component with the supplied DOM ID. * * @param {string} id DOM ID of a React component. * @return {?string} DOM ID of the React component that is the root. * @internal */ getReactRootIDFromNodeID: function(id) { var regexResult = /\.r\[[^\]]+\]/.exec(id); return regexResult && regexResult[0]; }, /** * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that * should would receive a `mouseEnter` or `mouseLeave` event. * * NOTE: Does not invoke the callback on the nearest common ancestor because * nothing "entered" or "left" that element. * * @param {string} leaveID ID being left. * @param {string} enterID ID being entered. * @param {function} cb Callback to invoke on each entered/left ID. * @param {*} upArg Argument to invoke the callback with on left IDs. * @param {*} downArg Argument to invoke the callback with on entered IDs. * @internal */ traverseEnterLeave: function(leaveID, enterID, cb, upArg, downArg) { var ancestorID = getFirstCommonAncestorID(leaveID, enterID); if (ancestorID !== leaveID) { traverseParentPath(leaveID, ancestorID, cb, upArg, false, true); } if (ancestorID !== enterID) { traverseParentPath(ancestorID, enterID, cb, downArg, true, false); } }, /** * Simulates the traversal of a two-phase, capture/bubble event dispatch. * * NOTE: This traversal happens on IDs without touching the DOM. * * @param {string} targetID ID of the target node. * @param {function} cb Callback to invoke. * @param {*} arg Argument to invoke the callback with. * @internal */ traverseTwoPhase: function(targetID, cb, arg) { if (targetID) { traverseParentPath('', targetID, cb, arg, true, false); traverseParentPath(targetID, '', cb, arg, false, true); } }, /** * Exposed for unit testing. * @private */ _getFirstCommonAncestorID: getFirstCommonAncestorID, /** * Exposed for unit testing. * @private */ _getNextDescendantID: getNextDescendantID, isAncestorIDOf: isAncestorIDOf, SEPARATOR: SEPARATOR }; module.exports = ReactInstanceHandles; },{"./invariant":106}],51:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactLink * @typechecks static-only */ "use strict"; /** * ReactLink encapsulates a common pattern in which a component wants to modify * a prop received from its parent. ReactLink allows the parent to pass down a * value coupled with a callback that, when invoked, expresses an intent to * modify that value. For example: * * React.createClass({ * getInitialState: function() { * return {value: ''}; * }, * render: function() { * var valueLink = new ReactLink(this.state.value, this._handleValueChange); * return <input valueLink={valueLink} />; * }, * this._handleValueChange: function(newValue) { * this.setState({value: newValue}); * } * }); * * We have provided some sugary mixins to make the creation and * consumption of ReactLink easier; see LinkedValueMixin and LinkedStateMixin. */ /** * @param {*} value current value of the link * @param {function} requestChange callback to request a change */ function ReactLink(value, requestChange) { this.value = value; this.requestChange = requestChange; } module.exports = ReactLink; },{}],52:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactMarkupChecksum */ "use strict"; var adler32 = require("./adler32"); var ReactMarkupChecksum = { CHECKSUM_ATTR_NAME: 'data-react-checksum', /** * @param {string} markup Markup string * @return {string} Markup string with checksum attribute attached */ addChecksumToMarkup: function(markup) { var checksum = adler32(markup); return markup.replace( '>', ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">' ); }, /** * @param {string} markup to use * @param {DOMElement} element root React element * @returns {boolean} whether or not the markup is the same */ canReuseMarkup: function(markup, element) { var existingChecksum = element.getAttribute( ReactMarkupChecksum.CHECKSUM_ATTR_NAME ); existingChecksum = existingChecksum && parseInt(existingChecksum, 10); var markupChecksum = adler32(markup); return markupChecksum === existingChecksum; } }; module.exports = ReactMarkupChecksum; },{"./adler32":85}],53:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactMount */ "use strict"; var ReactEventEmitter = require("./ReactEventEmitter"); var ReactInstanceHandles = require("./ReactInstanceHandles"); var $ = require("./$"); var getReactRootElementInContainer = require("./getReactRootElementInContainer"); var invariant = require("./invariant"); var nodeContains = require("./nodeContains"); var SEPARATOR = ReactInstanceHandles.SEPARATOR; var ATTR_NAME = 'data-reactid'; var nodeCache = {}; var ELEMENT_NODE_TYPE = 1; var DOC_NODE_TYPE = 9; /** Mapping from reactRootID to React component instance. */ var instancesByReactRootID = {}; /** Mapping from reactRootID to `container` nodes. */ var containersByReactRootID = {}; if (true) { /** __DEV__-only mapping from reactRootID to root elements. */ var rootElementsByReactRootID = {}; } /** * @param {DOMElement} container DOM element that may contain a React component. * @return {?string} A "reactRoot" ID, if a React component is rendered. */ function getReactRootID(container) { var rootElement = getReactRootElementInContainer(container); return rootElement && ReactMount.getID(rootElement); } /** * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form * element can return its control whose name or ID equals ATTR_NAME. All * DOM nodes support `getAttributeNode` but this can also get called on * other objects so just return '' if we're given something other than a * DOM node (such as window). * * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node. * @return {string} ID of the supplied `domNode`. */ function getID(node) { var id = internalGetID(node); if (id) { if (nodeCache.hasOwnProperty(id)) { var cached = nodeCache[id]; if (cached !== node) { invariant( !isValid(cached, id), 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id ); nodeCache[id] = node; } } else { nodeCache[id] = node; } } return id; } function internalGetID(node) { // If node is something like a window, document, or text node, none of // which support attributes or a .getAttribute method, gracefully return // the empty string, as if the attribute were missing. return node && node.getAttribute && node.getAttribute(ATTR_NAME) || ''; } /** * Sets the React-specific ID of the given node. * * @param {DOMElement} node The DOM node whose ID will be set. * @param {string} id The value of the ID attribute. */ function setID(node, id) { var oldID = internalGetID(node); if (oldID !== id) { delete nodeCache[oldID]; } node.setAttribute(ATTR_NAME, id); nodeCache[id] = node; } /** * Finds the node with the supplied React-generated DOM ID. * * @param {string} id A React-generated DOM ID. * @return {DOMElement} DOM node with the suppled `id`. * @internal */ function getNode(id) { if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { nodeCache[id] = ReactMount.findReactNodeByID(id); } return nodeCache[id]; } /** * A node is "valid" if it is contained by a currently mounted container. * * This means that the node does not have to be contained by a document in * order to be considered valid. * * @param {?DOMElement} node The candidate DOM node. * @param {string} id The expected ID of the node. * @return {boolean} Whether the node is contained by a mounted container. */ function isValid(node, id) { if (node) { invariant( internalGetID(node) === id, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME ); var container = ReactMount.findReactContainerForID(id); if (container && nodeContains(container, node)) { return true; } } return false; } /** * Causes the cache to forget about one React-specific ID. * * @param {string} id The ID to forget. */ function purgeID(id) { delete nodeCache[id]; } /** * Mounting is the process of initializing a React component by creatings its * representative DOM elements and inserting them into a supplied `container`. * Any prior content inside `container` is destroyed in the process. * * ReactMount.renderComponent(component, $('container')); * * <div id="container"> <-- Supplied `container`. * <div data-reactid=".r[3]"> <-- Rendered reactRoot of React * // ... component. * </div> * </div> * * Inside of `container`, the first element rendered is the "reactRoot". */ var ReactMount = { /** * Safety guard to prevent accidentally rendering over the entire HTML tree. */ allowFullPageRender: false, /** Time spent generating markup. */ totalInstantiationTime: 0, /** Time spent inserting markup into the DOM. */ totalInjectionTime: 0, /** Whether support for touch events should be initialized. */ useTouchEvents: false, /** Exposed for debugging purposes **/ _instancesByReactRootID: instancesByReactRootID, /** * This is a hook provided to support rendering React components while * ensuring that the apparent scroll position of its `container` does not * change. * * @param {DOMElement} container The `container` being rendered into. * @param {function} renderCallback This must be called once to do the render. */ scrollMonitor: function(container, renderCallback) { renderCallback(); }, /** * Ensures that the top-level event delegation listener is set up. This will * be invoked some time before the first time any React component is rendered. * @param {DOMElement} container container we're rendering into * * @private */ prepareEnvironmentForDOM: function(container) { invariant( container && ( container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE ), 'prepareEnvironmentForDOM(...): Target container is not a DOM element.' ); var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container; ReactEventEmitter.ensureListening(ReactMount.useTouchEvents, doc); }, /** * Take a component that's already mounted into the DOM and replace its props * @param {ReactComponent} prevComponent component instance already in the DOM * @param {ReactComponent} nextComponent component instance to render * @param {DOMElement} container container to render into * @param {?function} callback function triggered on completion */ _updateRootComponent: function( prevComponent, nextComponent, container, callback) { var nextProps = nextComponent.props; ReactMount.scrollMonitor(container, function() { prevComponent.replaceProps(nextProps, callback); }); if (true) { // Record the root element in case it later gets transplanted. rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container); } return prevComponent; }, /** * Register a component into the instance map and start the events system. * @param {ReactComponent} nextComponent component instance to render * @param {DOMElement} container container to render into * @return {string} reactRoot ID prefix */ _registerComponent: function(nextComponent, container) { ReactMount.prepareEnvironmentForDOM(container); var reactRootID = ReactMount.registerContainer(container); instancesByReactRootID[reactRootID] = nextComponent; return reactRootID; }, /** * Render a new component into the DOM. * @param {ReactComponent} nextComponent component instance to render * @param {DOMElement} container container to render into * @param {boolean} shouldReuseMarkup if we should skip the markup insertion * @return {ReactComponent} nextComponent */ _renderNewRootComponent: function( nextComponent, container, shouldReuseMarkup) { var reactRootID = ReactMount._registerComponent(nextComponent, container); nextComponent.mountComponentIntoNode( reactRootID, container, shouldReuseMarkup ); if (true) { // Record the root element in case it later gets transplanted. rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container); } return nextComponent; }, /** * Renders a React component into the DOM in the supplied `container`. * * If the React component was previously rendered into `container`, this will * perform an update on it and only mutate the DOM as necessary to reflect the * latest React component. * * @param {ReactComponent} nextComponent Component instance to render. * @param {DOMElement} container DOM element to render into. * @param {?function} callback function triggered on completion * @return {ReactComponent} Component instance rendered in `container`. */ renderComponent: function(nextComponent, container, callback) { var registeredComponent = instancesByReactRootID[getReactRootID(container)]; if (registeredComponent) { if (registeredComponent.constructor === nextComponent.constructor) { return ReactMount._updateRootComponent( registeredComponent, nextComponent, container, callback ); } else { ReactMount.unmountComponentAtNode(container); } } var reactRootElement = getReactRootElementInContainer(container); var containerHasReactMarkup = reactRootElement && ReactMount.isRenderedByReact(reactRootElement); var shouldReuseMarkup = containerHasReactMarkup && !registeredComponent; var component = ReactMount._renderNewRootComponent( nextComponent, container, shouldReuseMarkup ); callback && callback(); return component; }, /** * Constructs a component instance of `constructor` with `initialProps` and * renders it into the supplied `container`. * * @param {function} constructor React component constructor. * @param {?object} props Initial props of the component instance. * @param {DOMElement} container DOM element to render into. * @return {ReactComponent} Component instance rendered in `container`. */ constructAndRenderComponent: function(constructor, props, container) { return ReactMount.renderComponent(constructor(props), container); }, /** * Constructs a component instance of `constructor` with `initialProps` and * renders it into a container node identified by supplied `id`. * * @param {function} componentConstructor React component constructor * @param {?object} props Initial props of the component instance. * @param {string} id ID of the DOM element to render into. * @return {ReactComponent} Component instance rendered in the container node. */ constructAndRenderComponentByID: function(constructor, props, id) { return ReactMount.constructAndRenderComponent(constructor, props, $(id)); }, /** * Registers a container node into which React components will be rendered. * This also creates the "reatRoot" ID that will be assigned to the element * rendered within. * * @param {DOMElement} container DOM element to register as a container. * @return {string} The "reactRoot" ID of elements rendered within. */ registerContainer: function(container) { var reactRootID = getReactRootID(container); if (reactRootID) { // If one exists, make sure it is a valid "reactRoot" ID. reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID); } if (!reactRootID) { // No valid "reactRoot" ID found, create one. reactRootID = ReactInstanceHandles.createReactRootID(); } containersByReactRootID[reactRootID] = container; return reactRootID; }, /** * Unmounts and destroys the React component rendered in the `container`. * * @param {DOMElement} container DOM element containing a React component. * @return {boolean} True if a component was found in and unmounted from * `container` */ unmountComponentAtNode: function(container) { var reactRootID = getReactRootID(container); var component = instancesByReactRootID[reactRootID]; if (!component) { return false; } ReactMount.unmountComponentFromNode(component, container); delete instancesByReactRootID[reactRootID]; delete containersByReactRootID[reactRootID]; if (true) { delete rootElementsByReactRootID[reactRootID]; } return true; }, /** * @deprecated */ unmountAndReleaseReactRootNode: function() { if (true) { console.warn( 'unmountAndReleaseReactRootNode() has been renamed to ' + 'unmountComponentAtNode() and will be removed in the next ' + 'version of React.' ); } return ReactMount.unmountComponentAtNode.apply(this, arguments); }, /** * Unmounts a component and removes it from the DOM. * * @param {ReactComponent} instance React component instance. * @param {DOMElement} container DOM element to unmount from. * @final * @internal * @see {ReactMount.unmountComponentAtNode} */ unmountComponentFromNode: function(instance, container) { instance.unmountComponent(); if (container.nodeType === DOC_NODE_TYPE) { container = container.documentElement; } // http://jsperf.com/emptying-a-node while (container.lastChild) { container.removeChild(container.lastChild); } }, /** * Finds the container DOM element that contains React component to which the * supplied DOM `id` belongs. * * @param {string} id The ID of an element rendered by a React component. * @return {?DOMElement} DOM element that contains the `id`. */ findReactContainerForID: function(id) { var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id); var container = containersByReactRootID[reactRootID]; if (true) { var rootElement = rootElementsByReactRootID[reactRootID]; if (rootElement && rootElement.parentNode !== container) { invariant( // Call internalGetID here because getID calls isValid which calls // findReactContainerForID (this function). internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.' ); var containerChild = container.firstChild; if (containerChild && reactRootID === internalGetID(containerChild)) { // If the container has a new child with the same ID as the old // root element, then rootElementsByReactRootID[reactRootID] is // just stale and needs to be updated. The case that deserves a // warning is when the container is empty. rootElementsByReactRootID[reactRootID] = containerChild; } else { console.warn( 'ReactMount: Root element has been removed from its original ' + 'container. New container:', rootElement.parentNode ); } } } return container; }, /** * Finds an element rendered by React with the supplied ID. * * @param {string} id ID of a DOM node in the React component. * @return {DOMElement} Root DOM node of the React component. */ findReactNodeByID: function(id) { var reactRoot = ReactMount.findReactContainerForID(id); return ReactMount.findComponentRoot(reactRoot, id); }, /** * True if the supplied `node` is rendered by React. * * @param {*} node DOM Element to check. * @return {boolean} True if the DOM Element appears to be rendered by React. * @internal */ isRenderedByReact: function(node) { if (node.nodeType !== 1) { // Not a DOMElement, therefore not a React component return false; } var id = ReactMount.getID(node); return id ? id.charAt(0) === SEPARATOR : false; }, /** * Traverses up the ancestors of the supplied node to find a node that is a * DOM representation of a React component. * * @param {*} node * @return {?DOMEventTarget} * @internal */ getFirstReactDOM: function(node) { var current = node; while (current && current.parentNode !== current) { if (ReactMount.isRenderedByReact(current)) { return current; } current = current.parentNode; } return null; }, /** * Finds a node with the supplied `id` inside of the supplied `ancestorNode`. * Exploits the ID naming scheme to perform the search quickly. * * @param {DOMEventTarget} ancestorNode Search from this root. * @pararm {string} id ID of the DOM representation of the component. * @return {DOMEventTarget} DOM node with the supplied `id`. * @internal */ findComponentRoot: function(ancestorNode, id) { var firstChildren = [ancestorNode.firstChild]; var childIndex = 0; while (childIndex < firstChildren.length) { var child = firstChildren[childIndex++]; while (child) { var childID = ReactMount.getID(child); if (childID) { if (id === childID) { return child; } else if (ReactInstanceHandles.isAncestorIDOf(childID, id)) { // If we find a child whose ID is an ancestor of the given ID, // then we can be sure that we only want to search the subtree // rooted at this child, so we can throw out the rest of the // search state. firstChildren.length = childIndex = 0; firstChildren.push(child.firstChild); break; } else { // TODO This should not be necessary if the ID hierarchy is // correct, but is occasionally necessary if the DOM has been // modified in unexpected ways. firstChildren.push(child.firstChild); } } else { // If this child had no ID, then there's a chance that it was // injected automatically by the browser, as when a `<table>` // element sprouts an extra `<tbody>` child as a side effect of // `.innerHTML` parsing. Optimistically continue down this // branch, but not before examining the other siblings. firstChildren.push(child.firstChild); } child = child.nextSibling; } } if (true) { console.error( 'Error while invoking `findComponentRoot` with the following ' + 'ancestor node:', ancestorNode ); } invariant( false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g. by the browser).', id, ReactMount.getID(ancestorNode) ); }, /** * React ID utilities. */ ATTR_NAME: ATTR_NAME, getReactRootID: getReactRootID, getID: getID, setID: setID, getNode: getNode, purgeID: purgeID, injection: {} }; module.exports = ReactMount; },{"./$":1,"./ReactEventEmitter":46,"./ReactInstanceHandles":50,"./getReactRootElementInContainer":103,"./invariant":106,"./nodeContains":120}],54:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactMountReady */ "use strict"; var PooledClass = require("./PooledClass"); var mixInto = require("./mixInto"); /** * A specialized pseudo-event module to help keep track of components waiting to * be notified when their DOM representations are available for use. * * This implements `PooledClass`, so you should never need to instantiate this. * Instead, use `ReactMountReady.getPooled()`. * * @param {?array<function>} initialCollection * @class ReactMountReady * @implements PooledClass * @internal */ function ReactMountReady(initialCollection) { this._queue = initialCollection || null; } mixInto(ReactMountReady, { /** * Enqueues a callback to be invoked when `notifyAll` is invoked. This is used * to enqueue calls to `componentDidMount` and `componentDidUpdate`. * * @param {ReactComponent} component Component being rendered. * @param {function(DOMElement)} callback Invoked when `notifyAll` is invoked. * @internal */ enqueue: function(component, callback) { this._queue = this._queue || []; this._queue.push({component: component, callback: callback}); }, /** * Invokes all enqueued callbacks and clears the queue. This is invoked after * the DOM representation of a component has been created or updated. * * @internal */ notifyAll: function() { var queue = this._queue; if (queue) { this._queue = null; for (var i = 0, l = queue.length; i < l; i++) { var component = queue[i].component; var callback = queue[i].callback; callback.call(component, component.getDOMNode()); } queue.length = 0; } }, /** * Resets the internal queue. * * @internal */ reset: function() { this._queue = null; }, /** * `PooledClass` looks for this. */ destructor: function() { this.reset(); } }); PooledClass.addPoolingTo(ReactMountReady); module.exports = ReactMountReady; },{"./PooledClass":25,"./mixInto":118}],55:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactMultiChild * @typechecks static-only */ "use strict"; var ReactComponent = require("./ReactComponent"); var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes"); var flattenChildren = require("./flattenChildren"); /** * Given a `curChild` and `newChild`, determines if `curChild` should be * updated as opposed to being destroyed or replaced. * * @param {?ReactComponent} curChild * @param {?ReactComponent} newChild * @return {boolean} True if `curChild` should be updated with `newChild`. * @protected */ function shouldUpdateChild(curChild, newChild) { return curChild && newChild && curChild.constructor === newChild.constructor; } /** * Updating children of a component may trigger recursive updates. The depth is * used to batch recursive updates to render markup more efficiently. * * @type {number} * @private */ var updateDepth = 0; /** * Queue of update configuration objects. * * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`. * * @type {array<object>} * @private */ var updateQueue = []; /** * Queue of markup to be rendered. * * @type {array<string>} * @private */ var markupQueue = []; /** * Enqueues markup to be rendered and inserted at a supplied index. * * @param {string} parentID ID of the parent component. * @param {string} markup Markup that renders into an element. * @param {number} toIndex Destination index. * @private */ function enqueueMarkup(parentID, markup, toIndex) { // NOTE: Null values reduce hidden classes. updateQueue.push({ parentID: parentID, parentNode: null, type: ReactMultiChildUpdateTypes.INSERT_MARKUP, markupIndex: markupQueue.push(markup) - 1, fromIndex: null, textContent: null, toIndex: toIndex }); } /** * Enqueues moving an existing element to another index. * * @param {string} parentID ID of the parent component. * @param {number} fromIndex Source index of the existing element. * @param {number} toIndex Destination index of the element. * @private */ function enqueueMove(parentID, fromIndex, toIndex) { // NOTE: Null values reduce hidden classes. updateQueue.push({ parentID: parentID, parentNode: null, type: ReactMultiChildUpdateTypes.MOVE_EXISTING, markupIndex: null, textContent: null, fromIndex: fromIndex, toIndex: toIndex }); } /** * Enqueues removing an element at an index. * * @param {string} parentID ID of the parent component. * @param {number} fromIndex Index of the element to remove. * @private */ function enqueueRemove(parentID, fromIndex) { // NOTE: Null values reduce hidden classes. updateQueue.push({ parentID: parentID, parentNode: null, type: ReactMultiChildUpdateTypes.REMOVE_NODE, markupIndex: null, textContent: null, fromIndex: fromIndex, toIndex: null }); } /** * Enqueues setting the text content. * * @param {string} parentID ID of the parent component. * @param {string} textContent Text content to set. * @private */ function enqueueTextContent(parentID, textContent) { // NOTE: Null values reduce hidden classes. updateQueue.push({ parentID: parentID, parentNode: null, type: ReactMultiChildUpdateTypes.TEXT_CONTENT, markupIndex: null, textContent: textContent, fromIndex: null, toIndex: null }); } /** * Processes any enqueued updates. * * @private */ function processQueue() { if (updateQueue.length) { ReactComponent.DOMIDOperations.dangerouslyProcessChildrenUpdates( updateQueue, markupQueue ); clearQueue(); } } /** * Clears any enqueued updates. * * @private */ function clearQueue() { updateQueue.length = 0; markupQueue.length = 0; } /** * ReactMultiChild are capable of reconciling multiple children. * * @class ReactMultiChild * @internal */ var ReactMultiChild = { /** * Provides common functionality for components that must reconcile multiple * children. This is used by `ReactDOMComponent` to mount, update, and * unmount child components. * * @lends {ReactMultiChild.prototype} */ Mixin: { /** * Generates a "mount image" for each of the supplied children. In the case * of `ReactDOMComponent`, a mount image is a string of markup. * * @param {?object} nestedChildren Nested child maps. * @return {array} An array of mounted representations. * @internal */ mountChildren: function(nestedChildren, transaction) { var children = flattenChildren(nestedChildren); var mountImages = []; var index = 0; this._renderedChildren = children; for (var name in children) { var child = children[name]; if (children.hasOwnProperty(name) && child) { // Inlined for performance, see `ReactInstanceHandles.createReactID`. var rootID = this._rootNodeID + '.' + name; var mountImage = child.mountComponent( rootID, transaction, this._mountDepth + 1 ); child._mountImage = mountImage; child._mountIndex = index; mountImages.push(mountImage); index++; } } return mountImages; }, /** * Replaces any rendered children with a text content string. * * @param {string} nextContent String of content. * @internal */ updateTextContent: function(nextContent) { updateDepth++; try { var prevChildren = this._renderedChildren; // Remove any rendered children. for (var name in prevChildren) { if (prevChildren.hasOwnProperty(name) && prevChildren[name]) { this._unmountChildByName(prevChildren[name], name); } } // Set new text content. this.setTextContent(nextContent); } catch (error) { updateDepth--; updateDepth || clearQueue(); throw error; } updateDepth--; updateDepth || processQueue(); }, /** * Updates the rendered children with new children. * * @param {?object} nextNestedChildren Nested child maps. * @param {ReactReconcileTransaction} transaction * @internal */ updateChildren: function(nextNestedChildren, transaction) { updateDepth++; try { this._updateChildren(nextNestedChildren, transaction); } catch (error) { updateDepth--; updateDepth || clearQueue(); throw error; } updateDepth--; updateDepth || processQueue(); }, /** * Improve performance by isolating this hot code path from the try/catch * block in `updateChildren`. * * @param {?object} nextNestedChildren Nested child maps. * @param {ReactReconcileTransaction} transaction * @final * @protected */ _updateChildren: function(nextNestedChildren, transaction) { var nextChildren = flattenChildren(nextNestedChildren); var prevChildren = this._renderedChildren; if (!nextChildren && !prevChildren) { return; } var name; // `nextIndex` will increment for each child in `nextChildren`, but // `lastIndex` will be the last index visited in `prevChildren`. var lastIndex = 0; var nextIndex = 0; for (name in nextChildren) { if (!nextChildren.hasOwnProperty(name)) { continue; } var prevChild = prevChildren && prevChildren[name]; var nextChild = nextChildren[name]; if (shouldUpdateChild(prevChild, nextChild)) { this.moveChild(prevChild, nextIndex, lastIndex); lastIndex = Math.max(prevChild._mountIndex, lastIndex); prevChild.receiveProps(nextChild.props, transaction); prevChild._mountIndex = nextIndex; } else { if (prevChild) { // Update `lastIndex` before `_mountIndex` gets unset by unmounting. lastIndex = Math.max(prevChild._mountIndex, lastIndex); this._unmountChildByName(prevChild, name); } if (nextChild) { this._mountChildByNameAtIndex( nextChild, name, nextIndex, transaction ); } } if (nextChild) { nextIndex++; } } // Remove children that are no longer present. for (name in prevChildren) { if (prevChildren.hasOwnProperty(name) && prevChildren[name] && !(nextChildren && nextChildren[name])) { this._unmountChildByName(prevChildren[name], name); } } }, /** * Unmounts all rendered children. This should be used to clean up children * when this component is unmounted. * * @internal */ unmountChildren: function() { var renderedChildren = this._renderedChildren; for (var name in renderedChildren) { var renderedChild = renderedChildren[name]; if (renderedChild && renderedChild.unmountComponent) { renderedChild.unmountComponent(); } } this._renderedChildren = null; }, /** * Moves a child component to the supplied index. * * @param {ReactComponent} child Component to move. * @param {number} toIndex Destination index of the element. * @param {number} lastIndex Last index visited of the siblings of `child`. * @protected */ moveChild: function(child, toIndex, lastIndex) { // If the index of `child` is less than `lastIndex`, then it needs to // be moved. Otherwise, we do not need to move it because a child will be // inserted or moved before `child`. if (child._mountIndex < lastIndex) { enqueueMove(this._rootNodeID, child._mountIndex, toIndex); } }, /** * Creates a child component. * * @param {ReactComponent} child Component to create. * @protected */ createChild: function(child) { enqueueMarkup(this._rootNodeID, child._mountImage, child._mountIndex); }, /** * Removes a child component. * * @param {ReactComponent} child Child to remove. * @protected */ removeChild: function(child) { enqueueRemove(this._rootNodeID, child._mountIndex); }, /** * Sets this text content string. * * @param {string} textContent Text content to set. * @protected */ setTextContent: function(textContent) { enqueueTextContent(this._rootNodeID, textContent); }, /** * Mounts a child with the supplied name. * * NOTE: This is part of `updateChildren` and is here for readability. * * @param {ReactComponent} child Component to mount. * @param {string} name Name of the child. * @param {number} index Index at which to insert the child. * @param {ReactReconcileTransaction} transaction * @private */ _mountChildByNameAtIndex: function(child, name, index, transaction) { // Inlined for performance, see `ReactInstanceHandles.createReactID`. var rootID = this._rootNodeID + '.' + name; var mountImage = child.mountComponent( rootID, transaction, this._mountDepth + 1 ); child._mountImage = mountImage; child._mountIndex = index; this.createChild(child); this._renderedChildren = this._renderedChildren || {}; this._renderedChildren[name] = child; }, /** * Unmounts a rendered child by name. * * NOTE: This is part of `updateChildren` and is here for readability. * * @param {ReactComponent} child Component to unmount. * @param {string} name Name of the child in `this._renderedChildren`. * @private */ _unmountChildByName: function(child, name) { if (ReactComponent.isValidComponent(child)) { this.removeChild(child); child._mountImage = null; child._mountIndex = null; child.unmountComponent(); delete this._renderedChildren[name]; } } } }; module.exports = ReactMultiChild; },{"./ReactComponent":28,"./ReactMultiChildUpdateTypes":56,"./flattenChildren":96}],56:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactMultiChildUpdateTypes */ var keyMirror = require("./keyMirror"); /** * When a component's children are updated, a series of update configuration * objects are created in order to batch and serialize the required changes. * * Enumerates all the possible types of update configurations. * * @internal */ var ReactMultiChildUpdateTypes = keyMirror({ INSERT_MARKUP: null, MOVE_EXISTING: null, REMOVE_NODE: null, TEXT_CONTENT: null }); module.exports = ReactMultiChildUpdateTypes; },{"./keyMirror":112}],57:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactOwner */ "use strict"; var invariant = require("./invariant"); /** * ReactOwners are capable of storing references to owned components. * * All components are capable of //being// referenced by owner components, but * only ReactOwner components are capable of //referencing// owned components. * The named reference is known as a "ref". * * Refs are available when mounted and updated during reconciliation. * * var MyComponent = React.createClass({ * render: function() { * return ( * <div onClick={this.handleClick}> * <CustomComponent ref="custom" /> * </div> * ); * }, * handleClick: function() { * this.refs.custom.handleClick(); * }, * componentDidMount: function() { * this.refs.custom.initialize(); * } * }); * * Refs should rarely be used. When refs are used, they should only be done to * control data that is not handled by React's data flow. * * @class ReactOwner */ var ReactOwner = { /** * @param {?object} object * @return {boolean} True if `object` is a valid owner. * @final */ isValidOwner: function(object) { return !!( object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function' ); }, /** * Adds a component by ref to an owner component. * * @param {ReactComponent} component Component to reference. * @param {string} ref Name by which to refer to the component. * @param {ReactOwner} owner Component on which to record the ref. * @final * @internal */ addComponentAsRefTo: function(component, ref, owner) { invariant( ReactOwner.isValidOwner(owner), 'addComponentAsRefTo(...): Only a ReactOwner can have refs.' ); owner.attachRef(ref, component); }, /** * Removes a component by ref from an owner component. * * @param {ReactComponent} component Component to dereference. * @param {string} ref Name of the ref to remove. * @param {ReactOwner} owner Component on which the ref is recorded. * @final * @internal */ removeComponentAsRefFrom: function(component, ref, owner) { invariant( ReactOwner.isValidOwner(owner), 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs.' ); // Check that `component` is still the current ref because we do not want to // detach the ref if another component stole it. if (owner.refs[ref] === component) { owner.detachRef(ref); } }, /** * A ReactComponent must mix this in to have refs. * * @lends {ReactOwner.prototype} */ Mixin: { /** * Lazily allocates the refs object and stores `component` as `ref`. * * @param {string} ref Reference name. * @param {component} component Component to store as `ref`. * @final * @private */ attachRef: function(ref, component) { invariant( component.isOwnedBy(this), 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.', ref ); var refs = this.refs || (this.refs = {}); refs[ref] = component; }, /** * Detaches a reference name. * * @param {string} ref Name to dereference. * @final * @private */ detachRef: function(ref) { delete this.refs[ref]; } } }; module.exports = ReactOwner; },{"./invariant":106}],58:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactPerf * @typechecks static-only */ "use strict"; var ReactPerf = { /** * Boolean to enable/disable measurement. Set to false by default to prevent * accidental logging and perf loss. */ enableMeasure: false, /** * Holds onto the measure function in use. By default, don't measure * anything, but we'll override this if we inject a measure function. */ storedMeasure: _noMeasure, /** * Use this to wrap methods you want to measure. * * @param {string} objName * @param {string} fnName * @param {function} func * @return {function} */ measure: function(objName, fnName, func) { if (true) { var measuredFunc = null; return function() { if (ReactPerf.enableMeasure) { if (!measuredFunc) { measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); } return measuredFunc.apply(this, arguments); } return func.apply(this, arguments); }; } return func; }, injection: { /** * @param {function} measure */ injectMeasure: function(measure) { ReactPerf.storedMeasure = measure; } } }; if (true) { var ExecutionEnvironment = require("./ExecutionEnvironment"); var URL = ExecutionEnvironment.canUseDOM ? window.location.href : ''; ReactPerf.enableMeasure = ReactPerf.enableMeasure || !!URL.match(/[?&]react_perf\b/); } /** * Simply passes through the measured function, without measuring it. * * @param {string} objName * @param {string} fnName * @param {function} func * @return {function} */ function _noMeasure(objName, fnName, func) { return func; } module.exports = ReactPerf; },{"./ExecutionEnvironment":21}],59:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactPropTransferer */ "use strict"; var emptyFunction = require("./emptyFunction"); var invariant = require("./invariant"); var joinClasses = require("./joinClasses"); var merge = require("./merge"); /** * Creates a transfer strategy that will merge prop values using the supplied * `mergeStrategy`. If a prop was previously unset, this just sets it. * * @param {function} mergeStrategy * @return {function} */ function createTransferStrategy(mergeStrategy) { return function(props, key, value) { if (!props.hasOwnProperty(key)) { props[key] = value; } else { props[key] = mergeStrategy(props[key], value); } }; } /** * Transfer strategies dictate how props are transferred by `transferPropsTo`. */ var TransferStrategies = { /** * Never transfer `children`. */ children: emptyFunction, /** * Transfer the `className` prop by merging them. */ className: createTransferStrategy(joinClasses), /** * Never transfer the `ref` prop. */ ref: emptyFunction, /** * Transfer the `style` prop (which is an object) by merging them. */ style: createTransferStrategy(merge) }; /** * ReactPropTransferer are capable of transferring props to another component * using a `transferPropsTo` method. * * @class ReactPropTransferer */ var ReactPropTransferer = { TransferStrategies: TransferStrategies, /** * @lends {ReactPropTransferer.prototype} */ Mixin: { /** * Transfer props from this component to a target component. * * Props that do not have an explicit transfer strategy will be transferred * only if the target component does not already have the prop set. * * This is usually used to pass down props to a returned root component. * * @param {ReactComponent} component Component receiving the properties. * @return {ReactComponent} The supplied `component`. * @final * @protected */ transferPropsTo: function(component) { invariant( component.props.__owner__ === this, '%s: You can\'t call transferPropsTo() on a component that you ' + 'don\'t own, %s. This usually means you are calling ' + 'transferPropsTo() on a component passed in as props or children.', this.constructor.displayName, component.constructor.displayName ); var props = {}; for (var thatKey in component.props) { if (component.props.hasOwnProperty(thatKey)) { props[thatKey] = component.props[thatKey]; } } for (var thisKey in this.props) { if (!this.props.hasOwnProperty(thisKey)) { continue; } var transferStrategy = TransferStrategies[thisKey]; if (transferStrategy) { transferStrategy(props, thisKey, this.props[thisKey]); } else if (!props.hasOwnProperty(thisKey)) { props[thisKey] = this.props[thisKey]; } } component.props = props; return component; } } }; module.exports = ReactPropTransferer; },{"./emptyFunction":92,"./invariant":106,"./joinClasses":111,"./merge":115}],60:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactPropTypes */ "use strict"; var createObjectFrom = require("./createObjectFrom"); var invariant = require("./invariant"); /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var Props = require('ReactPropTypes'); * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * invariant( * propValue == null || * typeof propValue === 'string' || * propValue instanceof URI, * 'Invalid `%s` supplied to `%s`, expected string or URI.', * propName, * componentName * ); * } * }, * render: function() { ... } * }); * * @internal */ var Props = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), oneOf: createEnumTypeChecker, instanceOf: createInstanceTypeChecker }; var ANONYMOUS = '<<anonymous>>'; function createPrimitiveTypeChecker(expectedType) { function validatePrimitiveType(propValue, propName, componentName) { var propType = typeof propValue; if (propType === 'object' && Array.isArray(propValue)) { propType = 'array'; } invariant( propType === expectedType, 'Invalid prop `%s` of type `%s` supplied to `%s`, expected `%s`.', propName, propType, componentName, expectedType ); } return createChainableTypeChecker(validatePrimitiveType); } function createEnumTypeChecker(expectedValues) { var expectedEnum = createObjectFrom(expectedValues); function validateEnumType(propValue, propName, componentName) { invariant( expectedEnum[propValue], 'Invalid prop `%s` supplied to `%s`, expected one of %s.', propName, componentName, JSON.stringify(Object.keys(expectedEnum)) ); } return createChainableTypeChecker(validateEnumType); } function createInstanceTypeChecker(expectedClass) { function validateInstanceType(propValue, propName, componentName) { invariant( propValue instanceof expectedClass, 'Invalid prop `%s` supplied to `%s`, expected instance of `%s`.', propName, componentName, expectedClass.name || ANONYMOUS ); } return createChainableTypeChecker(validateInstanceType); } function createChainableTypeChecker(validate) { function createTypeChecker(isRequired) { function checkType(props, propName, componentName) { var propValue = props[propName]; if (propValue != null) { // Only validate if there is a value to check. validate(propValue, propName, componentName || ANONYMOUS); } else { invariant( !isRequired, 'Required prop `%s` was not specified in `%s`.', propName, componentName || ANONYMOUS ); } } if (!isRequired) { checkType.isRequired = createTypeChecker(true); } return checkType; } return createTypeChecker(false); } module.exports = Props; },{"./createObjectFrom":89,"./invariant":106}],61:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactReconcileTransaction * @typechecks static-only */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); var PooledClass = require("./PooledClass"); var ReactEventEmitter = require("./ReactEventEmitter"); var ReactInputSelection = require("./ReactInputSelection"); var ReactMountReady = require("./ReactMountReady"); var Transaction = require("./Transaction"); var mixInto = require("./mixInto"); /** * Ensures that, when possible, the selection range (currently selected text * input) is not disturbed by performing the transaction. */ var SELECTION_RESTORATION = { /** * @return {Selection} Selection information. */ initialize: ReactInputSelection.getSelectionInformation, /** * @param {Selection} sel Selection information returned from `initialize`. */ close: ReactInputSelection.restoreSelection }; /** * Suppresses events (blur/focus) that could be inadvertently dispatched due to * high level DOM manipulations (like temporarily removing a text input from the * DOM). */ var EVENT_SUPPRESSION = { /** * @return {boolean} The enabled status of `ReactEventEmitter` before the * reconciliation. */ initialize: function() { var currentlyEnabled = ReactEventEmitter.isEnabled(); ReactEventEmitter.setEnabled(false); return currentlyEnabled; }, /** * @param {boolean} previouslyEnabled Enabled status of `ReactEventEmitter` * before the reconciliation occured. `close` restores the previous value. */ close: function(previouslyEnabled) { ReactEventEmitter.setEnabled(previouslyEnabled); } }; /** * Provides a `ReactMountReady` queue for collecting `onDOMReady` callbacks * during the performing of the transaction. */ var ON_DOM_READY_QUEUEING = { /** * Initializes the internal `onDOMReady` queue. */ initialize: function() { this.reactMountReady.reset(); }, /** * After DOM is flushed, invoke all registered `onDOMReady` callbacks. */ close: function() { this.reactMountReady.notifyAll(); } }; /** * Executed within the scope of the `Transaction` instance. Consider these as * being member methods, but with an implied ordering while being isolated from * each other. */ var TRANSACTION_WRAPPERS = [ SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING ]; /** * Currently: * - The order that these are listed in the transaction is critical: * - Suppresses events. * - Restores selection range. * * Future: * - Restore document/overflow scroll positions that were unintentionally * modified via DOM insertions above the top viewport boundary. * - Implement/integrate with customized constraint based layout system and keep * track of which dimensions must be remeasured. * * @class ReactReconcileTransaction */ function ReactReconcileTransaction() { this.reinitializeTransaction(); this.reactMountReady = ReactMountReady.getPooled(null); } var Mixin = { /** * @see Transaction * @abstract * @final * @return {array<object>} List of operation wrap proceedures. * TODO: convert to array<TransactionWrapper> */ getTransactionWrappers: function() { if (ExecutionEnvironment.canUseDOM) { return TRANSACTION_WRAPPERS; } else { return []; } }, /** * @return {object} The queue to collect `onDOMReady` callbacks with. * TODO: convert to ReactMountReady */ getReactMountReady: function() { return this.reactMountReady; }, /** * `PooledClass` looks for this, and will invoke this before allowing this * instance to be resused. */ destructor: function() { ReactMountReady.release(this.reactMountReady); this.reactMountReady = null; } }; mixInto(ReactReconcileTransaction, Transaction.Mixin); mixInto(ReactReconcileTransaction, Mixin); PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; },{"./ExecutionEnvironment":21,"./PooledClass":25,"./ReactEventEmitter":46,"./ReactInputSelection":49,"./ReactMountReady":54,"./Transaction":82,"./mixInto":118}],62:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @typechecks static-only * @providesModule ReactServerRendering */ "use strict"; var ReactMarkupChecksum = require("./ReactMarkupChecksum"); var ReactReconcileTransaction = require("./ReactReconcileTransaction"); var ReactInstanceHandles = require("./ReactInstanceHandles"); /** * @param {object} component * @param {function} callback */ function renderComponentToString(component, callback) { // We use a callback API to keep the API async in case in the future we ever // need it, but in reality this is a synchronous operation. var id = ReactInstanceHandles.createReactRootID(); var transaction = ReactReconcileTransaction.getPooled(); transaction.reinitializeTransaction(); try { transaction.perform(function() { var markup = component.mountComponent(id, transaction, 0); markup = ReactMarkupChecksum.addChecksumToMarkup(markup); callback(markup); }, null); } finally { ReactReconcileTransaction.release(transaction); } } module.exports = { renderComponentToString: renderComponentToString }; },{"./ReactInstanceHandles":50,"./ReactMarkupChecksum":52,"./ReactReconcileTransaction":61}],63:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactStateSetters */ "use strict"; var ReactStateSetters = { /** * Returns a function that calls the provided function, and uses the result * of that to set the component's state. * * @param {ReactCompositeComponent} component * @param {function} funcReturningState Returned callback uses this to * determine how to update state. * @return {function} callback that when invoked uses funcReturningState to * determined the object literal to setState. */ createStateSetter: function(component, funcReturningState) { return function(a, b, c, d, e, f) { var partialState = funcReturningState.call(component, a, b, c, d, e, f); if (partialState) { component.setState(partialState); } }; }, /** * Returns a single-argument callback that can be used to update a single * key in the component's state. * * Note: this is memoized function, which makes it inexpensive to call. * * @param {ReactCompositeComponent} component * @param {string} key The key in the state that you should update. * @return {function} callback of 1 argument which calls setState() with * the provided keyName and callback argument. */ createStateKeySetter: function(component, key) { // Memoize the setters. var cache = component.__keySetters || (component.__keySetters = {}); return cache[key] || (cache[key] = createStateKeySetter(component, key)); } }; function createStateKeySetter(component, key) { // Partial state is allocated outside of the function closure so it can be // reused with every call, avoiding memory allocation when this function // is called. var partialState = {}; return function stateKeySetter(value) { partialState[key] = value; component.setState(partialState); }; } ReactStateSetters.Mixin = { /** * Returns a function that calls the provided function, and uses the result * of that to set the component's state. * * For example, these statements are equivalent: * * this.setState({x: 1}); * this.createStateSetter(function(xValue) { * return {x: xValue}; * })(1); * * @param {function} funcReturningState Returned callback uses this to * determine how to update state. * @return {function} callback that when invoked uses funcReturningState to * determined the object literal to setState. */ createStateSetter: function(funcReturningState) { return ReactStateSetters.createStateSetter(this, funcReturningState); }, /** * Returns a single-argument callback that can be used to update a single * key in the component's state. * * For example, these statements are equivalent: * * this.setState({x: 1}); * this.createStateKeySetter('x')(1); * * Note: this is memoized function, which makes it inexpensive to call. * * @param {string} key The key in the state that you should update. * @return {function} callback of 1 argument which calls setState() with * the provided keyName and callback argument. */ createStateKeySetter: function(key) { return ReactStateSetters.createStateKeySetter(this, key); } }; module.exports = ReactStateSetters; },{}],64:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactTextComponent * @typechecks static-only */ "use strict"; var ReactComponent = require("./ReactComponent"); var ReactMount = require("./ReactMount"); var escapeTextForBrowser = require("./escapeTextForBrowser"); var mixInto = require("./mixInto"); /** * Text nodes violate a couple assumptions that React makes about components: * * - When mounting text into the DOM, adjacent text nodes are merged. * - Text nodes cannot be assigned a React root ID. * * This component is used to wrap strings in elements so that they can undergo * the same reconciliation that is applied to elements. * * TODO: Investigate representing React components in the DOM with text nodes. * * @class ReactTextComponent * @extends ReactComponent * @internal */ var ReactTextComponent = function(initialText) { this.construct({text: initialText}); }; mixInto(ReactTextComponent, ReactComponent.Mixin); mixInto(ReactTextComponent, { /** * Creates the markup for this text node. This node is not intended to have * any features besides containing text content. * * @param {string} rootID DOM ID of the root node. * @param {ReactReconcileTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy * @return {string} Markup for this text node. * @internal */ mountComponent: function(rootID, transaction, mountDepth) { ReactComponent.Mixin.mountComponent.call( this, rootID, transaction, mountDepth ); return ( '<span ' + ReactMount.ATTR_NAME + '="' + rootID + '">' + escapeTextForBrowser(this.props.text) + '</span>' ); }, /** * Updates this component by updating the text content. * * @param {object} nextProps Contains the next text content. * @param {ReactReconcileTransaction} transaction * @internal */ receiveProps: function(nextProps, transaction) { if (nextProps.text !== this.props.text) { this.props.text = nextProps.text; ReactComponent.DOMIDOperations.updateTextContentByID( this._rootNodeID, nextProps.text ); } } }); module.exports = ReactTextComponent; },{"./ReactComponent":28,"./ReactMount":53,"./escapeTextForBrowser":93,"./mixInto":118}],65:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactTransitionEvents */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); var EVENT_NAME_MAP = { transitionend: { 'transition': 'transitionend', 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'mozTransitionEnd', 'OTransition': 'oTransitionEnd', 'msTransition': 'MSTransitionEnd' }, animationend: { 'animation': 'animationend', 'WebkitAnimation': 'webkitAnimationEnd', 'MozAnimation': 'mozAnimationEnd', 'OAnimation': 'oAnimationEnd', 'msAnimation': 'MSAnimationEnd' } }; var endEvents = []; function detectEvents() { var testEl = document.createElement('div'); var style = testEl.style; for (var baseEventName in EVENT_NAME_MAP) { var baseEvents = EVENT_NAME_MAP[baseEventName]; for (var styleName in baseEvents) { if (styleName in style) { endEvents.push(baseEvents[styleName]); break; } } } } if (ExecutionEnvironment.canUseDOM) { detectEvents(); } // We use the raw {add|remove}EventListener() call because EventListener // does not know how to remove event listeners and we really should // clean up. Also, these events are not triggered in older browsers // so we should be A-OK here. function addEventListener(node, eventName, eventListener) { node.addEventListener(eventName, eventListener, false); } function removeEventListener(node, eventName, eventListener) { node.removeEventListener(eventName, eventListener, false); } var ReactTransitionEvents = { addEndEventListener: function(node, eventListener) { if (endEvents.length === 0) { // If CSS transitions are not supported, trigger an "end animation" // event immediately. window.setTimeout(eventListener, 0); return; } endEvents.forEach(function(endEvent) { addEventListener(node, endEvent, eventListener); }); }, removeEndEventListener: function(node, eventListener) { if (endEvents.length === 0) { return; } endEvents.forEach(function(endEvent) { removeEventListener(node, endEvent, eventListener); }); } }; module.exports = ReactTransitionEvents; },{"./ExecutionEnvironment":21}],66:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactTransitionGroup */ "use strict"; var React = require("./React"); var ReactTransitionableChild = require("./ReactTransitionableChild"); var ReactTransitionKeySet = require("./ReactTransitionKeySet"); var invariant = require("./invariant"); var ReactTransitionGroupMixin = { componentWillMount: function() { // _transitionGroupCurrentKeys stores the union of previous *and* next keys. // If this were a component we'd store it as state, however, since this must // be a mixin, we need to keep the result of the union of keys in each // call to animateChildren() which happens in render(), so we can't // call setState() in there. this._transitionGroupCurrentKeys = {}; }, /** * Render some children in a transitionable way. */ renderTransitionableChildren: function(sourceChildren) { invariant( this.getTransitionConfig, 'renderTransitionableChildren(): You must provide a ' + 'getTransitionConfig() method.' ); var children = {}; var childMapping = ReactTransitionKeySet.getChildMapping(sourceChildren); var transitionConfig = this.getTransitionConfig(); var currentKeys = ReactTransitionKeySet.mergeKeySets( this._transitionGroupCurrentKeys, ReactTransitionKeySet.getKeySet(sourceChildren) ); for (var key in currentKeys) { // Here is how we keep the nodes in the DOM. ReactTransitionableChild // knows how to hold onto its child if it changes to undefined. Here, we // may look up an old key in the new children, and it may switch to // undefined. React's reconciler will keep the ReactTransitionableChild // instance alive such that we can animate it. if (childMapping[key] || transitionConfig.leave) { children[key] = ReactTransitionableChild({ name: transitionConfig.name, enter: transitionConfig.enter, onDoneLeaving: this._handleDoneLeaving.bind(this, key) }, childMapping[key]); } } this._transitionGroupCurrentKeys = currentKeys; return children; }, _handleDoneLeaving: function(key) { // When the leave animation finishes, we should blow away the actual DOM // node. delete this._transitionGroupCurrentKeys[key]; this.forceUpdate(); } }; var ReactTransitionGroup = React.createClass({ mixins: [ReactTransitionGroupMixin], getDefaultProps: function() { return { transitionEnter: true, transitionLeave: true, component: React.DOM.span }; }, getTransitionConfig: function() { return { name: this.props.transitionName, enter: this.props.transitionEnter, leave: this.props.transitionLeave }; }, render: function() { return this.transferPropsTo( this.props.component( { transitionName: null, transitionEnter: null, transitionLeave: null, component: null }, this.renderTransitionableChildren(this.props.children) ) ); } }); module.exports = ReactTransitionGroup; },{"./React":26,"./ReactTransitionKeySet":67,"./ReactTransitionableChild":68,"./invariant":106}],67:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @typechecks static-only * @providesModule ReactTransitionKeySet */ "use strict"; var ReactChildren = require("./ReactChildren"); var MERGE_KEY_SETS_TAIL_SENTINEL = {}; var ReactTransitionKeySet = { /** * Given `this.props.children`, return an object mapping key to child. Just * simple syntactic sugar around ReactChildren.map(). * * @param {*} children `this.props.children` * @return {object} Mapping of key to child */ getChildMapping: function(children) { return ReactChildren.map(children, function(child) { return child; }); }, /** * Simple syntactic sugar to get an object with keys of all of `children`. * Does not have references to the children themselves. * * @param {*} children `this.props.children` * @return {object} Mapping of key to the value "true" */ getKeySet: function(children) { return ReactChildren.map(children, function() { return true; }); }, /** * When you're adding or removing children some may be added or removed in the * same render pass. We want ot show *both* since we want to simultaneously * animate elements in and out. This function takes a previous set of keys * and a new set of keys and merges them with its best guess of the correct * ordering. In the future we may expose some of the utilities in * ReactMultiChild to make this easy, but for now React itself does not * directly have this concept of the union of prevChildren and nextChildren * so we implement it here. * * @param {object} prev prev child keys as returned from * `ReactTransitionKeySet.getKeySet()`. * @param {object} next next child keys as returned from * `ReactTransitionKeySet.getKeySet()`. * @return {object} a key set that contains all keys in `prev` and all keys * in `next` in a reasonable order. */ mergeKeySets: function(prev, next) { var keySet = {}; var prevKeys = Object.keys(prev).concat([MERGE_KEY_SETS_TAIL_SENTINEL]); var nextKeys = Object.keys(next).concat([MERGE_KEY_SETS_TAIL_SENTINEL]); var i; for (i = 0; i < prevKeys.length - 1; i++) { var prevKey = prevKeys[i]; if (next[prevKey]) { continue; } // This key is not in the new set. Place it in our // best guess where it should go. We do this by searching // for a key after the current one in prevKeys that is // still in nextKeys, and inserting right before it. // I know this is O(n^2), but this is not a particularly // hot code path. var insertPos = -1; for (var j = i + 1; j < prevKeys.length; j++) { insertPos = nextKeys.indexOf(prevKeys[j]); if (insertPos >= 0) { break; } } // Insert before insertPos nextKeys.splice(insertPos, 0, prevKey); } for (i = 0; i < nextKeys.length - 1; i++) { keySet[nextKeys[i]] = true; } return keySet; } }; module.exports = ReactTransitionKeySet; },{"./ReactChildren":27}],68:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactTransitionableChild */ "use strict"; var React = require("./React"); var CSSCore = require("./CSSCore"); var ReactTransitionEvents = require("./ReactTransitionEvents"); // We don't remove the element from the DOM until we receive an animationend or // transitionend event. If the user screws up and forgets to add an animation // their node will be stuck in the DOM forever, so we detect if an animation // does not start and if it doesn't, we just call the end listener immediately. var TICK = 17; var NO_EVENT_TIMEOUT = 5000; var noEventListener = null; if (true) { noEventListener = function() { console.warn( 'transition(): tried to perform an animation without ' + 'an animationend or transitionend event after timeout (' + NO_EVENT_TIMEOUT + 'ms). You should either disable this ' + 'transition in JS or add a CSS animation/transition.' ); }; } /** * This component is simply responsible for watching when its single child * changes to undefined and animating the old child out. It does this by * recording its old child in savedChildren when it detects this event is about * to occur. */ var ReactTransitionableChild = React.createClass({ /** * Perform an actual DOM transition. This takes care of a few things: * - Adding the second CSS class to trigger the transition * - Listening for the finish event * - Cleaning up the css (unless noReset is true) */ transition: function(animationType, noReset, finishCallback) { var node = this.getDOMNode(); var className = this.props.name + '-' + animationType; var activeClassName = className + '-active'; var noEventTimeout = null; var endListener = function() { if (true) { clearTimeout(noEventTimeout); } // If this gets invoked after the component is unmounted it's OK. if (!noReset) { // Usually this means you're about to remove the node if you want to // leave it in its animated state. CSSCore.removeClass(node, className); CSSCore.removeClass(node, activeClassName); } ReactTransitionEvents.removeEndEventListener(node, endListener); // Usually this optional callback is used for informing an owner of // a leave animation and telling it to remove the child. finishCallback && finishCallback(); }; ReactTransitionEvents.addEndEventListener(node, endListener); CSSCore.addClass(node, className); // Need to do this to actually trigger a transition. this.queueClass(activeClassName); if (true) { noEventTimeout = setTimeout(noEventListener, NO_EVENT_TIMEOUT); } }, queueClass: function(className) { this.classNameQueue.push(className); if (this.props.runNextTick) { this.props.runNextTick(this.flushClassNameQueue); return; } if (!this.timeout) { this.timeout = setTimeout(this.flushClassNameQueue, TICK); } }, flushClassNameQueue: function() { if (this.isMounted()) { this.classNameQueue.forEach( CSSCore.addClass.bind(CSSCore, this.getDOMNode()) ); } this.classNameQueue.length = 0; this.timeout = null; }, componentWillMount: function() { this.classNameQueue = []; }, componentWillUnmount: function() { if (this.timeout) { clearTimeout(this.timeout); } }, componentWillReceiveProps: function(nextProps) { if (!nextProps.children && this.props.children) { this.savedChildren = this.props.children; } }, componentDidMount: function(node) { if (this.props.enter) { this.transition('enter'); } }, componentDidUpdate: function(prevProps, prevState, node) { if (prevProps.children && !this.props.children) { this.transition('leave', true, this.props.onDoneLeaving); } }, render: function() { return this.props.children || this.savedChildren; } }); module.exports = ReactTransitionableChild; },{"./CSSCore":2,"./React":26,"./ReactTransitionEvents":65}],69:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactUpdates */ "use strict"; var invariant = require("./invariant"); var dirtyComponents = []; var batchingStrategy = null; function ensureBatchingStrategy() { invariant(batchingStrategy, 'ReactUpdates: must inject a batching strategy'); } function batchedUpdates(callback, param) { ensureBatchingStrategy(); batchingStrategy.batchedUpdates(callback, param); } /** * Array comparator for ReactComponents by owner depth * * @param {ReactComponent} c1 first component you're comparing * @param {ReactComponent} c2 second component you're comparing * @return {number} Return value usable by Array.prototype.sort(). */ function mountDepthComparator(c1, c2) { return c1._mountDepth - c2._mountDepth; } function runBatchedUpdates() { // Since reconciling a component higher in the owner hierarchy usually (not // always -- see shouldComponentUpdate()) will reconcile children, reconcile // them before their children by sorting the array. dirtyComponents.sort(mountDepthComparator); for (var i = 0; i < dirtyComponents.length; i++) { // If a component is unmounted before pending changes apply, ignore them // TODO: Queue unmounts in the same list to avoid this happening at all var component = dirtyComponents[i]; if (component.isMounted()) { // If performUpdateIfNecessary happens to enqueue any new updates, we // shouldn't execute the callbacks until the next render happens, so // stash the callbacks first var callbacks = component._pendingCallbacks; component._pendingCallbacks = null; component.performUpdateIfNecessary(); if (callbacks) { for (var j = 0; j < callbacks.length; j++) { callbacks[j].call(component); } } } } } function clearDirtyComponents() { dirtyComponents.length = 0; } function flushBatchedUpdates() { // Run these in separate functions so the JIT can optimize try { runBatchedUpdates(); } catch (e) { // IE 8 requires catch to use finally. throw e; } finally { clearDirtyComponents(); } } /** * Mark a component as needing a rerender, adding an optional callback to a * list of functions which will be executed once the rerender occurs. */ function enqueueUpdate(component, callback) { invariant( !callback || typeof callback === "function", 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.' ); ensureBatchingStrategy(); if (!batchingStrategy.isBatchingUpdates) { component.performUpdateIfNecessary(); callback && callback(); return; } dirtyComponents.push(component); if (callback) { if (component._pendingCallbacks) { component._pendingCallbacks.push(callback); } else { component._pendingCallbacks = [callback]; } } } var ReactUpdatesInjection = { injectBatchingStrategy: function(_batchingStrategy) { invariant( _batchingStrategy, 'ReactUpdates: must provide a batching strategy' ); invariant( typeof _batchingStrategy.batchedUpdates === 'function', 'ReactUpdates: must provide a batchedUpdates() function' ); invariant( typeof _batchingStrategy.isBatchingUpdates === 'boolean', 'ReactUpdates: must provide an isBatchingUpdates boolean attribute' ); batchingStrategy = _batchingStrategy; } }; var ReactUpdates = { batchedUpdates: batchedUpdates, enqueueUpdate: enqueueUpdate, flushBatchedUpdates: flushBatchedUpdates, injection: ReactUpdatesInjection }; module.exports = ReactUpdates; },{"./invariant":106}],70:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactWithAddons */ /** * This module exists purely in the open source project, and is meant as a way * to create a separate standalone build of React. This build has "addons", or * functionality we've built and think might be useful but doesn't have a good * place to live inside React core. */ "use strict"; var LinkedStateMixin = require("./LinkedStateMixin"); var React = require("./React"); var ReactTransitionGroup = require("./ReactTransitionGroup"); var cx = require("./cx"); React.addons = { classSet: cx, LinkedStateMixin: LinkedStateMixin, TransitionGroup: ReactTransitionGroup }; module.exports = React; },{"./LinkedStateMixin":22,"./React":26,"./ReactTransitionGroup":66,"./cx":90}],71:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SelectEventPlugin */ "use strict"; var EventConstants = require("./EventConstants"); var EventPluginHub = require("./EventPluginHub"); var EventPropagators = require("./EventPropagators"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var ReactInputSelection = require("./ReactInputSelection"); var SyntheticEvent = require("./SyntheticEvent"); var getActiveElement = require("./getActiveElement"); var isEventSupported = require("./isEventSupported"); var isTextInputElement = require("./isTextInputElement"); var keyOf = require("./keyOf"); var shallowEqual = require("./shallowEqual"); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { select: { phasedRegistrationNames: { bubbled: keyOf({onSelect: null}), captured: keyOf({onSelectCapture: null}) } } }; var useSelectionChange = false; var useSelect = false; if (ExecutionEnvironment.canUseDOM) { useSelectionChange = 'onselectionchange' in document; useSelect = isEventSupported('select'); } var activeElement = null; var activeElementID = null; var activeNativeEvent = null; var lastSelection = null; var mouseDown = false; /** * Get an object which is a unique representation of the current selection. * * The return value will not be consistent across nodes or browsers, but * two identical selections on the same node will return identical objects. * * @param {DOMElement} node * @param {object} */ function getSelection(node) { if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) { return { start: node.selectionStart, end: node.selectionEnd }; } else if (document.selection) { var range = document.selection.createRange(); return { parentElement: range.parentElement(), text: range.text, top: range.boundingTop, left: range.boundingLeft }; } else { var selection = window.getSelection(); return { anchorNode: selection.anchorNode, anchorOffset: selection.anchorOffset, focusNode: selection.focusNode, focusOffset: selection.focusOffset }; } } /** * Poll selection to see whether it's changed. * * @param {object} nativeEvent * @return {?SyntheticEvent} */ function constructSelectEvent(nativeEvent) { // Ensure we have the right element, and that the user is not dragging a // selection (this matches native `select` event behavior). if (mouseDown || activeElement != getActiveElement()) { return; } // Only fire when selection has actually changed. var currentSelection = getSelection(activeElement); if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { lastSelection = currentSelection; var syntheticEvent = SyntheticEvent.getPooled( eventTypes.select, activeElementID, nativeEvent ); syntheticEvent.type = 'select'; syntheticEvent.target = activeElement; EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent); return syntheticEvent; } } /** * Handle deferred event. And manually dispatch synthetic events. */ function dispatchDeferredSelectEvent() { if (!activeNativeEvent) { return; } var syntheticEvent = constructSelectEvent(activeNativeEvent); activeNativeEvent = null; // Enqueue and process the abstract event manually. if (syntheticEvent) { EventPluginHub.enqueueEvents(syntheticEvent); EventPluginHub.processEventQueue(); } } /** * This plugin creates an `onSelect` event that normalizes select events * across form elements. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - contentEditable * * This differs from native browser implementations in the following ways: * - Fires on contentEditable fields as well as inputs. * - Fires for collapsed selection. * - Fires after user input. */ var SelectEventPlugin = { eventTypes: eventTypes, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { switch (topLevelType) { // Track the input node that has focus. case topLevelTypes.topFocus: if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') { activeElement = topLevelTarget; activeElementID = topLevelTargetID; lastSelection = null; } break; case topLevelTypes.topBlur: activeElement = null; activeElementID = null; lastSelection = null; break; // Don't fire the event while the user is dragging. This matches the // semantics of the native select event. case topLevelTypes.topMouseDown: mouseDown = true; break; case topLevelTypes.topMouseUp: mouseDown = false; return constructSelectEvent(nativeEvent); // Chrome and IE fire non-standard event when selection is changed (and // sometimes when it hasn't). case topLevelTypes.topSelectionChange: return constructSelectEvent(nativeEvent); // Firefox doesn't support selectionchange, so check selection status // after each key entry. case topLevelTypes.topKeyDown: if (!useSelectionChange) { activeNativeEvent = nativeEvent; setTimeout(dispatchDeferredSelectEvent, 0); } break; } } }; module.exports = SelectEventPlugin; },{"./EventConstants":15,"./EventPluginHub":17,"./EventPropagators":20,"./ExecutionEnvironment":21,"./ReactInputSelection":49,"./SyntheticEvent":75,"./getActiveElement":99,"./isEventSupported":107,"./isTextInputElement":109,"./keyOf":113,"./shallowEqual":124}],72:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SimpleEventPlugin */ "use strict"; var EventConstants = require("./EventConstants"); var EventPropagators = require("./EventPropagators"); var SyntheticClipboardEvent = require("./SyntheticClipboardEvent"); var SyntheticEvent = require("./SyntheticEvent"); var SyntheticFocusEvent = require("./SyntheticFocusEvent"); var SyntheticKeyboardEvent = require("./SyntheticKeyboardEvent"); var SyntheticMouseEvent = require("./SyntheticMouseEvent"); var SyntheticTouchEvent = require("./SyntheticTouchEvent"); var SyntheticUIEvent = require("./SyntheticUIEvent"); var SyntheticWheelEvent = require("./SyntheticWheelEvent"); var invariant = require("./invariant"); var keyOf = require("./keyOf"); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { blur: { phasedRegistrationNames: { bubbled: keyOf({onBlur: true}), captured: keyOf({onBlurCapture: true}) } }, click: { phasedRegistrationNames: { bubbled: keyOf({onClick: true}), captured: keyOf({onClickCapture: true}) } }, copy: { phasedRegistrationNames: { bubbled: keyOf({onCopy: true}), captured: keyOf({onCopyCapture: true}) } }, cut: { phasedRegistrationNames: { bubbled: keyOf({onCut: true}), captured: keyOf({onCutCapture: true}) } }, doubleClick: { phasedRegistrationNames: { bubbled: keyOf({onDoubleClick: true}), captured: keyOf({onDoubleClickCapture: true}) } }, drag: { phasedRegistrationNames: { bubbled: keyOf({onDrag: true}), captured: keyOf({onDragCapture: true}) } }, dragEnd: { phasedRegistrationNames: { bubbled: keyOf({onDragEnd: true}), captured: keyOf({onDragEndCapture: true}) } }, dragEnter: { phasedRegistrationNames: { bubbled: keyOf({onDragEnter: true}), captured: keyOf({onDragEnterCapture: true}) } }, dragExit: { phasedRegistrationNames: { bubbled: keyOf({onDragExit: true}), captured: keyOf({onDragExitCapture: true}) } }, dragLeave: { phasedRegistrationNames: { bubbled: keyOf({onDragLeave: true}), captured: keyOf({onDragLeaveCapture: true}) } }, dragOver: { phasedRegistrationNames: { bubbled: keyOf({onDragOver: true}), captured: keyOf({onDragOverCapture: true}) } }, dragStart: { phasedRegistrationNames: { bubbled: keyOf({onDragStart: true}), captured: keyOf({onDragStartCapture: true}) } }, drop: { phasedRegistrationNames: { bubbled: keyOf({onDrop: true}), captured: keyOf({onDropCapture: true}) } }, focus: { phasedRegistrationNames: { bubbled: keyOf({onFocus: true}), captured: keyOf({onFocusCapture: true}) } }, input: { phasedRegistrationNames: { bubbled: keyOf({onInput: true}), captured: keyOf({onInputCapture: true}) } }, keyDown: { phasedRegistrationNames: { bubbled: keyOf({onKeyDown: true}), captured: keyOf({onKeyDownCapture: true}) } }, keyPress: { phasedRegistrationNames: { bubbled: keyOf({onKeyPress: true}), captured: keyOf({onKeyPressCapture: true}) } }, keyUp: { phasedRegistrationNames: { bubbled: keyOf({onKeyUp: true}), captured: keyOf({onKeyUpCapture: true}) } }, // Note: We do not allow listening to mouseOver events. Instead, use the // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`. mouseDown: { phasedRegistrationNames: { bubbled: keyOf({onMouseDown: true}), captured: keyOf({onMouseDownCapture: true}) } }, mouseMove: { phasedRegistrationNames: { bubbled: keyOf({onMouseMove: true}), captured: keyOf({onMouseMoveCapture: true}) } }, mouseUp: { phasedRegistrationNames: { bubbled: keyOf({onMouseUp: true}), captured: keyOf({onMouseUpCapture: true}) } }, paste: { phasedRegistrationNames: { bubbled: keyOf({onPaste: true}), captured: keyOf({onPasteCapture: true}) } }, scroll: { phasedRegistrationNames: { bubbled: keyOf({onScroll: true}), captured: keyOf({onScrollCapture: true}) } }, submit: { phasedRegistrationNames: { bubbled: keyOf({onSubmit: true}), captured: keyOf({onSubmitCapture: true}) } }, touchCancel: { phasedRegistrationNames: { bubbled: keyOf({onTouchCancel: true}), captured: keyOf({onTouchCancelCapture: true}) } }, touchEnd: { phasedRegistrationNames: { bubbled: keyOf({onTouchEnd: true}), captured: keyOf({onTouchEndCapture: true}) } }, touchMove: { phasedRegistrationNames: { bubbled: keyOf({onTouchMove: true}), captured: keyOf({onTouchMoveCapture: true}) } }, touchStart: { phasedRegistrationNames: { bubbled: keyOf({onTouchStart: true}), captured: keyOf({onTouchStartCapture: true}) } }, wheel: { phasedRegistrationNames: { bubbled: keyOf({onWheel: true}), captured: keyOf({onWheelCapture: true}) } } }; var topLevelEventsToDispatchConfig = { topBlur: eventTypes.blur, topClick: eventTypes.click, topCopy: eventTypes.copy, topCut: eventTypes.cut, topDoubleClick: eventTypes.doubleClick, topDrag: eventTypes.drag, topDragEnd: eventTypes.dragEnd, topDragEnter: eventTypes.dragEnter, topDragExit: eventTypes.dragExit, topDragLeave: eventTypes.dragLeave, topDragOver: eventTypes.dragOver, topDragStart: eventTypes.dragStart, topDrop: eventTypes.drop, topFocus: eventTypes.focus, topInput: eventTypes.input, topKeyDown: eventTypes.keyDown, topKeyPress: eventTypes.keyPress, topKeyUp: eventTypes.keyUp, topMouseDown: eventTypes.mouseDown, topMouseMove: eventTypes.mouseMove, topMouseUp: eventTypes.mouseUp, topPaste: eventTypes.paste, topScroll: eventTypes.scroll, topSubmit: eventTypes.submit, topTouchCancel: eventTypes.touchCancel, topTouchEnd: eventTypes.touchEnd, topTouchMove: eventTypes.touchMove, topTouchStart: eventTypes.touchStart, topWheel: eventTypes.wheel }; var SimpleEventPlugin = { eventTypes: eventTypes, /** * Same as the default implementation, except cancels the event when return * value is false. * * @param {object} Event to be dispatched. * @param {function} Application-level callback. * @param {string} domID DOM ID to pass to the callback. */ executeDispatch: function(event, listener, domID) { var returnValue = listener(event, domID); if (returnValue === false) { event.stopPropagation(); event.preventDefault(); } }, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; if (!dispatchConfig) { return null; } var EventConstructor; switch(topLevelType) { case topLevelTypes.topInput: case topLevelTypes.topSubmit: // HTML Events // @see http://www.w3.org/TR/html5/index.html#events-0 EventConstructor = SyntheticEvent; break; case topLevelTypes.topKeyDown: case topLevelTypes.topKeyPress: case topLevelTypes.topKeyUp: EventConstructor = SyntheticKeyboardEvent; break; case topLevelTypes.topBlur: case topLevelTypes.topFocus: EventConstructor = SyntheticFocusEvent; break; case topLevelTypes.topClick: // Firefox creates a click event on right mouse clicks. This removes the // unwanted click events. if (nativeEvent.button === 2) { return null; } /* falls through */ case topLevelTypes.topDoubleClick: case topLevelTypes.topDrag: case topLevelTypes.topDragEnd: case topLevelTypes.topDragEnter: case topLevelTypes.topDragExit: case topLevelTypes.topDragLeave: case topLevelTypes.topDragOver: case topLevelTypes.topDragStart: case topLevelTypes.topDrop: case topLevelTypes.topMouseDown: case topLevelTypes.topMouseMove: case topLevelTypes.topMouseUp: EventConstructor = SyntheticMouseEvent; break; case topLevelTypes.topTouchCancel: case topLevelTypes.topTouchEnd: case topLevelTypes.topTouchMove: case topLevelTypes.topTouchStart: EventConstructor = SyntheticTouchEvent; break; case topLevelTypes.topScroll: EventConstructor = SyntheticUIEvent; break; case topLevelTypes.topWheel: EventConstructor = SyntheticWheelEvent; break; case topLevelTypes.topCopy: case topLevelTypes.topCut: case topLevelTypes.topPaste: EventConstructor = SyntheticClipboardEvent; break; } invariant( EventConstructor, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType ); var event = EventConstructor.getPooled( dispatchConfig, topLevelTargetID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); return event; } }; module.exports = SimpleEventPlugin; },{"./EventConstants":15,"./EventPropagators":20,"./SyntheticClipboardEvent":73,"./SyntheticEvent":75,"./SyntheticFocusEvent":76,"./SyntheticKeyboardEvent":77,"./SyntheticMouseEvent":78,"./SyntheticTouchEvent":79,"./SyntheticUIEvent":80,"./SyntheticWheelEvent":81,"./invariant":106,"./keyOf":113}],73:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticClipboardEvent * @typechecks static-only */ "use strict"; var SyntheticEvent = require("./SyntheticEvent"); /** * @interface Event * @see http://www.w3.org/TR/clipboard-apis/ */ var ClipboardEventInterface = { clipboardData: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; },{"./SyntheticEvent":75}],74:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticCompositionEvent * @typechecks static-only */ "use strict"; var SyntheticEvent = require("./SyntheticEvent"); /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ var CompositionEventInterface = { data: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticCompositionEvent( dispatchConfig, dispatchMarker, nativeEvent) { SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticEvent.augmentClass( SyntheticCompositionEvent, CompositionEventInterface ); module.exports = SyntheticCompositionEvent; },{"./SyntheticEvent":75}],75:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticEvent * @typechecks static-only */ "use strict"; var PooledClass = require("./PooledClass"); var emptyFunction = require("./emptyFunction"); var getEventTarget = require("./getEventTarget"); var merge = require("./merge"); var mergeInto = require("./mergeInto"); /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var EventInterface = { type: null, target: getEventTarget, currentTarget: null, eventPhase: null, bubbles: null, cancelable: null, timeStamp: function(event) { return event.timeStamp || Date.now(); }, defaultPrevented: null, isTrusted: null }; /** * Synthetic events are dispatched by event plugins, typically in response to a * top-level event delegation handler. * * These systems should generally use pooling to reduce the frequency of garbage * collection. The system should check `isPersistent` to determine whether the * event should be released into the pool after being dispatched. Users that * need a persisted event should invoke `persist`. * * Synthetic events (and subclasses) implement the DOM Level 3 Events API by * normalizing browser quirks. Subclasses do not necessarily have to implement a * DOM interface; custom application-specific events can also subclass this. * * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. */ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) { this.dispatchConfig = dispatchConfig; this.dispatchMarker = dispatchMarker; this.nativeEvent = nativeEvent; var Interface = this.constructor.Interface; for (var propName in Interface) { if (!Interface.hasOwnProperty(propName)) { continue; } var normalize = Interface[propName]; if (normalize) { this[propName] = normalize(nativeEvent); } else { this[propName] = nativeEvent[propName]; } } if (nativeEvent.defaultPrevented || nativeEvent.returnValue === false) { this.isDefaultPrevented = emptyFunction.thatReturnsTrue; } else { this.isDefaultPrevented = emptyFunction.thatReturnsFalse; } this.isPropagationStopped = emptyFunction.thatReturnsFalse; } mergeInto(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = true; var event = this.nativeEvent; event.preventDefault ? event.preventDefault() : event.returnValue = false; this.isDefaultPrevented = emptyFunction.thatReturnsTrue; }, stopPropagation: function() { var event = this.nativeEvent; event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true; this.isPropagationStopped = emptyFunction.thatReturnsTrue; }, /** * We release all dispatched `SyntheticEvent`s after each event loop, adding * them back into the pool. This allows a way to hold onto a reference that * won't be added back into the pool. */ persist: function() { this.isPersistent = emptyFunction.thatReturnsTrue; }, /** * Checks if this event should be released back into the pool. * * @return {boolean} True if this should not be released, false otherwise. */ isPersistent: emptyFunction.thatReturnsFalse, /** * `PooledClass` looks for `destructor` on each instance it releases. */ destructor: function() { var Interface = this.constructor.Interface; for (var propName in Interface) { this[propName] = null; } this.dispatchConfig = null; this.dispatchMarker = null; this.nativeEvent = null; } }); SyntheticEvent.Interface = EventInterface; /** * Helper to reduce boilerplate when creating subclasses. * * @param {function} Class * @param {?object} Interface */ SyntheticEvent.augmentClass = function(Class, Interface) { var Super = this; var prototype = Object.create(Super.prototype); mergeInto(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; Class.Interface = merge(Super.Interface, Interface); Class.augmentClass = Super.augmentClass; PooledClass.addPoolingTo(Class, PooledClass.threeArgumentPooler); }; PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler); module.exports = SyntheticEvent; },{"./PooledClass":25,"./emptyFunction":92,"./getEventTarget":100,"./merge":115,"./mergeInto":117}],76:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticFocusEvent * @typechecks static-only */ "use strict"; var SyntheticUIEvent = require("./SyntheticUIEvent"); /** * @interface FocusEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var FocusEventInterface = { relatedTarget: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; },{"./SyntheticUIEvent":80}],77:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticKeyboardEvent * @typechecks static-only */ "use strict"; var SyntheticUIEvent = require("./SyntheticUIEvent"); /** * @interface KeyboardEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var KeyboardEventInterface = { 'char': null, key: null, location: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, repeat: null, locale: null, // Legacy Interface charCode: null, keyCode: null, which: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; },{"./SyntheticUIEvent":80}],78:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticMouseEvent * @typechecks static-only */ "use strict"; var SyntheticUIEvent = require("./SyntheticUIEvent"); var ViewportMetrics = require("./ViewportMetrics"); /** * @interface MouseEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var MouseEventInterface = { screenX: null, screenY: null, clientX: null, clientY: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, button: function(event) { // Webkit, Firefox, IE9+ // which: 1 2 3 // button: 0 1 2 (standard) var button = event.button; if ('which' in event) { return button; } // IE<9 // which: undefined // button: 0 0 0 // button: 1 4 2 (onmouseup) return button === 2 ? 2 : button === 4 ? 1 : 0; }, buttons: null, relatedTarget: function(event) { return event.relatedTarget || ( event.fromElement === event.srcElement ? event.toElement : event.fromElement ); }, // "Proprietary" Interface. pageX: function(event) { return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; }, pageY: function(event) { return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; } }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; },{"./SyntheticUIEvent":80,"./ViewportMetrics":83}],79:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticTouchEvent * @typechecks static-only */ "use strict"; var SyntheticUIEvent = require("./SyntheticUIEvent"); /** * @interface TouchEvent * @see http://www.w3.org/TR/touch-events/ */ var TouchEventInterface = { touches: null, targetTouches: null, changedTouches: null, altKey: null, metaKey: null, ctrlKey: null, shiftKey: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; },{"./SyntheticUIEvent":80}],80:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticUIEvent * @typechecks static-only */ "use strict"; var SyntheticEvent = require("./SyntheticEvent"); /** * @interface UIEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var UIEventInterface = { view: null, detail: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticEvent} */ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; },{"./SyntheticEvent":75}],81:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule SyntheticWheelEvent * @typechecks static-only */ "use strict"; var SyntheticMouseEvent = require("./SyntheticMouseEvent"); /** * @interface WheelEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var WheelEventInterface = { deltaX: function(event) { // NOTE: IE<9 does not support x-axis delta. return ( 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). 'wheelDeltaX' in event ? -event.wheelDeltaX : 0 ); }, deltaY: function(event) { return ( // Normalize (up is positive). 'deltaY' in event ? -event.deltaY : // Fallback to `wheelDeltaY` for Webkit. 'wheelDeltaY' in event ? event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9. 'wheelDelta' in event ? event.wheelData : 0 ); }, deltaZ: null, deltaMode: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticMouseEvent} */ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) { SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); } SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; },{"./SyntheticMouseEvent":78}],82:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule Transaction */ "use strict"; var invariant = require("./invariant"); /** * `Transaction` creates a black box that is able to wrap any method such that * certain invariants are maintained before and after the method is invoked * (Even if an exception is thrown while invoking the wrapped method). Whoever * instantiates a transaction can provide enforcers of the invariants at * creation time. The `Transaction` class itself will supply one additional * automatic invariant for you - the invariant that any transaction instance * should not be ran while it is already being ran. You would typically create a * single instance of a `Transaction` for reuse multiple times, that potentially * is used to wrap several different methods. Wrappers are extremely simple - * they only require implementing two methods. * * <pre> * wrappers (injected at creation time) * + + * | | * +-----------------|--------|--------------+ * | v | | * | +---------------+ | | * | +--| wrapper1 |---|----+ | * | | +---------------+ v | | * | | +-------------+ | | * | | +----| wrapper2 |--------+ | * | | | +-------------+ | | | * | | | | | | * | v v v v | wrapper * | +---+ +---+ +---------+ +---+ +---+ | invariants * perform(anyMethod) | | | | | | | | | | | | maintained * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|--------> * | | | | | | | | | | | | * | | | | | | | | | | | | * | | | | | | | | | | | | * | +---+ +---+ +---------+ +---+ +---+ | * | initialize close | * +-----------------------------------------+ * </pre> * * Bonus: * - Reports timing metrics by method name and wrapper index. * * Use cases: * - Preserving the input selection ranges before/after reconciliation. * Restoring selection even in the event of an unexpected error. * - Deactivating events while rearranging the DOM, preventing blurs/focuses, * while guaranteeing that afterwards, the event system is reactivated. * - Flushing a queue of collected DOM mutations to the main UI thread after a * reconciliation takes place in a worker thread. * - Invoking any collected `componentDidRender` callbacks after rendering new * content. * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue * to preserve the `scrollTop` (an automatic scroll aware DOM). * - (Future use case): Layout calculations before and after DOM upates. * * Transactional plugin API: * - A module that has an `initialize` method that returns any precomputation. * - and a `close` method that accepts the precomputation. `close` is invoked * when the wrapped process is completed, or has failed. * * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules * that implement `initialize` and `close`. * @return {Transaction} Single transaction for reuse in thread. * * @class Transaction */ var Mixin = { /** * Sets up this instance so that it is prepared for collecting metrics. Does * so such that this setup method may be used on an instance that is already * initialized, in a way that does not consume additional memory upon reuse. * That can be useful if you decide to make your subclass of this mixin a * "PooledClass". */ reinitializeTransaction: function() { this.transactionWrappers = this.getTransactionWrappers(); if (!this.wrapperInitData) { this.wrapperInitData = []; } else { this.wrapperInitData.length = 0; } if (!this.timingMetrics) { this.timingMetrics = {}; } this.timingMetrics.methodInvocationTime = 0; if (!this.timingMetrics.wrapperInitTimes) { this.timingMetrics.wrapperInitTimes = []; } else { this.timingMetrics.wrapperInitTimes.length = 0; } if (!this.timingMetrics.wrapperCloseTimes) { this.timingMetrics.wrapperCloseTimes = []; } else { this.timingMetrics.wrapperCloseTimes.length = 0; } this._isInTransaction = false; }, _isInTransaction: false, /** * @abstract * @return {Array<TransactionWrapper>} Array of transaction wrappers. */ getTransactionWrappers: null, isInTransaction: function() { return !!this._isInTransaction; }, /** * Executes the function within a safety window. Use this for the top level * methods that result in large amounts of computation/mutations that would * need to be safety checked. * * @param {function} method Member of scope to call. * @param {Object} scope Scope to invoke from. * @param {Object?=} args... Arguments to pass to the method (optional). * Helps prevent need to bind in many cases. * @return Return value from `method`. */ perform: function(method, scope, a, b, c, d, e, f) { invariant( !this.isInTransaction(), 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.' ); var memberStart = Date.now(); var errorToThrow = null; var ret; try { this.initializeAll(); ret = method.call(scope, a, b, c, d, e, f); } catch (error) { // IE8 requires `catch` in order to use `finally`. errorToThrow = error; } finally { var memberEnd = Date.now(); this.methodInvocationTime += (memberEnd - memberStart); try { this.closeAll(); } catch (closeError) { // If `method` throws, prefer to show that stack trace over any thrown // by invoking `closeAll`. errorToThrow = errorToThrow || closeError; } } if (errorToThrow) { throw errorToThrow; } return ret; }, initializeAll: function() { this._isInTransaction = true; var transactionWrappers = this.transactionWrappers; var wrapperInitTimes = this.timingMetrics.wrapperInitTimes; var errorToThrow = null; for (var i = 0; i < transactionWrappers.length; i++) { var initStart = Date.now(); var wrapper = transactionWrappers[i]; try { this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; } catch (initError) { // Prefer to show the stack trace of the first error. errorToThrow = errorToThrow || initError; this.wrapperInitData[i] = Transaction.OBSERVED_ERROR; } finally { var curInitTime = wrapperInitTimes[i]; var initEnd = Date.now(); wrapperInitTimes[i] = (curInitTime || 0) + (initEnd - initStart); } } if (errorToThrow) { throw errorToThrow; } }, /** * Invokes each of `this.transactionWrappers.close[i]` functions, passing into * them the respective return values of `this.transactionWrappers.init[i]` * (`close`rs that correspond to initializers that failed will not be * invoked). */ closeAll: function() { invariant( this.isInTransaction(), 'Transaction.closeAll(): Cannot close transaction when none are open.' ); var transactionWrappers = this.transactionWrappers; var wrapperCloseTimes = this.timingMetrics.wrapperCloseTimes; var errorToThrow = null; for (var i = 0; i < transactionWrappers.length; i++) { var wrapper = transactionWrappers[i]; var closeStart = Date.now(); var initData = this.wrapperInitData[i]; try { if (initData !== Transaction.OBSERVED_ERROR) { wrapper.close && wrapper.close.call(this, initData); } } catch (closeError) { // Prefer to show the stack trace of the first error. errorToThrow = errorToThrow || closeError; } finally { var closeEnd = Date.now(); var curCloseTime = wrapperCloseTimes[i]; wrapperCloseTimes[i] = (curCloseTime || 0) + (closeEnd - closeStart); } } this.wrapperInitData.length = 0; this._isInTransaction = false; if (errorToThrow) { throw errorToThrow; } } }; var Transaction = { Mixin: Mixin, /** * Token to look for to determine if an error occured. */ OBSERVED_ERROR: {} }; module.exports = Transaction; },{"./invariant":106}],83:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ViewportMetrics */ "use strict"; var ViewportMetrics = { currentScrollLeft: 0, currentScrollTop: 0, refreshScrollValues: function() { ViewportMetrics.currentScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft; ViewportMetrics.currentScrollTop = document.body.scrollTop + document.documentElement.scrollTop; } }; module.exports = ViewportMetrics; },{}],84:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule accumulate */ "use strict"; var invariant = require("./invariant"); /** * Accumulates items that must not be null or undefined. * * This is used to conserve memory by avoiding array allocations. * * @return {*|array<*>} An accumulation of items. */ function accumulate(current, next) { invariant( next != null, 'accumulate(...): Accumulated items must be not be null or undefined.' ); if (current == null) { return next; } else { // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). var currentIsArray = Array.isArray(current); var nextIsArray = Array.isArray(next); if (currentIsArray) { return current.concat(next); } else { if (nextIsArray) { return [current].concat(next); } else { return [current, next]; } } } } module.exports = accumulate; },{"./invariant":106}],85:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule adler32 */ /* jslint bitwise:true */ "use strict"; var MOD = 65521; // This is a clean-room implementation of adler32 designed for detecting // if markup is not what we expect it to be. It does not need to be // cryptographically strong, only reasonable good at detecting if markup // generated on the server is different than that on the client. function adler32(data) { var a = 1; var b = 0; for (var i = 0; i < data.length; i++) { a = (a + data.charCodeAt(i)) % MOD; b = (b + a) % MOD; } return a | (b << 16); } module.exports = adler32; },{}],86:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule copyProperties */ /** * Copy properties from one or more objects (up to 5) into the first object. * This is a shallow copy. It mutates the first object and also returns it. * * NOTE: `arguments` has a very significant performance penalty, which is why * we don't support unlimited arguments. */ function copyProperties(obj, a, b, c, d, e, f) { obj = obj || {}; if (true) { if (f) { throw new Error('Too many arguments passed to copyProperties'); } } var args = [a, b, c, d, e]; var ii = 0, v; while (args[ii]) { v = args[ii++]; for (var k in v) { obj[k] = v[k]; } // IE ignores toString in object iteration.. See: // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html if (v.hasOwnProperty && v.hasOwnProperty('toString') && (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) { obj.toString = v.toString; } } return obj; } module.exports = copyProperties; },{}],87:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule createArrayFrom * @typechecks */ /** * NOTE: if you are a previous user of this function, it has been considered * unsafe because it's inconsistent across browsers for some inputs. * Instead use `Array.isArray()`. * * Perform a heuristic test to determine if an object is "array-like". * * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" * Joshu replied: "Mu." * * This function determines if its argument has "array nature": it returns * true if the argument is an actual array, an `arguments' object, or an * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). * * @param {*} obj * @return {boolean} */ function hasArrayNature(obj) { return ( // not null/false !!obj && // arrays are objects, NodeLists are functions in Safari (typeof obj == 'object' || typeof obj == 'function') && // quacks like an array ('length' in obj) && // not window !('setInterval' in obj) && // no DOM node should be considered an array-like // a 'select' element has 'length' and 'item' properties on IE8 (typeof obj.nodeType != 'number') && ( // a real array (// HTMLCollection/NodeList (Array.isArray(obj) || // arguments ('callee' in obj) || 'item' in obj)) ) ); } /** * Ensure that the argument is an array by wrapping it in an array if it is not. * Creates a copy of the argument if it is already an array. * * This is mostly useful idiomatically: * * var createArrayFrom = require('createArrayFrom'); * * function takesOneOrMoreThings(things) { * things = createArrayFrom(things); * ... * } * * This allows you to treat `things' as an array, but accept scalars in the API. * * This is also good for converting certain pseudo-arrays, like `arguments` or * HTMLCollections, into arrays. * * @param {*} obj * @return {array} */ function createArrayFrom(obj) { if (!hasArrayNature(obj)) { return [obj]; } if (obj.item) { // IE does not support Array#slice on HTMLCollections var l = obj.length, ret = new Array(l); while (l--) { ret[l] = obj[l]; } return ret; } return Array.prototype.slice.call(obj); } module.exports = createArrayFrom; },{}],88:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule createNodesFromMarkup * @typechecks */ /*jslint evil: true, sub: true */ var ExecutionEnvironment = require("./ExecutionEnvironment"); var createArrayFrom = require("./createArrayFrom"); var getMarkupWrap = require("./getMarkupWrap"); var invariant = require("./invariant"); /** * Dummy container used to render all markup. */ var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; /** * Pattern used by `getNodeName`. */ var nodeNamePattern = /^\s*<(\w+)/; /** * Extracts the `nodeName` of the first element in a string of markup. * * @param {string} markup String of markup. * @return {?string} Node name of the supplied markup. */ function getNodeName(markup) { var nodeNameMatch = markup.match(nodeNamePattern); return nodeNameMatch && nodeNameMatch[1].toLowerCase(); } /** * Creates an array containing the nodes rendered from the supplied markup. The * optionally supplied `handleScript` function will be invoked once for each * <script> element that is rendered. If no `handleScript` function is supplied, * an exception is thrown if any <script> elements are rendered. * * @param {string} markup A string of valid HTML markup. * @param {?function} handleScript Invoked once for each rendered <script>. * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes. */ function createNodesFromMarkup(markup, handleScript) { var node = dummyNode; invariant(!!dummyNode, 'createNodesFromMarkup dummy not initialized'); var nodeName = getNodeName(markup); var wrap = nodeName && getMarkupWrap(nodeName); if (wrap) { node.innerHTML = wrap[1] + markup + wrap[2]; var wrapDepth = wrap[0]; while (wrapDepth--) { node = node.lastChild; } } else { node.innerHTML = markup; } var scripts = node.getElementsByTagName('script'); if (scripts.length) { invariant( handleScript, 'createNodesFromMarkup(...): Unexpected <script> element rendered.' ); createArrayFrom(scripts).forEach(handleScript); } var nodes = createArrayFrom(node.childNodes); while (node.lastChild) { node.removeChild(node.lastChild); } return nodes; } module.exports = createNodesFromMarkup; },{"./ExecutionEnvironment":21,"./createArrayFrom":87,"./getMarkupWrap":101,"./invariant":106}],89:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule createObjectFrom */ /** * Construct an object from an array of keys * and optionally specified value or list of values. * * >>> createObjectFrom(['a','b','c']); * {a: true, b: true, c: true} * * >>> createObjectFrom(['a','b','c'], false); * {a: false, b: false, c: false} * * >>> createObjectFrom(['a','b','c'], 'monkey'); * {c:'monkey', b:'monkey' c:'monkey'} * * >>> createObjectFrom(['a','b','c'], [1,2,3]); * {a: 1, b: 2, c: 3} * * >>> createObjectFrom(['women', 'men'], [true, false]); * {women: true, men: false} * * @param Array list of keys * @param mixed optional value or value array. defaults true. * @returns object */ function createObjectFrom(keys, values /* = true */) { if (true) { if (!Array.isArray(keys)) { throw new TypeError('Must pass an array of keys.'); } } var object = {}; var isArray = Array.isArray(values); if (typeof values == 'undefined') { values = true; } for (var ii = keys.length; ii--;) { object[keys[ii]] = isArray ? values[ii] : values; } return object; } module.exports = createObjectFrom; },{}],90:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule cx */ /** * This function is used to mark string literals representing CSS class names * so that they can be transformed statically. This allows for modularization * and minification of CSS class names. * * In static_upstream, this function is actually implemented, but it should * eventually be replaced with something more descriptive, and the transform * that is used in the main stack should be ported for use elsewhere. * * @param string|object className to modularize, or an object of key/values. * In the object case, the values are conditions that * determine if the className keys should be included. * @param [string ...] Variable list of classNames in the string case. * @return string Renderable space-separated CSS className. */ function cx(classNames) { if (typeof classNames == 'object') { return Object.keys(classNames).map(function(className) { return classNames[className] ? className : ''; }).join(' '); } else { return Array.prototype.join.call(arguments, ' '); } } module.exports = cx; },{}],91:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule dangerousStyleValue * @typechecks static-only */ "use strict"; var CSSProperty = require("./CSSProperty"); /** * Convert a value into the proper css writable value. The `styleName` name * name should be logical (no hyphens), as specified * in `CSSProperty.isUnitlessNumber`. * * @param {string} styleName CSS property name such as `topMargin`. * @param {*} value CSS property value such as `10px`. * @return {string} Normalized style value with dimensions applied. */ function dangerousStyleValue(styleName, value) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into // the markup. If you provide unsafe user data here they can inject // arbitrary CSS which may be problematic (I couldn't repro this): // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ // This is not an XSS hole but instead a potential CSS injection issue // which has lead to a greater discussion about how we're going to // trust URLs moving forward. See #2115901 var isEmpty = value == null || typeof value === 'boolean' || value === ''; if (isEmpty) { return ''; } var isNonNumeric = isNaN(value); if (isNonNumeric || value === 0 || CSSProperty.isUnitlessNumber[styleName]) { return '' + value; // cast to string } return value + 'px'; } module.exports = dangerousStyleValue; },{"./CSSProperty":3}],92:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule emptyFunction */ var copyProperties = require("./copyProperties"); function makeEmptyFunction(arg) { return function() { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ function emptyFunction() {} copyProperties(emptyFunction, { thatReturns: makeEmptyFunction, thatReturnsFalse: makeEmptyFunction(false), thatReturnsTrue: makeEmptyFunction(true), thatReturnsNull: makeEmptyFunction(null), thatReturnsThis: function() { return this; }, thatReturnsArgument: function(arg) { return arg; } }); module.exports = emptyFunction; },{"./copyProperties":86}],93:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule escapeTextForBrowser * @typechecks static-only */ "use strict"; var ESCAPE_LOOKUP = { "&": "&amp;", ">": "&gt;", "<": "&lt;", "\"": "&quot;", "'": "&#x27;", "/": "&#x2f;" }; var ESCAPE_REGEX = /[&><"'\/]/g; function escaper(match) { return ESCAPE_LOOKUP[match]; } /** * Escapes text to prevent scripting attacks. * * @param {*} text Text value to escape. * @return {string} An escaped string. */ function escapeTextForBrowser(text) { return ('' + text).replace(ESCAPE_REGEX, escaper); } module.exports = escapeTextForBrowser; },{}],94:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ex * @typechecks * @nostacktrace */ /** * This function transforms error message with arguments into plain text error * message, so that it can be passed to window.onerror without losing anything. * It can then be transformed back by `erx()` function. * * Usage: * throw new Error(ex('Error %s from %s', errorCode, userID)); * * @param {string} errorMessage */ var ex = function(errorMessage/*, arg1, arg2, ...*/) { var args = Array.prototype.slice.call(arguments).map(function(arg) { return String(arg); }); var expectedLength = errorMessage.split('%s').length - 1; if (expectedLength !== args.length - 1) { // something wrong with the formatting string return ex('ex args number mismatch: %s', JSON.stringify(args)); } return ex._prefix + JSON.stringify(args) + ex._suffix; }; ex._prefix = '<![EX['; ex._suffix = ']]>'; module.exports = ex; },{}],95:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule filterAttributes * @typechecks static-only */ /*jslint evil: true */ 'use strict'; /** * Like filter(), but for a DOM nodes attributes. Returns an array of * the filter DOMAttribute objects. Does some perf related this like * caching attributes.length. * * @param {DOMElement} node Node whose attributes you want to filter * @return {array} array of DOM attribute objects. */ function filterAttributes(node, func, context) { var attributes = node.attributes; var numAttributes = attributes.length; var accumulator = []; for (var i = 0; i < numAttributes; i++) { var attr = attributes.item(i); if (func.call(context, attr)) { accumulator.push(attr); } } return accumulator; } module.exports = filterAttributes; },{}],96:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule flattenChildren */ "use strict"; var invariant = require("./invariant"); var traverseAllChildren = require("./traverseAllChildren"); /** * @param {function} traverseContext Context passed through traversal. * @param {?ReactComponent} child React child component. * @param {!string} name String name of key path to child. */ function flattenSingleChildIntoContext(traverseContext, child, name) { // We found a component instance. var result = traverseContext; invariant( !result.hasOwnProperty(name), 'flattenChildren(...): Encountered two children with the same key, `%s`. ' + 'Children keys must be unique.', name ); result[name] = child; } /** * Flattens children that are typically specified as `props.children`. * @return {!object} flattened children keyed by name. */ function flattenChildren(children) { if (children == null) { return children; } var result = {}; traverseAllChildren(children, flattenSingleChildIntoContext, result); return result; } module.exports = flattenChildren; },{"./invariant":106,"./traverseAllChildren":125}],97:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule forEachAccumulated */ "use strict"; /** * @param {array} an "accumulation" of items which is either an Array or * a single item. Useful when paired with the `accumulate` module. This is a * simple utility that allows us to reason about a collection of items, but * handling the case when there is exactly one item (and we do not need to * allocate an array). */ var forEachAccumulated = function(arr, cb, scope) { if (Array.isArray(arr)) { arr.forEach(cb, scope); } else if (arr) { cb.call(scope, arr); } }; module.exports = forEachAccumulated; },{}],98:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ge */ /** * Find a node by ID. Optionally search a sub-tree outside of the document * * Use ge if you're not sure whether or not the element exists. You can test * for existence yourself in your application code. * * If your application code depends on the existence of the element, use $ * instead, which will throw in DEV if the element doesn't exist. */ function ge(arg, root, tag) { return typeof arg != 'string' ? arg : !root ? document.getElementById(arg) : _geFromSubtree(arg, root, tag); } function _geFromSubtree(id, root, tag) { var elem, children, ii; if (_getNodeID(root) == id) { return root; } else if (root.getElementsByTagName) { // All Elements implement this, which does an iterative DFS, which is // faster than recursion and doesn't run into stack depth issues. children = root.getElementsByTagName(tag || '*'); for (ii = 0; ii < children.length; ii++) { if (_getNodeID(children[ii]) == id) { return children[ii]; } } } else { // DocumentFragment does not implement getElementsByTagName, so // recurse over its children. Its children must be Elements, so // each child will use the getElementsByTagName case instead. children = root.childNodes; for (ii = 0; ii < children.length; ii++) { elem = _geFromSubtree(id, children[ii]); if (elem) { return elem; } } } return null; } /** * Return the ID value for a given node. This allows us to avoid issues * with forms that contain inputs with name="id". * * @return string (null if attribute not set) */ function _getNodeID(node) { // #document and #document-fragment do not have getAttributeNode. var id = node.getAttributeNode && node.getAttributeNode('id'); return id ? id.value : null; } module.exports = ge; },{}],99:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getActiveElement * @typechecks */ /** * Same as document.activeElement but wraps in a try-catch block. In IE it is * not safe to call document.activeElement if there is nothing focused. */ function getActiveElement() /*?DOMElement*/ { try { return document.activeElement; } catch (e) { return null; } } module.exports = getActiveElement; },{}],100:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getEventTarget * @typechecks static-only */ "use strict"; /** * Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node. */ function getEventTarget(nativeEvent) { var target = nativeEvent.target || nativeEvent.srcElement || window; // Safari may fire events on text nodes (Node.TEXT_NODE is 3). // @see http://www.quirksmode.org/js/events_properties.html return target.nodeType === 3 ? target.parentNode : target; } module.exports = getEventTarget; },{}],101:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getMarkupWrap */ var ExecutionEnvironment = require("./ExecutionEnvironment"); var invariant = require("./invariant"); /** * Dummy container used to detect which wraps are necessary. */ var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; /** * Some browsers cannot use `innerHTML` to render certain elements standalone, * so we wrap them, render the wrapped nodes, then extract the desired node. * * In IE8, certain elements cannot render alone, so wrap all elements ('*'). */ var shouldWrap = { // Force wrapping for SVG elements because if they get created inside a <div>, // they will be initialized in the wrong namespace (and will not display). 'circle': true, 'g': true, 'line': true, 'path': true, 'polyline': true, 'rect': true, 'text': true }; var selectWrap = [1, '<select multiple="true">', '</select>']; var tableWrap = [1, '<table>', '</table>']; var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>']; var svgWrap = [1, '<svg>', '</svg>']; var markupWrap = { '*': [1, '?<div>', '</div>'], 'area': [1, '<map>', '</map>'], 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'], 'legend': [1, '<fieldset>', '</fieldset>'], 'param': [1, '<object>', '</object>'], 'tr': [2, '<table><tbody>', '</tbody></table>'], 'optgroup': selectWrap, 'option': selectWrap, 'caption': tableWrap, 'colgroup': tableWrap, 'tbody': tableWrap, 'tfoot': tableWrap, 'thead': tableWrap, 'td': trWrap, 'th': trWrap, 'circle': svgWrap, 'g': svgWrap, 'line': svgWrap, 'path': svgWrap, 'polyline': svgWrap, 'rect': svgWrap, 'text': svgWrap }; /** * Gets the markup wrap configuration for the supplied `nodeName`. * * NOTE: This lazily detects which wraps are necessary for the current browser. * * @param {string} nodeName Lowercase `nodeName`. * @return {?array} Markup wrap configuration, if applicable. */ function getMarkupWrap(nodeName) { invariant(!!dummyNode, 'Markup wrapping node not initialized'); if (!markupWrap.hasOwnProperty(nodeName)) { nodeName = '*'; } if (!shouldWrap.hasOwnProperty(nodeName)) { if (nodeName === '*') { dummyNode.innerHTML = '<link />'; } else { dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>'; } shouldWrap[nodeName] = !dummyNode.firstChild; } return shouldWrap[nodeName] ? markupWrap[nodeName] : null; } module.exports = getMarkupWrap; },{"./ExecutionEnvironment":21,"./invariant":106}],102:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getNodeForCharacterOffset */ "use strict"; /** * Given any node return the first leaf node without children. * * @param {DOMElement|DOMTextNode} node * @return {DOMElement|DOMTextNode} */ function getLeafNode(node) { while (node && node.firstChild) { node = node.firstChild; } return node; } /** * Get the next sibling within a container. This will walk up the * DOM if a node's siblings have been exhausted. * * @param {DOMElement|DOMTextNode} node * @return {?DOMElement|DOMTextNode} */ function getSiblingNode(node) { while (node) { if (node.nextSibling) { return node.nextSibling; } node = node.parentNode; } } /** * Get object describing the nodes which contain characters at offset. * * @param {DOMElement|DOMTextNode} root * @param {number} offset * @return {?object} */ function getNodeForCharacterOffset(root, offset) { var node = getLeafNode(root); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType == 3) { nodeEnd = nodeStart + node.textContent.length; if (nodeStart <= offset && nodeEnd >= offset) { return { node: node, offset: offset - nodeStart }; } nodeStart = nodeEnd; } node = getLeafNode(getSiblingNode(node)); } } module.exports = getNodeForCharacterOffset; },{}],103:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getReactRootElementInContainer */ "use strict"; var DOC_NODE_TYPE = 9; /** * @param {DOMElement|DOMDocument} container DOM element that may contain * a React component * @return {?*} DOM element that may have the reactRoot ID, or null. */ function getReactRootElementInContainer(container) { if (!container) { return null; } if (container.nodeType === DOC_NODE_TYPE) { return container.documentElement; } else { return container.firstChild; } } module.exports = getReactRootElementInContainer; },{}],104:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule getTextContentAccessor */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); var contentKey = null; /** * Gets the key used to access text content on a DOM node. * * @return {?string} Key used to access text content. * @internal */ function getTextContentAccessor() { if (!contentKey && ExecutionEnvironment.canUseDOM) { contentKey = 'innerText' in document.createElement('div') ? 'innerText' : 'textContent'; } return contentKey; } module.exports = getTextContentAccessor; },{"./ExecutionEnvironment":21}],105:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule hyphenate * @typechecks */ var _uppercasePattern = /([A-Z])/g; /** * Hyphenates a camelcased string, for example: * * > hyphenate('backgroundColor') * < "background-color" * * @param {string} string * @return {string} */ function hyphenate(string) { return string.replace(_uppercasePattern, '-$1').toLowerCase(); } module.exports = hyphenate; },{}],106:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule invariant */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf style format and arguments to provide information about * what broke and what you were expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ function invariant(condition) { if (!condition) { throw new Error('Invariant Violation'); } } module.exports = invariant; if (true) { var invariantDev = function(condition, format, a, b, c, d, e, f) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } if (!condition) { var args = [a, b, c, d, e, f]; var argIndex = 0; throw new Error( 'Invariant Violation: ' + format.replace(/%s/g, function() { return args[argIndex++]; }) ); } }; module.exports = invariantDev; } },{}],107:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule isEventSupported */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); var testNode, useHasFeature; if (ExecutionEnvironment.canUseDOM) { testNode = document.createElement('div'); useHasFeature = document.implementation && document.implementation.hasFeature && // `hasFeature` always returns true in Firefox 19+. document.implementation.hasFeature('', '') !== true; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix, capture) { if (!testNode || (capture && !testNode.addEventListener)) { return false; } var element = document.createElement('div'); var eventName = 'on' + eventNameSuffix; var isSupported = eventName in element; if (!isSupported) { element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; if (typeof element[eventName] !== 'undefined') { element[eventName] = undefined; } element.removeAttribute(eventName); } if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { // This is the only way to test support for the `wheel` event in IE9+. isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); } element = null; return isSupported; } module.exports = isEventSupported; },{"./ExecutionEnvironment":21}],108:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule isNode * @typechecks */ /** * @param {*} object The object to check. * @return {boolean} Whether or not the object is a DOM node. */ function isNode(object) { return !!(object && ( typeof Node !== 'undefined' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string' )); } module.exports = isNode; },{}],109:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule isTextInputElement */ "use strict"; /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ var supportedInputTypes = { 'color': true, 'date': true, 'datetime': true, 'datetime-local': true, 'email': true, 'month': true, 'number': true, 'password': true, 'range': true, 'search': true, 'tel': true, 'text': true, 'time': true, 'url': true, 'week': true }; function isTextInputElement(elem) { return elem && ( (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]) || elem.nodeName === 'TEXTAREA' ); } module.exports = isTextInputElement; },{}],110:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule isTextNode * @typechecks */ var isNode = require("./isNode"); /** * @param {*} object The object to check. * @return {boolean} Whether or not the object is a DOM text node. */ function isTextNode(object) { return isNode(object) && object.nodeType == 3; } module.exports = isTextNode; },{"./isNode":108}],111:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule joinClasses * @typechecks static-only */ "use strict"; /** * Combines multiple className strings into one. * http://jsperf.com/joinclasses-args-vs-array * * @param {...?string} classes * @return {string} */ function joinClasses(className/*, ... */) { if (!className) { className = ''; } var nextClass; var argLength = arguments.length; if (argLength > 1) { for (var ii = 1; ii < argLength; ii++) { nextClass = arguments[ii]; nextClass && (className += ' ' + nextClass); } } return className; } module.exports = joinClasses; },{}],112:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule keyMirror * @typechecks static-only */ "use strict"; var invariant = require("./invariant"); /** * Constructs an enumeration with keys equal to their value. * * For example: * * var COLORS = keyMirror({blue: null, red: null}); * var myColor = COLORS.blue; * var isColorValid = !!COLORS[myColor]; * * The last line could not be performed if the values of the generated enum were * not equal to their keys. * * Input: {key1: val1, key2: val2} * Output: {key1: key1, key2: key2} * * @param {object} obj * @return {object} */ var keyMirror = function(obj) { var ret = {}; var key; invariant( obj instanceof Object && !Array.isArray(obj), 'keyMirror(...): Argument must be an object.' ); for (key in obj) { if (!obj.hasOwnProperty(key)) { continue; } ret[key] = key; } return ret; }; module.exports = keyMirror; },{"./invariant":106}],113:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule keyOf */ /** * Allows extraction of a minified key. Let's the build system minify keys * without loosing the ability to dynamically use key strings as values * themselves. Pass in an object with a single key/val pair and it will return * you the string key of that single record. Suppose you want to grab the * value for a key 'className' inside of an object. Key/val minification may * have aliased that key to be 'xa12'. keyOf({className: null}) will return * 'xa12' in that case. Resolve keys you want to use once at startup time, then * reuse those resolutions. */ var keyOf = function(oneKeyObj) { var key; for (key in oneKeyObj) { if (!oneKeyObj.hasOwnProperty(key)) { continue; } return key; } return null; }; module.exports = keyOf; },{}],114:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule memoizeStringOnly * @typechecks static-only */ "use strict"; /** * Memoizes the return value of a function that accepts one string argument. * * @param {function} callback * @return {function} */ function memoizeStringOnly(callback) { var cache = {}; return function(string) { if (cache.hasOwnProperty(string)) { return cache[string]; } else { return cache[string] = callback.call(this, string); } }; } module.exports = memoizeStringOnly; },{}],115:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule merge */ "use strict"; var mergeInto = require("./mergeInto"); /** * Shallow merges two structures into a return value, without mutating either. * * @param {?object} one Optional object with properties to merge from. * @param {?object} two Optional object with properties to merge from. * @return {object} The shallow extension of one by two. */ var merge = function(one, two) { var result = {}; mergeInto(result, one); mergeInto(result, two); return result; }; module.exports = merge; },{"./mergeInto":117}],116:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule mergeHelpers * * requiresPolyfills: Array.isArray */ "use strict"; var invariant = require("./invariant"); var keyMirror = require("./keyMirror"); /** * Maximum number of levels to traverse. Will catch circular structures. * @const */ var MAX_MERGE_DEPTH = 36; /** * We won't worry about edge cases like new String('x') or new Boolean(true). * Functions are considered terminals, and arrays are not. * @param {*} o The item/object/value to test. * @return {boolean} true iff the argument is a terminal. */ var isTerminal = function(o) { return typeof o !== 'object' || o === null; }; var mergeHelpers = { MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, isTerminal: isTerminal, /** * Converts null/undefined values into empty object. * * @param {?Object=} arg Argument to be normalized (nullable optional) * @return {!Object} */ normalizeMergeArg: function(arg) { return arg === undefined || arg === null ? {} : arg; }, /** * If merging Arrays, a merge strategy *must* be supplied. If not, it is * likely the caller's fault. If this function is ever called with anything * but `one` and `two` being `Array`s, it is the fault of the merge utilities. * * @param {*} one Array to merge into. * @param {*} two Array to merge from. */ checkMergeArrayArgs: function(one, two) { invariant( Array.isArray(one) && Array.isArray(two), 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' ); }, /** * @param {*} one Object to merge into. * @param {*} two Object to merge from. */ checkMergeObjectArgs: function(one, two) { mergeHelpers.checkMergeObjectArg(one); mergeHelpers.checkMergeObjectArg(two); }, /** * @param {*} arg */ checkMergeObjectArg: function(arg) { invariant( !isTerminal(arg) && !Array.isArray(arg), 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' ); }, /** * Checks that a merge was not given a circular object or an object that had * too great of depth. * * @param {number} Level of recursion to validate against maximum. */ checkMergeLevel: function(level) { invariant( level < MAX_MERGE_DEPTH, 'Maximum deep merge depth exceeded. You may be attempting to merge ' + 'circular structures in an unsupported way.' ); }, /** * Checks that the supplied merge strategy is valid. * * @param {string} Array merge strategy. */ checkArrayStrategy: function(strategy) { invariant( strategy === undefined || strategy in mergeHelpers.ArrayStrategies, 'You must provide an array strategy to deep merge functions to ' + 'instruct the deep merge how to resolve merging two arrays.' ); }, /** * Set of possible behaviors of merge algorithms when encountering two Arrays * that must be merged together. * - `clobber`: The left `Array` is ignored. * - `indexByIndex`: The result is achieved by recursively deep merging at * each index. (not yet supported.) */ ArrayStrategies: keyMirror({ Clobber: true, IndexByIndex: true }) }; module.exports = mergeHelpers; },{"./invariant":106,"./keyMirror":112}],117:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule mergeInto * @typechecks static-only */ "use strict"; var mergeHelpers = require("./mergeHelpers"); var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; /** * Shallow merges two structures by mutating the first parameter. * * @param {object} one Object to be merged into. * @param {?object} two Optional object with properties to merge from. */ function mergeInto(one, two) { checkMergeObjectArg(one); if (two != null) { checkMergeObjectArg(two); for (var key in two) { if (!two.hasOwnProperty(key)) { continue; } one[key] = two[key]; } } } module.exports = mergeInto; },{"./mergeHelpers":116}],118:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule mixInto */ "use strict"; /** * Simply copies properties to the prototype. */ var mixInto = function(constructor, methodBag) { var methodName; for (methodName in methodBag) { if (!methodBag.hasOwnProperty(methodName)) { continue; } constructor.prototype[methodName] = methodBag[methodName]; } }; module.exports = mixInto; },{}],119:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule mutateHTMLNodeWithMarkup * @typechecks static-only */ /*jslint evil: true */ 'use strict'; var createNodesFromMarkup = require("./createNodesFromMarkup"); var filterAttributes = require("./filterAttributes"); var invariant = require("./invariant"); /** * You can't set the innerHTML of a document. Unless you have * this function. * * @param {DOMElement} node with tagName == 'html' * @param {string} markup markup string including <html>. */ function mutateHTMLNodeWithMarkup(node, markup) { invariant( node.tagName.toLowerCase() === 'html', 'mutateHTMLNodeWithMarkup(): node must have tagName of "html", got %s', node.tagName ); markup = markup.trim(); invariant( markup.toLowerCase().indexOf('<html') === 0, 'mutateHTMLNodeWithMarkup(): markup must start with <html' ); // First let's extract the various pieces of markup. var htmlOpenTagEnd = markup.indexOf('>') + 1; var htmlCloseTagStart = markup.lastIndexOf('<'); var htmlOpenTag = markup.substring(0, htmlOpenTagEnd); var innerHTML = markup.substring(htmlOpenTagEnd, htmlCloseTagStart); // Now for the fun stuff. Pass through both sets of attributes and // bring them up-to-date. We get the new set by creating a markup // fragment. var shouldExtractAttributes = htmlOpenTag.indexOf(' ') > -1; var attributeHolder = null; if (shouldExtractAttributes) { // We extract the attributes by creating a <span> and evaluating // the node. attributeHolder = createNodesFromMarkup( htmlOpenTag.replace('html ', 'span ') + '</span>' )[0]; // Add all attributes present in attributeHolder var attributesToSet = filterAttributes( attributeHolder, function(attr) { return node.getAttributeNS(attr.namespaceURI, attr.name) !== attr.value; } ); attributesToSet.forEach(function(attr) { node.setAttributeNS(attr.namespaceURI, attr.name, attr.value); }); } // Remove all attributes not present in attributeHolder var attributesToRemove = filterAttributes( node, function(attr) { // Remove all attributes if attributeHolder is null or if it does not have // the desired attribute. return !( attributeHolder && attributeHolder.hasAttributeNS(attr.namespaceURI, attr.name) ); } ); attributesToRemove.forEach(function(attr) { node.removeAttributeNS(attr.namespaceURI, attr.name); }); // Finally, set the inner HTML. No tricks needed. Do this last to // minimize likelihood of triggering reflows. node.innerHTML = innerHTML; } module.exports = mutateHTMLNodeWithMarkup; },{"./createNodesFromMarkup":88,"./filterAttributes":95,"./invariant":106}],120:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule nodeContains * @typechecks */ var isTextNode = require("./isTextNode"); /*jslint bitwise:true */ /** * Checks if a given DOM node contains or is another DOM node. * * @param {?DOMNode} outerNode Outer DOM node. * @param {?DOMNode} innerNode Inner DOM node. * @return {boolean} True if `outerNode` contains or is `innerNode`. */ function nodeContains(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return nodeContains(outerNode, innerNode.parentNode); } else if (outerNode.contains) { return outerNode.contains(innerNode); } else if (outerNode.compareDocumentPosition) { return !!(outerNode.compareDocumentPosition(innerNode) & 16); } else { return false; } } module.exports = nodeContains; },{"./isTextNode":110}],121:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule objMap */ "use strict"; /** * For each key/value pair, invokes callback func and constructs a resulting * object which contains, for every key in obj, values that are the result of * of invoking the function: * * func(value, key, iteration) * * @param {?object} obj Object to map keys over * @param {function} func Invoked for each key/val pair. * @param {?*} context * @return {?object} Result of mapping or null if obj is falsey */ function objMap(obj, func, context) { if (!obj) { return null; } var i = 0; var ret = {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { ret[key] = func.call(context, obj[key], key, i++); } } return ret; } module.exports = objMap; },{}],122:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule objMapKeyVal */ "use strict"; /** * Behaves the same as `objMap` but invokes func with the key first, and value * second. Use `objMap` unless you need this special case. * Invokes func as: * * func(key, value, iteration) * * @param {?object} obj Object to map keys over * @param {!function} func Invoked for each key/val pair. * @param {?*} context * @return {?object} Result of mapping or null if obj is falsey */ function objMapKeyVal(obj, func, context) { if (!obj) { return null; } var i = 0; var ret = {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { ret[key] = func.call(context, key, obj[key], i++); } } return ret; } module.exports = objMapKeyVal; },{}],123:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule performanceNow * @typechecks static-only */ "use strict"; var ExecutionEnvironment = require("./ExecutionEnvironment"); /** * Detect if we can use window.performance.now() and gracefully * fallback to Date.now() if it doesn't exist. * We need to support Firefox < 15 for now due to Facebook's webdriver * infrastructure. */ var performance = null; if (ExecutionEnvironment.canUseDOM) { performance = window.performance || window.webkitPerformance; } if (!performance || !performance.now) { performance = Date; } var performanceNow = performance.now.bind(performance); module.exports = performanceNow; },{"./ExecutionEnvironment":21}],124:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule shallowEqual */ "use strict"; /** * Performs equality by iterating through keys on an object and returning * false when any key has values which are not strictly equal between * objA and objB. Returns true when the values of all keys are strictly equal. * * @return {boolean} */ function shallowEqual(objA, objB) { if (objA === objB) { return true; } var key; // Test for A's keys different from B. for (key in objA) { if (objA.hasOwnProperty(key) && (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) { return false; } } // Test for B'a keys missing from A. for (key in objB) { if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) { return false; } } return true; } module.exports = shallowEqual; },{}],125:[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule traverseAllChildren */ "use strict"; var ReactComponent = require("./ReactComponent"); var ReactTextComponent = require("./ReactTextComponent"); var invariant = require("./invariant"); /** * TODO: Test that: * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`. * 2. it('should fail when supplied duplicate key', function() { * 3. That a single child and an array with one item have the same key pattern. * }); */ /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. * @param {!number} indexSoFar Number of children encountered until this point. * @param {!function} callback Callback to invoke with each child found. * @param {?*} traverseContext Used to pass information throughout the traversal * process. * @return {!number} The number of children in this subtree. */ var traverseAllChildrenImpl = function(children, nameSoFar, indexSoFar, callback, traverseContext) { var subtreeCount = 0; // Count of children found in the current subtree. if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { var child = children[i]; var nextName = nameSoFar + ReactComponent.getKey(child, i); var nextIndex = indexSoFar + subtreeCount; subtreeCount += traverseAllChildrenImpl( child, nextName, nextIndex, callback, traverseContext ); } } else { var type = typeof children; var isOnlyChild = nameSoFar === ''; // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows var storageName = isOnlyChild ? ReactComponent.getKey(children, 0): nameSoFar; if (children === null || children === undefined || type === 'boolean') { // All of the above are perceived as null. callback(traverseContext, null, storageName, indexSoFar); subtreeCount = 1; } else if (children.mountComponentIntoNode) { callback(traverseContext, children, storageName, indexSoFar); subtreeCount = 1; } else { if (type === 'object') { invariant( !children || children.nodeType !== 1, 'traverseAllChildren(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.' ); for (var key in children) { if (children.hasOwnProperty(key)) { subtreeCount += traverseAllChildrenImpl( children[key], nameSoFar + '{' + key + '}', indexSoFar + subtreeCount, callback, traverseContext ); } } } else if (type === 'string') { var normalizedText = new ReactTextComponent(children); callback(traverseContext, normalizedText, storageName, indexSoFar); subtreeCount += 1; } else if (type === 'number') { var normalizedNumber = new ReactTextComponent('' + children); callback(traverseContext, normalizedNumber, storageName, indexSoFar); subtreeCount += 1; } } } return subtreeCount; }; /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: * * - `traverseAllChildren(this.props.children, ...)` * - `traverseAllChildren(this.props.leftPanelChildren, ...)` * * The `traverseContext` is an optional argument that is passed through the * entire traversal. It can be used to store accumulations or anything else that * the callback might find relevant. * * @param {?*} children Children tree object. * @param {!function} callback To invoke upon traversing each child. * @param {?*} traverseContext Context for traversal. */ function traverseAllChildren(children, callback, traverseContext) { if (children !== null && children !== undefined) { traverseAllChildrenImpl(children, '', 0, callback, traverseContext); } } module.exports = traverseAllChildren; },{"./ReactComponent":28,"./ReactTextComponent":64,"./invariant":106}]},{},[70]) (70) }); ;
ajax/libs/angular.js/0.9.6/angular-scenario.min.js
Assalaam/cdnjs
/*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(aM,C){var a=function(aY,aZ){return new a.fn.init(aY,aZ)},n=aM.jQuery,R=aM.$,ab=aM.document,X,P=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,aW=/^.[^:#\[\.,]*$/,ax=/\S/,M=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,e=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,b=navigator.userAgent,u,K=false,ad=[],aG,at=Object.prototype.toString,ap=Object.prototype.hasOwnProperty,g=Array.prototype.push,F=Array.prototype.slice,s=Array.prototype.indexOf;a.fn=a.prototype={init:function(aY,a1){var a0,a2,aZ,a3;if(!aY){return this}if(aY.nodeType){this.context=this[0]=aY;this.length=1;return this}if(aY==="body"&&!a1){this.context=ab;this[0]=ab.body;this.selector="body";this.length=1;return this}if(typeof aY==="string"){a0=P.exec(aY);if(a0&&(a0[1]||!a1)){if(a0[1]){a3=(a1?a1.ownerDocument||a1:ab);aZ=e.exec(aY);if(aZ){if(a.isPlainObject(a1)){aY=[ab.createElement(aZ[1])];a.fn.attr.call(aY,a1,true)}else{aY=[a3.createElement(aZ[1])]}}else{aZ=J([a0[1]],[a3]);aY=(aZ.cacheable?aZ.fragment.cloneNode(true):aZ.fragment).childNodes}return a.merge(this,aY)}else{a2=ab.getElementById(a0[2]);if(a2){if(a2.id!==a0[2]){return X.find(aY)}this.length=1;this[0]=a2}this.context=ab;this.selector=aY;return this}}else{if(!a1&&/^\w+$/.test(aY)){this.selector=aY;this.context=ab;aY=ab.getElementsByTagName(aY);return a.merge(this,aY)}else{if(!a1||a1.jquery){return(a1||X).find(aY)}else{return a(a1).find(aY)}}}}else{if(a.isFunction(aY)){return X.ready(aY)}}if(aY.selector!==C){this.selector=aY.selector;this.context=aY.context}return a.makeArray(aY,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(aY){return aY==null?this.toArray():(aY<0?this.slice(aY)[0]:this[aY])},pushStack:function(aZ,a1,aY){var a0=a();if(a.isArray(aZ)){g.apply(a0,aZ)}else{a.merge(a0,aZ)}a0.prevObject=this;a0.context=this.context;if(a1==="find"){a0.selector=this.selector+(this.selector?" ":"")+aY}else{if(a1){a0.selector=this.selector+"."+a1+"("+aY+")"}}return a0},each:function(aZ,aY){return a.each(this,aZ,aY)},ready:function(aY){a.bindReady();if(a.isReady){aY.call(ab,a)}else{if(ad){ad.push(aY)}}return this},eq:function(aY){return aY===-1?this.slice(aY):this.slice(aY,+aY+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(aY){return this.pushStack(a.map(this,function(a0,aZ){return aY.call(a0,aZ,a0)}))},end:function(){return this.prevObject||a(null)},push:g,sort:[].sort,splice:[].splice};a.fn.init.prototype=a.fn;a.extend=a.fn.extend=function(){var a3=arguments[0]||{},a2=1,a1=arguments.length,a5=false,a6,a0,aY,aZ;if(typeof a3==="boolean"){a5=a3;a3=arguments[1]||{};a2=2}if(typeof a3!=="object"&&!a.isFunction(a3)){a3={}}if(a1===a2){a3=this;--a2}for(;a2<a1;a2++){if((a6=arguments[a2])!=null){for(a0 in a6){aY=a3[a0];aZ=a6[a0];if(a3===aZ){continue}if(a5&&aZ&&(a.isPlainObject(aZ)||a.isArray(aZ))){var a4=aY&&(a.isPlainObject(aY)||a.isArray(aY))?aY:a.isArray(aZ)?[]:{};a3[a0]=a.extend(a5,a4,aZ)}else{if(aZ!==C){a3[a0]=aZ}}}}}return a3};a.extend({noConflict:function(aY){aM.$=R;if(aY){aM.jQuery=n}return a},isReady:false,ready:function(){if(!a.isReady){if(!ab.body){return setTimeout(a.ready,13)}a.isReady=true;if(ad){var aZ,aY=0;while((aZ=ad[aY++])){aZ.call(ab,a)}ad=null}if(a.fn.triggerHandler){a(ab).triggerHandler("ready")}}},bindReady:function(){if(K){return}K=true;if(ab.readyState==="complete"){return a.ready()}if(ab.addEventListener){ab.addEventListener("DOMContentLoaded",aG,false);aM.addEventListener("load",a.ready,false)}else{if(ab.attachEvent){ab.attachEvent("onreadystatechange",aG);aM.attachEvent("onload",a.ready);var aY=false;try{aY=aM.frameElement==null}catch(aZ){}if(ab.documentElement.doScroll&&aY){x()}}}},isFunction:function(aY){return at.call(aY)==="[object Function]"},isArray:function(aY){return at.call(aY)==="[object Array]"},isPlainObject:function(aZ){if(!aZ||at.call(aZ)!=="[object Object]"||aZ.nodeType||aZ.setInterval){return false}if(aZ.constructor&&!ap.call(aZ,"constructor")&&!ap.call(aZ.constructor.prototype,"isPrototypeOf")){return false}var aY;for(aY in aZ){}return aY===C||ap.call(aZ,aY)},isEmptyObject:function(aZ){for(var aY in aZ){return false}return true},error:function(aY){throw aY},parseJSON:function(aY){if(typeof aY!=="string"||!aY){return null}aY=a.trim(aY);if(/^[\],:{}\s]*$/.test(aY.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return aM.JSON&&aM.JSON.parse?aM.JSON.parse(aY):(new Function("return "+aY))()}else{a.error("Invalid JSON: "+aY)}},noop:function(){},globalEval:function(a0){if(a0&&ax.test(a0)){var aZ=ab.getElementsByTagName("head")[0]||ab.documentElement,aY=ab.createElement("script");aY.type="text/javascript";if(a.support.scriptEval){aY.appendChild(ab.createTextNode(a0))}else{aY.text=a0}aZ.insertBefore(aY,aZ.firstChild);aZ.removeChild(aY)}},nodeName:function(aZ,aY){return aZ.nodeName&&aZ.nodeName.toUpperCase()===aY.toUpperCase()},each:function(a1,a5,a0){var aZ,a2=0,a3=a1.length,aY=a3===C||a.isFunction(a1);if(a0){if(aY){for(aZ in a1){if(a5.apply(a1[aZ],a0)===false){break}}}else{for(;a2<a3;){if(a5.apply(a1[a2++],a0)===false){break}}}}else{if(aY){for(aZ in a1){if(a5.call(a1[aZ],aZ,a1[aZ])===false){break}}}else{for(var a4=a1[0];a2<a3&&a5.call(a4,a2,a4)!==false;a4=a1[++a2]){}}}return a1},trim:function(aY){return(aY||"").replace(M,"")},makeArray:function(a0,aZ){var aY=aZ||[];if(a0!=null){if(a0.length==null||typeof a0==="string"||a.isFunction(a0)||(typeof a0!=="function"&&a0.setInterval)){g.call(aY,a0)}else{a.merge(aY,a0)}}return aY},inArray:function(a0,a1){if(a1.indexOf){return a1.indexOf(a0)}for(var aY=0,aZ=a1.length;aY<aZ;aY++){if(a1[aY]===a0){return aY}}return -1},merge:function(a2,a0){var a1=a2.length,aZ=0;if(typeof a0.length==="number"){for(var aY=a0.length;aZ<aY;aZ++){a2[a1++]=a0[aZ]}}else{while(a0[aZ]!==C){a2[a1++]=a0[aZ++]}}a2.length=a1;return a2},grep:function(aZ,a3,aY){var a0=[];for(var a1=0,a2=aZ.length;a1<a2;a1++){if(!aY!==!a3(aZ[a1],a1)){a0.push(aZ[a1])}}return a0},map:function(aZ,a4,aY){var a0=[],a3;for(var a1=0,a2=aZ.length;a1<a2;a1++){a3=a4(aZ[a1],a1,aY);if(a3!=null){a0[a0.length]=a3}}return a0.concat.apply([],a0)},guid:1,proxy:function(a0,aZ,aY){if(arguments.length===2){if(typeof aZ==="string"){aY=a0;a0=aY[aZ];aZ=C}else{if(aZ&&!a.isFunction(aZ)){aY=aZ;aZ=C}}}if(!aZ&&a0){aZ=function(){return a0.apply(aY||this,arguments)}}if(a0){aZ.guid=a0.guid=a0.guid||aZ.guid||a.guid++}return aZ},uaMatch:function(aZ){aZ=aZ.toLowerCase();var aY=/(webkit)[ \/]([\w.]+)/.exec(aZ)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(aZ)||/(msie) ([\w.]+)/.exec(aZ)||!/compatible/.test(aZ)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(aZ)||[];return{browser:aY[1]||"",version:aY[2]||"0"}},browser:{}});u=a.uaMatch(b);if(u.browser){a.browser[u.browser]=true;a.browser.version=u.version}if(a.browser.webkit){a.browser.safari=true}if(s){a.inArray=function(aY,aZ){return s.call(aZ,aY)}}X=a(ab);if(ab.addEventListener){aG=function(){ab.removeEventListener("DOMContentLoaded",aG,false);a.ready()}}else{if(ab.attachEvent){aG=function(){if(ab.readyState==="complete"){ab.detachEvent("onreadystatechange",aG);a.ready()}}}}function x(){if(a.isReady){return}try{ab.documentElement.doScroll("left")}catch(aY){setTimeout(x,1);return}a.ready()}function aV(aY,aZ){if(aZ.src){a.ajax({url:aZ.src,async:false,dataType:"script"})}else{a.globalEval(aZ.text||aZ.textContent||aZ.innerHTML||"")}if(aZ.parentNode){aZ.parentNode.removeChild(aZ)}}function an(aY,a6,a4,a0,a3,a5){var aZ=aY.length;if(typeof a6==="object"){for(var a1 in a6){an(aY,a1,a6[a1],a0,a3,a4)}return aY}if(a4!==C){a0=!a5&&a0&&a.isFunction(a4);for(var a2=0;a2<aZ;a2++){a3(aY[a2],a6,a0?a4.call(aY[a2],a2,a3(aY[a2],a6)):a4,a5)}return aY}return aZ?a3(aY[0],a6):C}function aP(){return(new Date).getTime()}(function(){a.support={};var a4=ab.documentElement,a3=ab.createElement("script"),aY=ab.createElement("div"),aZ="script"+aP();aY.style.display="none";aY.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var a6=aY.getElementsByTagName("*"),a5=aY.getElementsByTagName("a")[0];if(!a6||!a6.length||!a5){return}a.support={leadingWhitespace:aY.firstChild.nodeType===3,tbody:!aY.getElementsByTagName("tbody").length,htmlSerialize:!!aY.getElementsByTagName("link").length,style:/red/.test(a5.getAttribute("style")),hrefNormalized:a5.getAttribute("href")==="/a",opacity:/^0.55$/.test(a5.style.opacity),cssFloat:!!a5.style.cssFloat,checkOn:aY.getElementsByTagName("input")[0].value==="on",optSelected:ab.createElement("select").appendChild(ab.createElement("option")).selected,parentNode:aY.removeChild(aY.appendChild(ab.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};a3.type="text/javascript";try{a3.appendChild(ab.createTextNode("window."+aZ+"=1;"))}catch(a1){}a4.insertBefore(a3,a4.firstChild);if(aM[aZ]){a.support.scriptEval=true;delete aM[aZ]}try{delete a3.test}catch(a1){a.support.deleteExpando=false}a4.removeChild(a3);if(aY.attachEvent&&aY.fireEvent){aY.attachEvent("onclick",function a7(){a.support.noCloneEvent=false;aY.detachEvent("onclick",a7)});aY.cloneNode(true).fireEvent("onclick")}aY=ab.createElement("div");aY.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var a0=ab.createDocumentFragment();a0.appendChild(aY.firstChild);a.support.checkClone=a0.cloneNode(true).cloneNode(true).lastChild.checked;a(function(){var a8=ab.createElement("div");a8.style.width=a8.style.paddingLeft="1px";ab.body.appendChild(a8);a.boxModel=a.support.boxModel=a8.offsetWidth===2;ab.body.removeChild(a8).style.display="none";a8=null});var a2=function(a8){var ba=ab.createElement("div");a8="on"+a8;var a9=(a8 in ba);if(!a9){ba.setAttribute(a8,"return;");a9=typeof ba[a8]==="function"}ba=null;return a9};a.support.submitBubbles=a2("submit");a.support.changeBubbles=a2("change");a4=a3=aY=a6=a5=null})();a.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aI="jQuery"+aP(),aH=0,aT={};a.extend({cache:{},expando:aI,noData:{embed:true,object:true,applet:true},data:function(a0,aZ,a2){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a3=a0[aI],aY=a.cache,a1;if(!a3&&typeof aZ==="string"&&a2===C){return null}if(!a3){a3=++aH}if(typeof aZ==="object"){a0[aI]=a3;a1=aY[a3]=a.extend(true,{},aZ)}else{if(!aY[a3]){a0[aI]=a3;aY[a3]={}}}a1=aY[a3];if(a2!==C){a1[aZ]=a2}return typeof aZ==="string"?a1[aZ]:a1},removeData:function(a0,aZ){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a2=a0[aI],aY=a.cache,a1=aY[a2];if(aZ){if(a1){delete a1[aZ];if(a.isEmptyObject(a1)){a.removeData(a0)}}}else{if(a.support.deleteExpando){delete a0[a.expando]}else{if(a0.removeAttribute){a0.removeAttribute(a.expando)}}delete aY[a2]}}});a.fn.extend({data:function(aY,a0){if(typeof aY==="undefined"&&this.length){return a.data(this[0])}else{if(typeof aY==="object"){return this.each(function(){a.data(this,aY)})}}var a1=aY.split(".");a1[1]=a1[1]?"."+a1[1]:"";if(a0===C){var aZ=this.triggerHandler("getData"+a1[1]+"!",[a1[0]]);if(aZ===C&&this.length){aZ=a.data(this[0],aY)}return aZ===C&&a1[1]?this.data(a1[0]):aZ}else{return this.trigger("setData"+a1[1]+"!",[a1[0],a0]).each(function(){a.data(this,aY,a0)})}},removeData:function(aY){return this.each(function(){a.removeData(this,aY)})}});a.extend({queue:function(aZ,aY,a1){if(!aZ){return}aY=(aY||"fx")+"queue";var a0=a.data(aZ,aY);if(!a1){return a0||[]}if(!a0||a.isArray(a1)){a0=a.data(aZ,aY,a.makeArray(a1))}else{a0.push(a1)}return a0},dequeue:function(a1,a0){a0=a0||"fx";var aY=a.queue(a1,a0),aZ=aY.shift();if(aZ==="inprogress"){aZ=aY.shift()}if(aZ){if(a0==="fx"){aY.unshift("inprogress")}aZ.call(a1,function(){a.dequeue(a1,a0)})}}});a.fn.extend({queue:function(aY,aZ){if(typeof aY!=="string"){aZ=aY;aY="fx"}if(aZ===C){return a.queue(this[0],aY)}return this.each(function(a1,a2){var a0=a.queue(this,aY,aZ);if(aY==="fx"&&a0[0]!=="inprogress"){a.dequeue(this,aY)}})},dequeue:function(aY){return this.each(function(){a.dequeue(this,aY)})},delay:function(aZ,aY){aZ=a.fx?a.fx.speeds[aZ]||aZ:aZ;aY=aY||"fx";return this.queue(aY,function(){var a0=this;setTimeout(function(){a.dequeue(a0,aY)},aZ)})},clearQueue:function(aY){return this.queue(aY||"fx",[])}});var ao=/[\n\t]/g,S=/\s+/,av=/\r/g,aQ=/href|src|style/,d=/(button|input)/i,z=/(button|input|object|select|textarea)/i,j=/^(a|area)$/i,I=/radio|checkbox/;a.fn.extend({attr:function(aY,aZ){return an(this,aY,aZ,true,a.attr)},removeAttr:function(aY,aZ){return this.each(function(){a.attr(this,aY,"");if(this.nodeType===1){this.removeAttribute(aY)}})},addClass:function(a5){if(a.isFunction(a5)){return this.each(function(a8){var a7=a(this);a7.addClass(a5.call(this,a8,a7.attr("class")))})}if(a5&&typeof a5==="string"){var aY=(a5||"").split(S);for(var a1=0,a0=this.length;a1<a0;a1++){var aZ=this[a1];if(aZ.nodeType===1){if(!aZ.className){aZ.className=a5}else{var a2=" "+aZ.className+" ",a4=aZ.className;for(var a3=0,a6=aY.length;a3<a6;a3++){if(a2.indexOf(" "+aY[a3]+" ")<0){a4+=" "+aY[a3]}}aZ.className=a.trim(a4)}}}}return this},removeClass:function(a3){if(a.isFunction(a3)){return this.each(function(a7){var a6=a(this);a6.removeClass(a3.call(this,a7,a6.attr("class")))})}if((a3&&typeof a3==="string")||a3===C){var a4=(a3||"").split(S);for(var a0=0,aZ=this.length;a0<aZ;a0++){var a2=this[a0];if(a2.nodeType===1&&a2.className){if(a3){var a1=(" "+a2.className+" ").replace(ao," ");for(var a5=0,aY=a4.length;a5<aY;a5++){a1=a1.replace(" "+a4[a5]+" "," ")}a2.className=a.trim(a1)}else{a2.className=""}}}}return this},toggleClass:function(a1,aZ){var a0=typeof a1,aY=typeof aZ==="boolean";if(a.isFunction(a1)){return this.each(function(a3){var a2=a(this);a2.toggleClass(a1.call(this,a3,a2.attr("class"),aZ),aZ)})}return this.each(function(){if(a0==="string"){var a4,a3=0,a2=a(this),a5=aZ,a6=a1.split(S);while((a4=a6[a3++])){a5=aY?a5:!a2.hasClass(a4);a2[a5?"addClass":"removeClass"](a4)}}else{if(a0==="undefined"||a0==="boolean"){if(this.className){a.data(this,"__className__",this.className)}this.className=this.className||a1===false?"":a.data(this,"__className__")||""}}})},hasClass:function(aY){var a1=" "+aY+" ";for(var a0=0,aZ=this.length;a0<aZ;a0++){if((" "+this[a0].className+" ").replace(ao," ").indexOf(a1)>-1){return true}}return false},val:function(a5){if(a5===C){var aZ=this[0];if(aZ){if(a.nodeName(aZ,"option")){return(aZ.attributes.value||{}).specified?aZ.value:aZ.text}if(a.nodeName(aZ,"select")){var a3=aZ.selectedIndex,a6=[],a7=aZ.options,a2=aZ.type==="select-one";if(a3<0){return null}for(var a0=a2?a3:0,a4=a2?a3+1:a7.length;a0<a4;a0++){var a1=a7[a0];if(a1.selected){a5=a(a1).val();if(a2){return a5}a6.push(a5)}}return a6}if(I.test(aZ.type)&&!a.support.checkOn){return aZ.getAttribute("value")===null?"on":aZ.value}return(aZ.value||"").replace(av,"")}return C}var aY=a.isFunction(a5);return this.each(function(ba){var a9=a(this),bb=a5;if(this.nodeType!==1){return}if(aY){bb=a5.call(this,ba,a9.val())}if(typeof bb==="number"){bb+=""}if(a.isArray(bb)&&I.test(this.type)){this.checked=a.inArray(a9.val(),bb)>=0}else{if(a.nodeName(this,"select")){var a8=a.makeArray(bb);a("option",this).each(function(){this.selected=a.inArray(a(this).val(),a8)>=0});if(!a8.length){this.selectedIndex=-1}}else{this.value=bb}}})}});a.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(aZ,aY,a4,a7){if(!aZ||aZ.nodeType===3||aZ.nodeType===8){return C}if(a7&&aY in a.attrFn){return a(aZ)[aY](a4)}var a0=aZ.nodeType!==1||!a.isXMLDoc(aZ),a3=a4!==C;aY=a0&&a.props[aY]||aY;if(aZ.nodeType===1){var a2=aQ.test(aY);if(aY==="selected"&&!a.support.optSelected){var a5=aZ.parentNode;if(a5){a5.selectedIndex;if(a5.parentNode){a5.parentNode.selectedIndex}}}if(aY in aZ&&a0&&!a2){if(a3){if(aY==="type"&&d.test(aZ.nodeName)&&aZ.parentNode){a.error("type property can't be changed")}aZ[aY]=a4}if(a.nodeName(aZ,"form")&&aZ.getAttributeNode(aY)){return aZ.getAttributeNode(aY).nodeValue}if(aY==="tabIndex"){var a6=aZ.getAttributeNode("tabIndex");return a6&&a6.specified?a6.value:z.test(aZ.nodeName)||j.test(aZ.nodeName)&&aZ.href?0:C}return aZ[aY]}if(!a.support.style&&a0&&aY==="style"){if(a3){aZ.style.cssText=""+a4}return aZ.style.cssText}if(a3){aZ.setAttribute(aY,""+a4)}var a1=!a.support.hrefNormalized&&a0&&a2?aZ.getAttribute(aY,2):aZ.getAttribute(aY);return a1===null?C:a1}return a.style(aZ,aY,a4)}});var aC=/\.(.*)$/,A=function(aY){return aY.replace(/[^\w\s\.\|`]/g,function(aZ){return"\\"+aZ})};a.event={add:function(a1,a5,ba,a3){if(a1.nodeType===3||a1.nodeType===8){return}if(a1.setInterval&&(a1!==aM&&!a1.frameElement)){a1=aM}var aZ,a9;if(ba.handler){aZ=ba;ba=aZ.handler}if(!ba.guid){ba.guid=a.guid++}var a6=a.data(a1);if(!a6){return}var bb=a6.events=a6.events||{},a4=a6.handle,a4;if(!a4){a6.handle=a4=function(){return typeof a!=="undefined"&&!a.event.triggered?a.event.handle.apply(a4.elem,arguments):C}}a4.elem=a1;a5=a5.split(" ");var a8,a2=0,aY;while((a8=a5[a2++])){a9=aZ?a.extend({},aZ):{handler:ba,data:a3};if(a8.indexOf(".")>-1){aY=a8.split(".");a8=aY.shift();a9.namespace=aY.slice(0).sort().join(".")}else{aY=[];a9.namespace=""}a9.type=a8;a9.guid=ba.guid;var a0=bb[a8],a7=a.event.special[a8]||{};if(!a0){a0=bb[a8]=[];if(!a7.setup||a7.setup.call(a1,a3,aY,a4)===false){if(a1.addEventListener){a1.addEventListener(a8,a4,false)}else{if(a1.attachEvent){a1.attachEvent("on"+a8,a4)}}}}if(a7.add){a7.add.call(a1,a9);if(!a9.handler.guid){a9.handler.guid=ba.guid}}a0.push(a9);a.event.global[a8]=true}a1=null},global:{},remove:function(bd,a8,aZ,a4){if(bd.nodeType===3||bd.nodeType===8){return}var bg,a3,a5,bb=0,a1,a6,a9,a2,a7,aY,bf,bc=a.data(bd),a0=bc&&bc.events;if(!bc||!a0){return}if(a8&&a8.type){aZ=a8.handler;a8=a8.type}if(!a8||typeof a8==="string"&&a8.charAt(0)==="."){a8=a8||"";for(a3 in a0){a.event.remove(bd,a3+a8)}return}a8=a8.split(" ");while((a3=a8[bb++])){bf=a3;aY=null;a1=a3.indexOf(".")<0;a6=[];if(!a1){a6=a3.split(".");a3=a6.shift();a9=new RegExp("(^|\\.)"+a.map(a6.slice(0).sort(),A).join("\\.(?:.*\\.)?")+"(\\.|$)")}a7=a0[a3];if(!a7){continue}if(!aZ){for(var ba=0;ba<a7.length;ba++){aY=a7[ba];if(a1||a9.test(aY.namespace)){a.event.remove(bd,bf,aY.handler,ba);a7.splice(ba--,1)}}continue}a2=a.event.special[a3]||{};for(var ba=a4||0;ba<a7.length;ba++){aY=a7[ba];if(aZ.guid===aY.guid){if(a1||a9.test(aY.namespace)){if(a4==null){a7.splice(ba--,1)}if(a2.remove){a2.remove.call(bd,aY)}}if(a4!=null){break}}}if(a7.length===0||a4!=null&&a7.length===1){if(!a2.teardown||a2.teardown.call(bd,a6)===false){ag(bd,a3,bc.handle)}bg=null;delete a0[a3]}}if(a.isEmptyObject(a0)){var be=bc.handle;if(be){be.elem=null}delete bc.events;delete bc.handle;if(a.isEmptyObject(bc)){a.removeData(bd)}}},trigger:function(aY,a2,a0){var a7=aY.type||aY,a1=arguments[3];if(!a1){aY=typeof aY==="object"?aY[aI]?aY:a.extend(a.Event(a7),aY):a.Event(a7);if(a7.indexOf("!")>=0){aY.type=a7=a7.slice(0,-1);aY.exclusive=true}if(!a0){aY.stopPropagation();if(a.event.global[a7]){a.each(a.cache,function(){if(this.events&&this.events[a7]){a.event.trigger(aY,a2,this.handle.elem)}})}}if(!a0||a0.nodeType===3||a0.nodeType===8){return C}aY.result=C;aY.target=a0;a2=a.makeArray(a2);a2.unshift(aY)}aY.currentTarget=a0;var a3=a.data(a0,"handle");if(a3){a3.apply(a0,a2)}var a8=a0.parentNode||a0.ownerDocument;try{if(!(a0&&a0.nodeName&&a.noData[a0.nodeName.toLowerCase()])){if(a0["on"+a7]&&a0["on"+a7].apply(a0,a2)===false){aY.result=false}}}catch(a5){}if(!aY.isPropagationStopped()&&a8){a.event.trigger(aY,a2,a8,true)}else{if(!aY.isDefaultPrevented()){var a4=aY.target,aZ,a9=a.nodeName(a4,"a")&&a7==="click",a6=a.event.special[a7]||{};if((!a6._default||a6._default.call(a0,aY)===false)&&!a9&&!(a4&&a4.nodeName&&a.noData[a4.nodeName.toLowerCase()])){try{if(a4[a7]){aZ=a4["on"+a7];if(aZ){a4["on"+a7]=null}a.event.triggered=true;a4[a7]()}}catch(a5){}if(aZ){a4["on"+a7]=aZ}a.event.triggered=false}}}},handle:function(aY){var a6,a0,aZ,a1,a7;aY=arguments[0]=a.event.fix(aY||aM.event);aY.currentTarget=this;a6=aY.type.indexOf(".")<0&&!aY.exclusive;if(!a6){aZ=aY.type.split(".");aY.type=aZ.shift();a1=new RegExp("(^|\\.)"+aZ.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var a7=a.data(this,"events"),a0=a7[aY.type];if(a7&&a0){a0=a0.slice(0);for(var a3=0,a2=a0.length;a3<a2;a3++){var a5=a0[a3];if(a6||a1.test(a5.namespace)){aY.handler=a5.handler;aY.data=a5.data;aY.handleObj=a5;var a4=a5.handler.apply(this,arguments);if(a4!==C){aY.result=a4;if(a4===false){aY.preventDefault();aY.stopPropagation()}}if(aY.isImmediatePropagationStopped()){break}}}}return aY.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a1){if(a1[aI]){return a1}var aZ=a1;a1=a.Event(aZ);for(var a0=this.props.length,a3;a0;){a3=this.props[--a0];a1[a3]=aZ[a3]}if(!a1.target){a1.target=a1.srcElement||ab}if(a1.target.nodeType===3){a1.target=a1.target.parentNode}if(!a1.relatedTarget&&a1.fromElement){a1.relatedTarget=a1.fromElement===a1.target?a1.toElement:a1.fromElement}if(a1.pageX==null&&a1.clientX!=null){var a2=ab.documentElement,aY=ab.body;a1.pageX=a1.clientX+(a2&&a2.scrollLeft||aY&&aY.scrollLeft||0)-(a2&&a2.clientLeft||aY&&aY.clientLeft||0);a1.pageY=a1.clientY+(a2&&a2.scrollTop||aY&&aY.scrollTop||0)-(a2&&a2.clientTop||aY&&aY.clientTop||0)}if(!a1.which&&((a1.charCode||a1.charCode===0)?a1.charCode:a1.keyCode)){a1.which=a1.charCode||a1.keyCode}if(!a1.metaKey&&a1.ctrlKey){a1.metaKey=a1.ctrlKey}if(!a1.which&&a1.button!==C){a1.which=(a1.button&1?1:(a1.button&2?3:(a1.button&4?2:0)))}return a1},guid:100000000,proxy:a.proxy,special:{ready:{setup:a.bindReady,teardown:a.noop},live:{add:function(aY){a.event.add(this,aY.origType,a.extend({},aY,{handler:V}))},remove:function(aZ){var aY=true,a0=aZ.origType.replace(aC,"");a.each(a.data(this,"events").live||[],function(){if(a0===this.origType.replace(aC,"")){aY=false;return false}});if(aY){a.event.remove(this,aZ.origType,V)}}},beforeunload:{setup:function(a0,aZ,aY){if(this.setInterval){this.onbeforeunload=aY}return false},teardown:function(aZ,aY){if(this.onbeforeunload===aY){this.onbeforeunload=null}}}}};var ag=ab.removeEventListener?function(aZ,aY,a0){aZ.removeEventListener(aY,a0,false)}:function(aZ,aY,a0){aZ.detachEvent("on"+aY,a0)};a.Event=function(aY){if(!this.preventDefault){return new a.Event(aY)}if(aY&&aY.type){this.originalEvent=aY;this.type=aY.type}else{this.type=aY}this.timeStamp=aP();this[aI]=true};function aR(){return false}function f(){return true}a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=f;var aY=this.originalEvent;if(!aY){return}if(aY.preventDefault){aY.preventDefault()}aY.returnValue=false},stopPropagation:function(){this.isPropagationStopped=f;var aY=this.originalEvent;if(!aY){return}if(aY.stopPropagation){aY.stopPropagation()}aY.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=f;this.stopPropagation()},isDefaultPrevented:aR,isPropagationStopped:aR,isImmediatePropagationStopped:aR};var Q=function(aZ){var aY=aZ.relatedTarget;try{while(aY&&aY!==this){aY=aY.parentNode}if(aY!==this){aZ.type=aZ.data;a.event.handle.apply(this,arguments)}}catch(a0){}},ay=function(aY){aY.type=aY.data;a.event.handle.apply(this,arguments)};a.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(aZ,aY){a.event.special[aZ]={setup:function(a0){a.event.add(this,aY,a0&&a0.selector?ay:Q,aZ)},teardown:function(a0){a.event.remove(this,aY,a0&&a0.selector?ay:Q)}}});if(!a.support.submitBubbles){a.event.special.submit={setup:function(aZ,aY){if(this.nodeName.toLowerCase()!=="form"){a.event.add(this,"click.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="submit"||a0==="image")&&a(a1).closest("form").length){return aA("submit",this,arguments)}});a.event.add(this,"keypress.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="text"||a0==="password")&&a(a1).closest("form").length&&a2.keyCode===13){return aA("submit",this,arguments)}})}else{return false}},teardown:function(aY){a.event.remove(this,".specialSubmit")}}}if(!a.support.changeBubbles){var aq=/textarea|input|select/i,aS,i=function(aZ){var aY=aZ.type,a0=aZ.value;if(aY==="radio"||aY==="checkbox"){a0=aZ.checked}else{if(aY==="select-multiple"){a0=aZ.selectedIndex>-1?a.map(aZ.options,function(a1){return a1.selected}).join("-"):""}else{if(aZ.nodeName.toLowerCase()==="select"){a0=aZ.selectedIndex}}}return a0},O=function O(a0){var aY=a0.target,aZ,a1;if(!aq.test(aY.nodeName)||aY.readOnly){return}aZ=a.data(aY,"_change_data");a1=i(aY);if(a0.type!=="focusout"||aY.type!=="radio"){a.data(aY,"_change_data",a1)}if(aZ===C||a1===aZ){return}if(aZ!=null||a1){a0.type="change";return a.event.trigger(a0,arguments[1],aY)}};a.event.special.change={filters:{focusout:O,click:function(a0){var aZ=a0.target,aY=aZ.type;if(aY==="radio"||aY==="checkbox"||aZ.nodeName.toLowerCase()==="select"){return O.call(this,a0)}},keydown:function(a0){var aZ=a0.target,aY=aZ.type;if((a0.keyCode===13&&aZ.nodeName.toLowerCase()!=="textarea")||(a0.keyCode===32&&(aY==="checkbox"||aY==="radio"))||aY==="select-multiple"){return O.call(this,a0)}},beforeactivate:function(aZ){var aY=aZ.target;a.data(aY,"_change_data",i(aY))}},setup:function(a0,aZ){if(this.type==="file"){return false}for(var aY in aS){a.event.add(this,aY+".specialChange",aS[aY])}return aq.test(this.nodeName)},teardown:function(aY){a.event.remove(this,".specialChange");return aq.test(this.nodeName)}};aS=a.event.special.change.filters}function aA(aZ,a0,aY){aY[0].type=aZ;return a.event.handle.apply(a0,aY)}if(ab.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(a0,aY){a.event.special[aY]={setup:function(){this.addEventListener(a0,aZ,true)},teardown:function(){this.removeEventListener(a0,aZ,true)}};function aZ(a1){a1=a.event.fix(a1);a1.type=aY;return a.event.handle.call(this,a1)}})}a.each(["bind","one"],function(aZ,aY){a.fn[aY]=function(a5,a6,a4){if(typeof a5==="object"){for(var a2 in a5){this[aY](a2,a6,a5[a2],a4)}return this}if(a.isFunction(a6)){a4=a6;a6=C}var a3=aY==="one"?a.proxy(a4,function(a7){a(this).unbind(a7,a3);return a4.apply(this,arguments)}):a4;if(a5==="unload"&&aY!=="one"){this.one(a5,a6,a4)}else{for(var a1=0,a0=this.length;a1<a0;a1++){a.event.add(this[a1],a5,a3,a6)}}return this}});a.fn.extend({unbind:function(a2,a1){if(typeof a2==="object"&&!a2.preventDefault){for(var a0 in a2){this.unbind(a0,a2[a0])}}else{for(var aZ=0,aY=this.length;aZ<aY;aZ++){a.event.remove(this[aZ],a2,a1)}}return this},delegate:function(aY,aZ,a1,a0){return this.live(aZ,a1,a0,aY)},undelegate:function(aY,aZ,a0){if(arguments.length===0){return this.unbind("live")}else{return this.die(aZ,null,a0,aY)}},trigger:function(aY,aZ){return this.each(function(){a.event.trigger(aY,aZ,this)})},triggerHandler:function(aY,a0){if(this[0]){var aZ=a.Event(aY);aZ.preventDefault();aZ.stopPropagation();a.event.trigger(aZ,a0,this[0]);return aZ.result}},toggle:function(a0){var aY=arguments,aZ=1;while(aZ<aY.length){a.proxy(a0,aY[aZ++])}return this.click(a.proxy(a0,function(a1){var a2=(a.data(this,"lastToggle"+a0.guid)||0)%aZ;a.data(this,"lastToggle"+a0.guid,a2+1);a1.preventDefault();return aY[a2].apply(this,arguments)||false}))},hover:function(aY,aZ){return this.mouseenter(aY).mouseleave(aZ||aY)}});var aw={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};a.each(["live","die"],function(aZ,aY){a.fn[aY]=function(a7,a4,a9,a2){var a8,a5=0,a6,a1,ba,a3=a2||this.selector,a0=a2?this:a(this.context);if(a.isFunction(a4)){a9=a4;a4=C}a7=(a7||"").split(" ");while((a8=a7[a5++])!=null){a6=aC.exec(a8);a1="";if(a6){a1=a6[0];a8=a8.replace(aC,"")}if(a8==="hover"){a7.push("mouseenter"+a1,"mouseleave"+a1);continue}ba=a8;if(a8==="focus"||a8==="blur"){a7.push(aw[a8]+a1);a8=a8+a1}else{a8=(aw[a8]||a8)+a1}if(aY==="live"){a0.each(function(){a.event.add(this,m(a8,a3),{data:a4,selector:a3,handler:a9,origType:a8,origHandler:a9,preType:ba})})}else{a0.unbind(m(a8,a3),a9)}}return this}});function V(aY){var a8,aZ=[],bb=[],a7=arguments,ba,a6,a9,a1,a3,a5,a2,a4,bc=a.data(this,"events");if(aY.liveFired===this||!bc||!bc.live||aY.button&&aY.type==="click"){return}aY.liveFired=this;var a0=bc.live.slice(0);for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a9.origType.replace(aC,"")===aY.type){bb.push(a9.selector)}else{a0.splice(a3--,1)}}a6=a(aY.target).closest(bb,aY.currentTarget);for(a5=0,a2=a6.length;a5<a2;a5++){for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a6[a5].selector===a9.selector){a1=a6[a5].elem;ba=null;if(a9.preType==="mouseenter"||a9.preType==="mouseleave"){ba=a(aY.relatedTarget).closest(a9.selector)[0]}if(!ba||ba!==a1){aZ.push({elem:a1,handleObj:a9})}}}}for(a5=0,a2=aZ.length;a5<a2;a5++){a6=aZ[a5];aY.currentTarget=a6.elem;aY.data=a6.handleObj.data;aY.handleObj=a6.handleObj;if(a6.handleObj.origHandler.apply(a6.elem,a7)===false){a8=false;break}}return a8}function m(aZ,aY){return"live."+(aZ&&aZ!=="*"?aZ+".":"")+aY.replace(/\./g,"`").replace(/ /g,"&")}a.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(aZ,aY){a.fn[aY]=function(a0){return a0?this.bind(aY,a0):this.trigger(aY)};if(a.attrFn){a.attrFn[aY]=true}});if(aM.attachEvent&&!aM.addEventListener){aM.attachEvent("onunload",function(){for(var aZ in a.cache){if(a.cache[aZ].handle){try{a.event.remove(a.cache[aZ].handle.elem)}catch(aY){}}}}); /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ }(function(){var a9=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ba=0,bc=Object.prototype.toString,a4=false,a3=true;[0,0].sort(function(){a3=false;return 0});var a0=function(bl,bg,bo,bp){bo=bo||[];var br=bg=bg||ab;if(bg.nodeType!==1&&bg.nodeType!==9){return[]}if(!bl||typeof bl!=="string"){return bo}var bm=[],bi,bt,bw,bh,bk=true,bj=a1(bg),bq=bl;while((a9.exec(""),bi=a9.exec(bq))!==null){bq=bi[3];bm.push(bi[1]);if(bi[2]){bh=bi[3];break}}if(bm.length>1&&a5.exec(bl)){if(bm.length===2&&a6.relative[bm[0]]){bt=bd(bm[0]+bm[1],bg)}else{bt=a6.relative[bm[0]]?[bg]:a0(bm.shift(),bg);while(bm.length){bl=bm.shift();if(a6.relative[bl]){bl+=bm.shift()}bt=bd(bl,bt)}}}else{if(!bp&&bm.length>1&&bg.nodeType===9&&!bj&&a6.match.ID.test(bm[0])&&!a6.match.ID.test(bm[bm.length-1])){var bs=a0.find(bm.shift(),bg,bj);bg=bs.expr?a0.filter(bs.expr,bs.set)[0]:bs.set[0]}if(bg){var bs=bp?{expr:bm.pop(),set:a8(bp)}:a0.find(bm.pop(),bm.length===1&&(bm[0]==="~"||bm[0]==="+")&&bg.parentNode?bg.parentNode:bg,bj);bt=bs.expr?a0.filter(bs.expr,bs.set):bs.set;if(bm.length>0){bw=a8(bt)}else{bk=false}while(bm.length){var bv=bm.pop(),bu=bv;if(!a6.relative[bv]){bv=""}else{bu=bm.pop()}if(bu==null){bu=bg}a6.relative[bv](bw,bu,bj)}}else{bw=bm=[]}}if(!bw){bw=bt}if(!bw){a0.error(bv||bl)}if(bc.call(bw)==="[object Array]"){if(!bk){bo.push.apply(bo,bw)}else{if(bg&&bg.nodeType===1){for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&(bw[bn]===true||bw[bn].nodeType===1&&a7(bg,bw[bn]))){bo.push(bt[bn])}}}else{for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&bw[bn].nodeType===1){bo.push(bt[bn])}}}}}else{a8(bw,bo)}if(bh){a0(bh,br,bo,bp);a0.uniqueSort(bo)}return bo};a0.uniqueSort=function(bh){if(bb){a4=a3;bh.sort(bb);if(a4){for(var bg=1;bg<bh.length;bg++){if(bh[bg]===bh[bg-1]){bh.splice(bg--,1)}}}}return bh};a0.matches=function(bg,bh){return a0(bg,null,null,bh)};a0.find=function(bn,bg,bo){var bm,bk;if(!bn){return[]}for(var bj=0,bi=a6.order.length;bj<bi;bj++){var bl=a6.order[bj],bk;if((bk=a6.leftMatch[bl].exec(bn))){var bh=bk[1];bk.splice(1,1);if(bh.substr(bh.length-1)!=="\\"){bk[1]=(bk[1]||"").replace(/\\/g,"");bm=a6.find[bl](bk,bg,bo);if(bm!=null){bn=bn.replace(a6.match[bl],"");break}}}}if(!bm){bm=bg.getElementsByTagName("*")}return{set:bm,expr:bn}};a0.filter=function(br,bq,bu,bk){var bi=br,bw=[],bo=bq,bm,bg,bn=bq&&bq[0]&&a1(bq[0]);while(br&&bq.length){for(var bp in a6.filter){if((bm=a6.leftMatch[bp].exec(br))!=null&&bm[2]){var bh=a6.filter[bp],bv,bt,bj=bm[1];bg=false;bm.splice(1,1);if(bj.substr(bj.length-1)==="\\"){continue}if(bo===bw){bw=[]}if(a6.preFilter[bp]){bm=a6.preFilter[bp](bm,bo,bu,bw,bk,bn);if(!bm){bg=bv=true}else{if(bm===true){continue}}}if(bm){for(var bl=0;(bt=bo[bl])!=null;bl++){if(bt){bv=bh(bt,bm,bl,bo);var bs=bk^!!bv;if(bu&&bv!=null){if(bs){bg=true}else{bo[bl]=false}}else{if(bs){bw.push(bt);bg=true}}}}}if(bv!==C){if(!bu){bo=bw}br=br.replace(a6.match[bp],"");if(!bg){return[]}break}}}if(br===bi){if(bg==null){a0.error(br)}else{break}}bi=br}return bo};a0.error=function(bg){throw"Syntax error, unrecognized expression: "+bg};var a6=a0.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(bg){return bg.getAttribute("href")}},relative:{"+":function(bm,bh){var bj=typeof bh==="string",bl=bj&&!/\W/.test(bh),bn=bj&&!bl;if(bl){bh=bh.toLowerCase()}for(var bi=0,bg=bm.length,bk;bi<bg;bi++){if((bk=bm[bi])){while((bk=bk.previousSibling)&&bk.nodeType!==1){}bm[bi]=bn||bk&&bk.nodeName.toLowerCase()===bh?bk||false:bk===bh}}if(bn){a0.filter(bh,bm,true)}},">":function(bm,bh){var bk=typeof bh==="string";if(bk&&!/\W/.test(bh)){bh=bh.toLowerCase();for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){var bj=bl.parentNode;bm[bi]=bj.nodeName.toLowerCase()===bh?bj:false}}}else{for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){bm[bi]=bk?bl.parentNode:bl.parentNode===bh}}if(bk){a0.filter(bh,bm,true)}}},"":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("parentNode",bh,bi,bj,bk,bl)},"~":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("previousSibling",bh,bi,bj,bk,bl)}},find:{ID:function(bh,bi,bj){if(typeof bi.getElementById!=="undefined"&&!bj){var bg=bi.getElementById(bh[1]);return bg?[bg]:[]}},NAME:function(bi,bl){if(typeof bl.getElementsByName!=="undefined"){var bh=[],bk=bl.getElementsByName(bi[1]);for(var bj=0,bg=bk.length;bj<bg;bj++){if(bk[bj].getAttribute("name")===bi[1]){bh.push(bk[bj])}}return bh.length===0?null:bh}},TAG:function(bg,bh){return bh.getElementsByTagName(bg[1])}},preFilter:{CLASS:function(bj,bh,bi,bg,bm,bn){bj=" "+bj[1].replace(/\\/g,"")+" ";if(bn){return bj}for(var bk=0,bl;(bl=bh[bk])!=null;bk++){if(bl){if(bm^(bl.className&&(" "+bl.className+" ").replace(/[\t\n]/g," ").indexOf(bj)>=0)){if(!bi){bg.push(bl)}}else{if(bi){bh[bk]=false}}}}return false},ID:function(bg){return bg[1].replace(/\\/g,"")},TAG:function(bh,bg){return bh[1].toLowerCase()},CHILD:function(bg){if(bg[1]==="nth"){var bh=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(bg[2]==="even"&&"2n"||bg[2]==="odd"&&"2n+1"||!/\D/.test(bg[2])&&"0n+"+bg[2]||bg[2]);bg[2]=(bh[1]+(bh[2]||1))-0;bg[3]=bh[3]-0}bg[0]=ba++;return bg},ATTR:function(bk,bh,bi,bg,bl,bm){var bj=bk[1].replace(/\\/g,"");if(!bm&&a6.attrMap[bj]){bk[1]=a6.attrMap[bj]}if(bk[2]==="~="){bk[4]=" "+bk[4]+" "}return bk},PSEUDO:function(bk,bh,bi,bg,bl){if(bk[1]==="not"){if((a9.exec(bk[3])||"").length>1||/^\w/.test(bk[3])){bk[3]=a0(bk[3],null,null,bh)}else{var bj=a0.filter(bk[3],bh,bi,true^bl);if(!bi){bg.push.apply(bg,bj)}return false}}else{if(a6.match.POS.test(bk[0])||a6.match.CHILD.test(bk[0])){return true}}return bk},POS:function(bg){bg.unshift(true);return bg}},filters:{enabled:function(bg){return bg.disabled===false&&bg.type!=="hidden"},disabled:function(bg){return bg.disabled===true},checked:function(bg){return bg.checked===true},selected:function(bg){bg.parentNode.selectedIndex;return bg.selected===true},parent:function(bg){return !!bg.firstChild},empty:function(bg){return !bg.firstChild},has:function(bi,bh,bg){return !!a0(bg[3],bi).length},header:function(bg){return/h\d/i.test(bg.nodeName)},text:function(bg){return"text"===bg.type},radio:function(bg){return"radio"===bg.type},checkbox:function(bg){return"checkbox"===bg.type},file:function(bg){return"file"===bg.type},password:function(bg){return"password"===bg.type},submit:function(bg){return"submit"===bg.type},image:function(bg){return"image"===bg.type},reset:function(bg){return"reset"===bg.type},button:function(bg){return"button"===bg.type||bg.nodeName.toLowerCase()==="button"},input:function(bg){return/input|select|textarea|button/i.test(bg.nodeName)}},setFilters:{first:function(bh,bg){return bg===0},last:function(bi,bh,bg,bj){return bh===bj.length-1},even:function(bh,bg){return bg%2===0},odd:function(bh,bg){return bg%2===1},lt:function(bi,bh,bg){return bh<bg[3]-0},gt:function(bi,bh,bg){return bh>bg[3]-0},nth:function(bi,bh,bg){return bg[3]-0===bh},eq:function(bi,bh,bg){return bg[3]-0===bh}},filter:{PSEUDO:function(bm,bi,bj,bn){var bh=bi[1],bk=a6.filters[bh];if(bk){return bk(bm,bj,bi,bn)}else{if(bh==="contains"){return(bm.textContent||bm.innerText||aZ([bm])||"").indexOf(bi[3])>=0}else{if(bh==="not"){var bl=bi[3];for(var bj=0,bg=bl.length;bj<bg;bj++){if(bl[bj]===bm){return false}}return true}else{a0.error("Syntax error, unrecognized expression: "+bh)}}}},CHILD:function(bg,bj){var bm=bj[1],bh=bg;switch(bm){case"only":case"first":while((bh=bh.previousSibling)){if(bh.nodeType===1){return false}}if(bm==="first"){return true}bh=bg;case"last":while((bh=bh.nextSibling)){if(bh.nodeType===1){return false}}return true;case"nth":var bi=bj[2],bp=bj[3];if(bi===1&&bp===0){return true}var bl=bj[0],bo=bg.parentNode;if(bo&&(bo.sizcache!==bl||!bg.nodeIndex)){var bk=0;for(bh=bo.firstChild;bh;bh=bh.nextSibling){if(bh.nodeType===1){bh.nodeIndex=++bk}}bo.sizcache=bl}var bn=bg.nodeIndex-bp;if(bi===0){return bn===0}else{return(bn%bi===0&&bn/bi>=0)}}},ID:function(bh,bg){return bh.nodeType===1&&bh.getAttribute("id")===bg},TAG:function(bh,bg){return(bg==="*"&&bh.nodeType===1)||bh.nodeName.toLowerCase()===bg},CLASS:function(bh,bg){return(" "+(bh.className||bh.getAttribute("class"))+" ").indexOf(bg)>-1},ATTR:function(bl,bj){var bi=bj[1],bg=a6.attrHandle[bi]?a6.attrHandle[bi](bl):bl[bi]!=null?bl[bi]:bl.getAttribute(bi),bm=bg+"",bk=bj[2],bh=bj[4];return bg==null?bk==="!=":bk==="="?bm===bh:bk==="*="?bm.indexOf(bh)>=0:bk==="~="?(" "+bm+" ").indexOf(bh)>=0:!bh?bm&&bg!==false:bk==="!="?bm!==bh:bk==="^="?bm.indexOf(bh)===0:bk==="$="?bm.substr(bm.length-bh.length)===bh:bk==="|="?bm===bh||bm.substr(0,bh.length+1)===bh+"-":false},POS:function(bk,bh,bi,bl){var bg=bh[2],bj=a6.setFilters[bg];if(bj){return bj(bk,bi,bh,bl)}}}};var a5=a6.match.POS;for(var a2 in a6.match){a6.match[a2]=new RegExp(a6.match[a2].source+/(?![^\[]*\])(?![^\(]*\))/.source);a6.leftMatch[a2]=new RegExp(/(^(?:.|\r|\n)*?)/.source+a6.match[a2].source.replace(/\\(\d+)/g,function(bh,bg){return"\\"+(bg-0+1)}))}var a8=function(bh,bg){bh=Array.prototype.slice.call(bh,0);if(bg){bg.push.apply(bg,bh);return bg}return bh};try{Array.prototype.slice.call(ab.documentElement.childNodes,0)[0].nodeType}catch(bf){a8=function(bk,bj){var bh=bj||[];if(bc.call(bk)==="[object Array]"){Array.prototype.push.apply(bh,bk)}else{if(typeof bk.length==="number"){for(var bi=0,bg=bk.length;bi<bg;bi++){bh.push(bk[bi])}}else{for(var bi=0;bk[bi];bi++){bh.push(bk[bi])}}}return bh}}var bb;if(ab.documentElement.compareDocumentPosition){bb=function(bh,bg){if(!bh.compareDocumentPosition||!bg.compareDocumentPosition){if(bh==bg){a4=true}return bh.compareDocumentPosition?-1:1}var bi=bh.compareDocumentPosition(bg)&4?-1:bh===bg?0:1;if(bi===0){a4=true}return bi}}else{if("sourceIndex" in ab.documentElement){bb=function(bh,bg){if(!bh.sourceIndex||!bg.sourceIndex){if(bh==bg){a4=true}return bh.sourceIndex?-1:1}var bi=bh.sourceIndex-bg.sourceIndex;if(bi===0){a4=true}return bi}}else{if(ab.createRange){bb=function(bj,bh){if(!bj.ownerDocument||!bh.ownerDocument){if(bj==bh){a4=true}return bj.ownerDocument?-1:1}var bi=bj.ownerDocument.createRange(),bg=bh.ownerDocument.createRange();bi.setStart(bj,0);bi.setEnd(bj,0);bg.setStart(bh,0);bg.setEnd(bh,0);var bk=bi.compareBoundaryPoints(Range.START_TO_END,bg);if(bk===0){a4=true}return bk}}}}function aZ(bg){var bh="",bj;for(var bi=0;bg[bi];bi++){bj=bg[bi];if(bj.nodeType===3||bj.nodeType===4){bh+=bj.nodeValue}else{if(bj.nodeType!==8){bh+=aZ(bj.childNodes)}}}return bh}(function(){var bh=ab.createElement("div"),bi="script"+(new Date).getTime();bh.innerHTML="<a name='"+bi+"'/>";var bg=ab.documentElement;bg.insertBefore(bh,bg.firstChild);if(ab.getElementById(bi)){a6.find.ID=function(bk,bl,bm){if(typeof bl.getElementById!=="undefined"&&!bm){var bj=bl.getElementById(bk[1]);return bj?bj.id===bk[1]||typeof bj.getAttributeNode!=="undefined"&&bj.getAttributeNode("id").nodeValue===bk[1]?[bj]:C:[]}};a6.filter.ID=function(bl,bj){var bk=typeof bl.getAttributeNode!=="undefined"&&bl.getAttributeNode("id");return bl.nodeType===1&&bk&&bk.nodeValue===bj}}bg.removeChild(bh);bg=bh=null})();(function(){var bg=ab.createElement("div");bg.appendChild(ab.createComment(""));if(bg.getElementsByTagName("*").length>0){a6.find.TAG=function(bh,bl){var bk=bl.getElementsByTagName(bh[1]);if(bh[1]==="*"){var bj=[];for(var bi=0;bk[bi];bi++){if(bk[bi].nodeType===1){bj.push(bk[bi])}}bk=bj}return bk}}bg.innerHTML="<a href='#'></a>";if(bg.firstChild&&typeof bg.firstChild.getAttribute!=="undefined"&&bg.firstChild.getAttribute("href")!=="#"){a6.attrHandle.href=function(bh){return bh.getAttribute("href",2)}}bg=null})();if(ab.querySelectorAll){(function(){var bg=a0,bi=ab.createElement("div");bi.innerHTML="<p class='TEST'></p>";if(bi.querySelectorAll&&bi.querySelectorAll(".TEST").length===0){return}a0=function(bm,bl,bj,bk){bl=bl||ab;if(!bk&&bl.nodeType===9&&!a1(bl)){try{return a8(bl.querySelectorAll(bm),bj)}catch(bn){}}return bg(bm,bl,bj,bk)};for(var bh in bg){a0[bh]=bg[bh]}bi=null})()}(function(){var bg=ab.createElement("div");bg.innerHTML="<div class='test e'></div><div class='test'></div>";if(!bg.getElementsByClassName||bg.getElementsByClassName("e").length===0){return}bg.lastChild.className="e";if(bg.getElementsByClassName("e").length===1){return}a6.order.splice(1,0,"CLASS");a6.find.CLASS=function(bh,bi,bj){if(typeof bi.getElementsByClassName!=="undefined"&&!bj){return bi.getElementsByClassName(bh[1])}};bg=null})();function aY(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1&&!bo){bg.sizcache=bl;bg.sizset=bj}if(bg.nodeName.toLowerCase()===bm){bk=bg;break}bg=bg[bh]}bp[bj]=bk}}}function be(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1){if(!bo){bg.sizcache=bl;bg.sizset=bj}if(typeof bm!=="string"){if(bg===bm){bk=true;break}}else{if(a0.filter(bm,[bg]).length>0){bk=bg;break}}}bg=bg[bh]}bp[bj]=bk}}}var a7=ab.compareDocumentPosition?function(bh,bg){return !!(bh.compareDocumentPosition(bg)&16)}:function(bh,bg){return bh!==bg&&(bh.contains?bh.contains(bg):true)};var a1=function(bg){var bh=(bg?bg.ownerDocument||bg:0).documentElement;return bh?bh.nodeName!=="HTML":false};var bd=function(bg,bn){var bj=[],bk="",bl,bi=bn.nodeType?[bn]:bn;while((bl=a6.match.PSEUDO.exec(bg))){bk+=bl[0];bg=bg.replace(a6.match.PSEUDO,"")}bg=a6.relative[bg]?bg+"*":bg;for(var bm=0,bh=bi.length;bm<bh;bm++){a0(bg,bi[bm],bj)}return a0.filter(bk,bj)};a.find=a0;a.expr=a0.selectors;a.expr[":"]=a.expr.filters;a.unique=a0.uniqueSort;a.text=aZ;a.isXMLDoc=a1;a.contains=a7;return;aM.Sizzle=a0})();var N=/Until$/,Y=/^(?:parents|prevUntil|prevAll)/,aL=/,/,F=Array.prototype.slice;var ai=function(a1,a0,aY){if(a.isFunction(a0)){return a.grep(a1,function(a3,a2){return !!a0.call(a3,a2,a3)===aY})}else{if(a0.nodeType){return a.grep(a1,function(a3,a2){return(a3===a0)===aY})}else{if(typeof a0==="string"){var aZ=a.grep(a1,function(a2){return a2.nodeType===1});if(aW.test(a0)){return a.filter(a0,aZ,!aY)}else{a0=a.filter(a0,aZ)}}}}return a.grep(a1,function(a3,a2){return(a.inArray(a3,a0)>=0)===aY})};a.fn.extend({find:function(aY){var a0=this.pushStack("","find",aY),a3=0;for(var a1=0,aZ=this.length;a1<aZ;a1++){a3=a0.length;a.find(aY,this[a1],a0);if(a1>0){for(var a4=a3;a4<a0.length;a4++){for(var a2=0;a2<a3;a2++){if(a0[a2]===a0[a4]){a0.splice(a4--,1);break}}}}}return a0},has:function(aZ){var aY=a(aZ);return this.filter(function(){for(var a1=0,a0=aY.length;a1<a0;a1++){if(a.contains(this,aY[a1])){return true}}})},not:function(aY){return this.pushStack(ai(this,aY,false),"not",aY)},filter:function(aY){return this.pushStack(ai(this,aY,true),"filter",aY)},is:function(aY){return !!aY&&a.filter(aY,this).length>0},closest:function(a7,aY){if(a.isArray(a7)){var a4=[],a6=this[0],a3,a2={},a0;if(a6&&a7.length){for(var a1=0,aZ=a7.length;a1<aZ;a1++){a0=a7[a1];if(!a2[a0]){a2[a0]=a.expr.match.POS.test(a0)?a(a0,aY||this.context):a0}}while(a6&&a6.ownerDocument&&a6!==aY){for(a0 in a2){a3=a2[a0];if(a3.jquery?a3.index(a6)>-1:a(a6).is(a3)){a4.push({selector:a0,elem:a6});delete a2[a0]}}a6=a6.parentNode}}return a4}var a5=a.expr.match.POS.test(a7)?a(a7,aY||this.context):null;return this.map(function(a8,a9){while(a9&&a9.ownerDocument&&a9!==aY){if(a5?a5.index(a9)>-1:a(a9).is(a7)){return a9}a9=a9.parentNode}return null})},index:function(aY){if(!aY||typeof aY==="string"){return a.inArray(this[0],aY?a(aY):this.parent().children())}return a.inArray(aY.jquery?aY[0]:aY,this)},add:function(aY,aZ){var a1=typeof aY==="string"?a(aY,aZ||this.context):a.makeArray(aY),a0=a.merge(this.get(),a1);return this.pushStack(y(a1[0])||y(a0[0])?a0:a.unique(a0))},andSelf:function(){return this.add(this.prevObject)}});function y(aY){return !aY||!aY.parentNode||aY.parentNode.nodeType===11}a.each({parent:function(aZ){var aY=aZ.parentNode;return aY&&aY.nodeType!==11?aY:null},parents:function(aY){return a.dir(aY,"parentNode")},parentsUntil:function(aZ,aY,a0){return a.dir(aZ,"parentNode",a0)},next:function(aY){return a.nth(aY,2,"nextSibling")},prev:function(aY){return a.nth(aY,2,"previousSibling")},nextAll:function(aY){return a.dir(aY,"nextSibling")},prevAll:function(aY){return a.dir(aY,"previousSibling")},nextUntil:function(aZ,aY,a0){return a.dir(aZ,"nextSibling",a0)},prevUntil:function(aZ,aY,a0){return a.dir(aZ,"previousSibling",a0)},siblings:function(aY){return a.sibling(aY.parentNode.firstChild,aY)},children:function(aY){return a.sibling(aY.firstChild)},contents:function(aY){return a.nodeName(aY,"iframe")?aY.contentDocument||aY.contentWindow.document:a.makeArray(aY.childNodes)}},function(aY,aZ){a.fn[aY]=function(a2,a0){var a1=a.map(this,aZ,a2);if(!N.test(aY)){a0=a2}if(a0&&typeof a0==="string"){a1=a.filter(a0,a1)}a1=this.length>1?a.unique(a1):a1;if((this.length>1||aL.test(a0))&&Y.test(aY)){a1=a1.reverse()}return this.pushStack(a1,aY,F.call(arguments).join(","))}});a.extend({filter:function(a0,aY,aZ){if(aZ){a0=":not("+a0+")"}return a.find.matches(a0,aY)},dir:function(a0,aZ,a2){var aY=[],a1=a0[aZ];while(a1&&a1.nodeType!==9&&(a2===C||a1.nodeType!==1||!a(a1).is(a2))){if(a1.nodeType===1){aY.push(a1)}a1=a1[aZ]}return aY},nth:function(a2,aY,a0,a1){aY=aY||1;var aZ=0;for(;a2;a2=a2[a0]){if(a2.nodeType===1&&++aZ===aY){break}}return a2},sibling:function(a0,aZ){var aY=[];for(;a0;a0=a0.nextSibling){if(a0.nodeType===1&&a0!==aZ){aY.push(a0)}}return aY}});var T=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,H=/(<([\w:]+)[^>]*?)\/>/g,al=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,c=/<([\w:]+)/,t=/<tbody/i,L=/<|&#?\w+;/,E=/<script|<object|<embed|<option|<style/i,l=/checked\s*(?:[^=]|=\s*.checked.)/i,p=function(aZ,a0,aY){return al.test(aY)?aZ:a0+"></"+aY+">"},ac={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};ac.optgroup=ac.option;ac.tbody=ac.tfoot=ac.colgroup=ac.caption=ac.thead;ac.th=ac.td;if(!a.support.htmlSerialize){ac._default=[1,"div<div>","</div>"]}a.fn.extend({text:function(aY){if(a.isFunction(aY)){return this.each(function(a0){var aZ=a(this);aZ.text(aY.call(this,a0,aZ.text()))})}if(typeof aY!=="object"&&aY!==C){return this.empty().append((this[0]&&this[0].ownerDocument||ab).createTextNode(aY))}return a.text(this)},wrapAll:function(aY){if(a.isFunction(aY)){return this.each(function(a0){a(this).wrapAll(aY.call(this,a0))})}if(this[0]){var aZ=a(aY,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){aZ.insertBefore(this[0])}aZ.map(function(){var a0=this;while(a0.firstChild&&a0.firstChild.nodeType===1){a0=a0.firstChild}return a0}).append(this)}return this},wrapInner:function(aY){if(a.isFunction(aY)){return this.each(function(aZ){a(this).wrapInner(aY.call(this,aZ))})}return this.each(function(){var aZ=a(this),a0=aZ.contents();if(a0.length){a0.wrapAll(aY)}else{aZ.append(aY)}})},wrap:function(aY){return this.each(function(){a(this).wrapAll(aY)})},unwrap:function(){return this.parent().each(function(){if(!a.nodeName(this,"body")){a(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.appendChild(aY)}})},prepend:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.insertBefore(aY,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this)})}else{if(arguments.length){var aY=a(arguments[0]);aY.push.apply(aY,this.toArray());return this.pushStack(aY,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this.nextSibling)})}else{if(arguments.length){var aY=this.pushStack(this,"after",arguments);aY.push.apply(aY,a(arguments[0]).toArray());return aY}}},remove:function(aY,a1){for(var aZ=0,a0;(a0=this[aZ])!=null;aZ++){if(!aY||a.filter(aY,[a0]).length){if(!a1&&a0.nodeType===1){a.cleanData(a0.getElementsByTagName("*"));a.cleanData([a0])}if(a0.parentNode){a0.parentNode.removeChild(a0)}}}return this},empty:function(){for(var aY=0,aZ;(aZ=this[aY])!=null;aY++){if(aZ.nodeType===1){a.cleanData(aZ.getElementsByTagName("*"))}while(aZ.firstChild){aZ.removeChild(aZ.firstChild)}}return this},clone:function(aZ){var aY=this.map(function(){if(!a.support.noCloneEvent&&!a.isXMLDoc(this)){var a1=this.outerHTML,a0=this.ownerDocument;if(!a1){var a2=a0.createElement("div");a2.appendChild(this.cloneNode(true));a1=a2.innerHTML}return a.clean([a1.replace(T,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Z,"")],a0)[0]}else{return this.cloneNode(true)}});if(aZ===true){q(this,aY);q(this.find("*"),aY.find("*"))}return aY},html:function(a0){if(a0===C){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(T,""):null}else{if(typeof a0==="string"&&!E.test(a0)&&(a.support.leadingWhitespace||!Z.test(a0))&&!ac[(c.exec(a0)||["",""])[1].toLowerCase()]){a0=a0.replace(H,p);try{for(var aZ=0,aY=this.length;aZ<aY;aZ++){if(this[aZ].nodeType===1){a.cleanData(this[aZ].getElementsByTagName("*"));this[aZ].innerHTML=a0}}}catch(a1){this.empty().append(a0)}}else{if(a.isFunction(a0)){this.each(function(a4){var a3=a(this),a2=a3.html();a3.empty().append(function(){return a0.call(this,a4,a2)})})}else{this.empty().append(a0)}}}return this},replaceWith:function(aY){if(this[0]&&this[0].parentNode){if(a.isFunction(aY)){return this.each(function(a1){var a0=a(this),aZ=a0.html();a0.replaceWith(aY.call(this,a1,aZ))})}if(typeof aY!=="string"){aY=a(aY).detach()}return this.each(function(){var a0=this.nextSibling,aZ=this.parentNode;a(this).remove();if(a0){a(a0).before(aY)}else{a(aZ).append(aY)}})}else{return this.pushStack(a(a.isFunction(aY)?aY():aY),"replaceWith",aY)}},detach:function(aY){return this.remove(aY,true)},domManip:function(a4,a9,a8){var a1,a2,a7=a4[0],aZ=[],a3,a6;if(!a.support.checkClone&&arguments.length===3&&typeof a7==="string"&&l.test(a7)){return this.each(function(){a(this).domManip(a4,a9,a8,true)})}if(a.isFunction(a7)){return this.each(function(bb){var ba=a(this);a4[0]=a7.call(this,bb,a9?ba.html():C);ba.domManip(a4,a9,a8)})}if(this[0]){a6=a7&&a7.parentNode;if(a.support.parentNode&&a6&&a6.nodeType===11&&a6.childNodes.length===this.length){a1={fragment:a6}}else{a1=J(a4,this,aZ)}a3=a1.fragment;if(a3.childNodes.length===1){a2=a3=a3.firstChild}else{a2=a3.firstChild}if(a2){a9=a9&&a.nodeName(a2,"tr");for(var a0=0,aY=this.length;a0<aY;a0++){a8.call(a9?a5(this[a0],a2):this[a0],a0>0||a1.cacheable||this.length>1?a3.cloneNode(true):a3)}}if(aZ.length){a.each(aZ,aV)}}return this;function a5(ba,bb){return a.nodeName(ba,"table")?(ba.getElementsByTagName("tbody")[0]||ba.appendChild(ba.ownerDocument.createElement("tbody"))):ba}}});function q(a0,aY){var aZ=0;aY.each(function(){if(this.nodeName!==(a0[aZ]&&a0[aZ].nodeName)){return}var a5=a.data(a0[aZ++]),a4=a.data(this,a5),a1=a5&&a5.events;if(a1){delete a4.handle;a4.events={};for(var a3 in a1){for(var a2 in a1[a3]){a.event.add(this,a3,a1[a3][a2],a1[a3][a2].data)}}}})}function J(a3,a1,aZ){var a2,aY,a0,a4=(a1&&a1[0]?a1[0].ownerDocument||a1[0]:ab);if(a3.length===1&&typeof a3[0]==="string"&&a3[0].length<512&&a4===ab&&!E.test(a3[0])&&(a.support.checkClone||!l.test(a3[0]))){aY=true;a0=a.fragments[a3[0]];if(a0){if(a0!==1){a2=a0}}}if(!a2){a2=a4.createDocumentFragment();a.clean(a3,a4,a2,aZ)}if(aY){a.fragments[a3[0]]=a0?a2:1}return{fragment:a2,cacheable:aY}}a.fragments={};a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(aY,aZ){a.fn[aY]=function(a0){var a3=[],a6=a(a0),a5=this.length===1&&this[0].parentNode;if(a5&&a5.nodeType===11&&a5.childNodes.length===1&&a6.length===1){a6[aZ](this[0]);return this}else{for(var a4=0,a1=a6.length;a4<a1;a4++){var a2=(a4>0?this.clone(true):this).get();a.fn[aZ].apply(a(a6[a4]),a2);a3=a3.concat(a2)}return this.pushStack(a3,aY,a6.selector)}}});a.extend({clean:function(a0,a2,a9,a4){a2=a2||ab;if(typeof a2.createElement==="undefined"){a2=a2.ownerDocument||a2[0]&&a2[0].ownerDocument||ab}var ba=[];for(var a8=0,a3;(a3=a0[a8])!=null;a8++){if(typeof a3==="number"){a3+=""}if(!a3){continue}if(typeof a3==="string"&&!L.test(a3)){a3=a2.createTextNode(a3)}else{if(typeof a3==="string"){a3=a3.replace(H,p);var bb=(c.exec(a3)||["",""])[1].toLowerCase(),a1=ac[bb]||ac._default,a7=a1[0],aZ=a2.createElement("div");aZ.innerHTML=a1[1]+a3+a1[2];while(a7--){aZ=aZ.lastChild}if(!a.support.tbody){var aY=t.test(a3),a6=bb==="table"&&!aY?aZ.firstChild&&aZ.firstChild.childNodes:a1[1]==="<table>"&&!aY?aZ.childNodes:[];for(var a5=a6.length-1;a5>=0;--a5){if(a.nodeName(a6[a5],"tbody")&&!a6[a5].childNodes.length){a6[a5].parentNode.removeChild(a6[a5])}}}if(!a.support.leadingWhitespace&&Z.test(a3)){aZ.insertBefore(a2.createTextNode(Z.exec(a3)[0]),aZ.firstChild)}a3=aZ.childNodes}}if(a3.nodeType){ba.push(a3)}else{ba=a.merge(ba,a3)}}if(a9){for(var a8=0;ba[a8];a8++){if(a4&&a.nodeName(ba[a8],"script")&&(!ba[a8].type||ba[a8].type.toLowerCase()==="text/javascript")){a4.push(ba[a8].parentNode?ba[a8].parentNode.removeChild(ba[a8]):ba[a8])}else{if(ba[a8].nodeType===1){ba.splice.apply(ba,[a8+1,0].concat(a.makeArray(ba[a8].getElementsByTagName("script"))))}a9.appendChild(ba[a8])}}}return ba},cleanData:function(aZ){var a2,a0,aY=a.cache,a5=a.event.special,a4=a.support.deleteExpando;for(var a3=0,a1;(a1=aZ[a3])!=null;a3++){a0=a1[a.expando];if(a0){a2=aY[a0];if(a2.events){for(var a6 in a2.events){if(a5[a6]){a.event.remove(a1,a6)}else{ag(a1,a6,a2.handle)}}}if(a4){delete a1[a.expando]}else{if(a1.removeAttribute){a1.removeAttribute(a.expando)}}delete aY[a0]}}}});var ar=/z-?index|font-?weight|opacity|zoom|line-?height/i,U=/alpha\([^)]*\)/,aa=/opacity=([^)]*)/,ah=/float/i,az=/-([a-z])/ig,v=/([A-Z])/g,aO=/^-?\d+(?:px)?$/i,aU=/^-?\d/,aK={position:"absolute",visibility:"hidden",display:"block"},W=["Left","Right"],aE=["Top","Bottom"],ak=ab.defaultView&&ab.defaultView.getComputedStyle,aN=a.support.cssFloat?"cssFloat":"styleFloat",k=function(aY,aZ){return aZ.toUpperCase()};a.fn.css=function(aY,aZ){return an(this,aY,aZ,true,function(a1,a0,a2){if(a2===C){return a.curCSS(a1,a0)}if(typeof a2==="number"&&!ar.test(a0)){a2+="px"}a.style(a1,a0,a2)})};a.extend({style:function(a2,aZ,a3){if(!a2||a2.nodeType===3||a2.nodeType===8){return C}if((aZ==="width"||aZ==="height")&&parseFloat(a3)<0){a3=C}var a1=a2.style||a2,a4=a3!==C;if(!a.support.opacity&&aZ==="opacity"){if(a4){a1.zoom=1;var aY=parseInt(a3,10)+""==="NaN"?"":"alpha(opacity="+a3*100+")";var a0=a1.filter||a.curCSS(a2,"filter")||"";a1.filter=U.test(a0)?a0.replace(U,aY):aY}return a1.filter&&a1.filter.indexOf("opacity=")>=0?(parseFloat(aa.exec(a1.filter)[1])/100)+"":""}if(ah.test(aZ)){aZ=aN}aZ=aZ.replace(az,k);if(a4){a1[aZ]=a3}return a1[aZ]},css:function(a1,aZ,a3,aY){if(aZ==="width"||aZ==="height"){var a5,a0=aK,a4=aZ==="width"?W:aE;function a2(){a5=aZ==="width"?a1.offsetWidth:a1.offsetHeight;if(aY==="border"){return}a.each(a4,function(){if(!aY){a5-=parseFloat(a.curCSS(a1,"padding"+this,true))||0}if(aY==="margin"){a5+=parseFloat(a.curCSS(a1,"margin"+this,true))||0}else{a5-=parseFloat(a.curCSS(a1,"border"+this+"Width",true))||0}})}if(a1.offsetWidth!==0){a2()}else{a.swap(a1,a0,a2)}return Math.max(0,Math.round(a5))}return a.curCSS(a1,aZ,a3)},curCSS:function(a4,aZ,a0){var a7,aY=a4.style,a1;if(!a.support.opacity&&aZ==="opacity"&&a4.currentStyle){a7=aa.test(a4.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return a7===""?"1":a7}if(ah.test(aZ)){aZ=aN}if(!a0&&aY&&aY[aZ]){a7=aY[aZ]}else{if(ak){if(ah.test(aZ)){aZ="float"}aZ=aZ.replace(v,"-$1").toLowerCase();var a6=a4.ownerDocument.defaultView;if(!a6){return null}var a8=a6.getComputedStyle(a4,null);if(a8){a7=a8.getPropertyValue(aZ)}if(aZ==="opacity"&&a7===""){a7="1"}}else{if(a4.currentStyle){var a3=aZ.replace(az,k);a7=a4.currentStyle[aZ]||a4.currentStyle[a3];if(!aO.test(a7)&&aU.test(a7)){var a2=aY.left,a5=a4.runtimeStyle.left;a4.runtimeStyle.left=a4.currentStyle.left;aY.left=a3==="fontSize"?"1em":(a7||0);a7=aY.pixelLeft+"px";aY.left=a2;a4.runtimeStyle.left=a5}}}}return a7},swap:function(a1,a0,a2){var aY={};for(var aZ in a0){aY[aZ]=a1.style[aZ];a1.style[aZ]=a0[aZ]}a2.call(a1);for(var aZ in a0){a1.style[aZ]=aY[aZ]}}});if(a.expr&&a.expr.filters){a.expr.filters.hidden=function(a1){var aZ=a1.offsetWidth,aY=a1.offsetHeight,a0=a1.nodeName.toLowerCase()==="tr";return aZ===0&&aY===0&&!a0?true:aZ>0&&aY>0&&!a0?false:a.curCSS(a1,"display")==="none"};a.expr.filters.visible=function(aY){return !a.expr.filters.hidden(aY)}}var af=aP(),aJ=/<script(.|\s)*?\/script>/gi,o=/select|textarea/i,aB=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,r=/=\?(&|$)/,D=/\?/,aX=/(\?|&)_=.*?(&|$)/,B=/^(\w+:)?\/\/([^\/?#]+)/,h=/%20/g,w=a.fn.load;a.fn.extend({load:function(a0,a3,a4){if(typeof a0!=="string"){return w.call(this,a0)}else{if(!this.length){return this}}var a2=a0.indexOf(" ");if(a2>=0){var aY=a0.slice(a2,a0.length);a0=a0.slice(0,a2)}var a1="GET";if(a3){if(a.isFunction(a3)){a4=a3;a3=null}else{if(typeof a3==="object"){a3=a.param(a3,a.ajaxSettings.traditional);a1="POST"}}}var aZ=this;a.ajax({url:a0,type:a1,dataType:"html",data:a3,complete:function(a6,a5){if(a5==="success"||a5==="notmodified"){aZ.html(aY?a("<div />").append(a6.responseText.replace(aJ,"")).find(aY):a6.responseText)}if(a4){aZ.each(a4,[a6.responseText,a5,a6])}}});return this},serialize:function(){return a.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?a.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||o.test(this.nodeName)||aB.test(this.type))}).map(function(aY,aZ){var a0=a(this).val();return a0==null?null:a.isArray(a0)?a.map(a0,function(a2,a1){return{name:aZ.name,value:a2}}):{name:aZ.name,value:a0}}).get()}});a.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(aY,aZ){a.fn[aZ]=function(a0){return this.bind(aZ,a0)}});a.extend({get:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0=null}return a.ajax({type:"GET",url:aY,data:a0,success:a1,dataType:aZ})},getScript:function(aY,aZ){return a.get(aY,null,aZ,"script")},getJSON:function(aY,aZ,a0){return a.get(aY,aZ,a0,"json")},post:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0={}}return a.ajax({type:"POST",url:aY,data:a0,success:a1,dataType:aZ})},ajaxSetup:function(aY){a.extend(a.ajaxSettings,aY)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aM.XMLHttpRequest&&(aM.location.protocol!=="file:"||!aM.ActiveXObject)?function(){return new aM.XMLHttpRequest()}:function(){try{return new aM.ActiveXObject("Microsoft.XMLHTTP")}catch(aY){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(bd){var a8=a.extend(true,{},a.ajaxSettings,bd);var bi,bc,bh,bj=bd&&bd.context||a8,a0=a8.type.toUpperCase();if(a8.data&&a8.processData&&typeof a8.data!=="string"){a8.data=a.param(a8.data,a8.traditional)}if(a8.dataType==="jsonp"){if(a0==="GET"){if(!r.test(a8.url)){a8.url+=(D.test(a8.url)?"&":"?")+(a8.jsonp||"callback")+"=?"}}else{if(!a8.data||!r.test(a8.data)){a8.data=(a8.data?a8.data+"&":"")+(a8.jsonp||"callback")+"=?"}}a8.dataType="json"}if(a8.dataType==="json"&&(a8.data&&r.test(a8.data)||r.test(a8.url))){bi=a8.jsonpCallback||("jsonp"+af++);if(a8.data){a8.data=(a8.data+"").replace(r,"="+bi+"$1")}a8.url=a8.url.replace(r,"="+bi+"$1");a8.dataType="script";aM[bi]=aM[bi]||function(bk){bh=bk;a3();a6();aM[bi]=C;try{delete aM[bi]}catch(bl){}if(a1){a1.removeChild(bf)}}}if(a8.dataType==="script"&&a8.cache===null){a8.cache=false}if(a8.cache===false&&a0==="GET"){var aY=aP();var bg=a8.url.replace(aX,"$1_="+aY+"$2");a8.url=bg+((bg===a8.url)?(D.test(a8.url)?"&":"?")+"_="+aY:"")}if(a8.data&&a0==="GET"){a8.url+=(D.test(a8.url)?"&":"?")+a8.data}if(a8.global&&!a.active++){a.event.trigger("ajaxStart")}var bb=B.exec(a8.url),a2=bb&&(bb[1]&&bb[1]!==location.protocol||bb[2]!==location.host);if(a8.dataType==="script"&&a0==="GET"&&a2){var a1=ab.getElementsByTagName("head")[0]||ab.documentElement;var bf=ab.createElement("script");bf.src=a8.url;if(a8.scriptCharset){bf.charset=a8.scriptCharset}if(!bi){var ba=false;bf.onload=bf.onreadystatechange=function(){if(!ba&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ba=true;a3();a6();bf.onload=bf.onreadystatechange=null;if(a1&&bf.parentNode){a1.removeChild(bf)}}}}a1.insertBefore(bf,a1.firstChild);return C}var a5=false;var a4=a8.xhr();if(!a4){return}if(a8.username){a4.open(a0,a8.url,a8.async,a8.username,a8.password)}else{a4.open(a0,a8.url,a8.async)}try{if(a8.data||bd&&bd.contentType){a4.setRequestHeader("Content-Type",a8.contentType)}if(a8.ifModified){if(a.lastModified[a8.url]){a4.setRequestHeader("If-Modified-Since",a.lastModified[a8.url])}if(a.etag[a8.url]){a4.setRequestHeader("If-None-Match",a.etag[a8.url])}}if(!a2){a4.setRequestHeader("X-Requested-With","XMLHttpRequest")}a4.setRequestHeader("Accept",a8.dataType&&a8.accepts[a8.dataType]?a8.accepts[a8.dataType]+", */*":a8.accepts._default)}catch(be){}if(a8.beforeSend&&a8.beforeSend.call(bj,a4,a8)===false){if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}a4.abort();return false}if(a8.global){a9("ajaxSend",[a4,a8])}var a7=a4.onreadystatechange=function(bk){if(!a4||a4.readyState===0||bk==="abort"){if(!a5){a6()}a5=true;if(a4){a4.onreadystatechange=a.noop}}else{if(!a5&&a4&&(a4.readyState===4||bk==="timeout")){a5=true;a4.onreadystatechange=a.noop;bc=bk==="timeout"?"timeout":!a.httpSuccess(a4)?"error":a8.ifModified&&a.httpNotModified(a4,a8.url)?"notmodified":"success";var bm;if(bc==="success"){try{bh=a.httpData(a4,a8.dataType,a8)}catch(bl){bc="parsererror";bm=bl}}if(bc==="success"||bc==="notmodified"){if(!bi){a3()}}else{a.handleError(a8,a4,bc,bm)}a6();if(bk==="timeout"){a4.abort()}if(a8.async){a4=null}}}};try{var aZ=a4.abort;a4.abort=function(){if(a4){aZ.call(a4)}a7("abort")}}catch(be){}if(a8.async&&a8.timeout>0){setTimeout(function(){if(a4&&!a5){a7("timeout")}},a8.timeout)}try{a4.send(a0==="POST"||a0==="PUT"||a0==="DELETE"?a8.data:null)}catch(be){a.handleError(a8,a4,null,be);a6()}if(!a8.async){a7()}function a3(){if(a8.success){a8.success.call(bj,bh,bc,a4)}if(a8.global){a9("ajaxSuccess",[a4,a8])}}function a6(){if(a8.complete){a8.complete.call(bj,a4,bc)}if(a8.global){a9("ajaxComplete",[a4,a8])}if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}}function a9(bl,bk){(a8.context?a(a8.context):a.event).trigger(bl,bk)}return a4},handleError:function(aZ,a1,aY,a0){if(aZ.error){aZ.error.call(aZ.context||aZ,a1,aY,a0)}if(aZ.global){(aZ.context?a(aZ.context):a.event).trigger("ajaxError",[a1,aZ,a0])}},active:0,httpSuccess:function(aZ){try{return !aZ.status&&location.protocol==="file:"||(aZ.status>=200&&aZ.status<300)||aZ.status===304||aZ.status===1223||aZ.status===0}catch(aY){}return false},httpNotModified:function(a1,aY){var a0=a1.getResponseHeader("Last-Modified"),aZ=a1.getResponseHeader("Etag");if(a0){a.lastModified[aY]=a0}if(aZ){a.etag[aY]=aZ}return a1.status===304||a1.status===0},httpData:function(a3,a1,a0){var aZ=a3.getResponseHeader("content-type")||"",aY=a1==="xml"||!a1&&aZ.indexOf("xml")>=0,a2=aY?a3.responseXML:a3.responseText;if(aY&&a2.documentElement.nodeName==="parsererror"){a.error("parsererror")}if(a0&&a0.dataFilter){a2=a0.dataFilter(a2,a1)}if(typeof a2==="string"){if(a1==="json"||!a1&&aZ.indexOf("json")>=0){a2=a.parseJSON(a2)}else{if(a1==="script"||!a1&&aZ.indexOf("javascript")>=0){a.globalEval(a2)}}}return a2},param:function(aY,a1){var aZ=[];if(a1===C){a1=a.ajaxSettings.traditional}if(a.isArray(aY)||aY.jquery){a.each(aY,function(){a3(this.name,this.value)})}else{for(var a2 in aY){a0(a2,aY[a2])}}return aZ.join("&").replace(h,"+");function a0(a4,a5){if(a.isArray(a5)){a.each(a5,function(a7,a6){if(a1||/\[\]$/.test(a4)){a3(a4,a6)}else{a0(a4+"["+(typeof a6==="object"||a.isArray(a6)?a7:"")+"]",a6)}})}else{if(!a1&&a5!=null&&typeof a5==="object"){a.each(a5,function(a7,a6){a0(a4+"["+a7+"]",a6)})}else{a3(a4,a5)}}}function a3(a4,a5){a5=a.isFunction(a5)?a5():a5;aZ[aZ.length]=encodeURIComponent(a4)+"="+encodeURIComponent(a5)}}});var G={},ae=/toggle|show|hide/,au=/^([+-]=)?([\d+-.]+)(.*)$/,aF,aj=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.fn.extend({show:function(aZ,a7){if(aZ||aZ===0){return this.animate(aD("show",3),aZ,a7)}else{for(var a4=0,a1=this.length;a4<a1;a4++){var aY=a.data(this[a4],"olddisplay");this[a4].style.display=aY||"";if(a.css(this[a4],"display")==="none"){var a6=this[a4].nodeName,a5;if(G[a6]){a5=G[a6]}else{var a0=a("<"+a6+" />").appendTo("body");a5=a0.css("display");if(a5==="none"){a5="block"}a0.remove();G[a6]=a5}a.data(this[a4],"olddisplay",a5)}}for(var a3=0,a2=this.length;a3<a2;a3++){this[a3].style.display=a.data(this[a3],"olddisplay")||""}return this}},hide:function(a3,a4){if(a3||a3===0){return this.animate(aD("hide",3),a3,a4)}else{for(var a2=0,aZ=this.length;a2<aZ;a2++){var aY=a.data(this[a2],"olddisplay");if(!aY&&aY!=="none"){a.data(this[a2],"olddisplay",a.css(this[a2],"display"))}}for(var a1=0,a0=this.length;a1<a0;a1++){this[a1].style.display="none"}return this}},_toggle:a.fn.toggle,toggle:function(a0,aZ){var aY=typeof a0==="boolean";if(a.isFunction(a0)&&a.isFunction(aZ)){this._toggle.apply(this,arguments)}else{if(a0==null||aY){this.each(function(){var a1=aY?a0:a(this).is(":hidden");a(this)[a1?"show":"hide"]()})}else{this.animate(aD("toggle",3),a0,aZ)}}return this},fadeTo:function(aY,a0,aZ){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:a0},aY,aZ)},animate:function(a2,aZ,a1,a0){var aY=a.speed(aZ,a1,a0);if(a.isEmptyObject(a2)){return this.each(aY.complete)}return this[aY.queue===false?"each":"queue"](function(){var a5=a.extend({},aY),a7,a6=this.nodeType===1&&a(this).is(":hidden"),a3=this;for(a7 in a2){var a4=a7.replace(az,k);if(a7!==a4){a2[a4]=a2[a7];delete a2[a7];a7=a4}if(a2[a7]==="hide"&&a6||a2[a7]==="show"&&!a6){return a5.complete.call(this)}if((a7==="height"||a7==="width")&&this.style){a5.display=a.css(this,"display");a5.overflow=this.style.overflow}if(a.isArray(a2[a7])){(a5.specialEasing=a5.specialEasing||{})[a7]=a2[a7][1];a2[a7]=a2[a7][0]}}if(a5.overflow!=null){this.style.overflow="hidden"}a5.curAnim=a.extend({},a2);a.each(a2,function(a9,bd){var bc=new a.fx(a3,a5,a9);if(ae.test(bd)){bc[bd==="toggle"?a6?"show":"hide":bd](a2)}else{var bb=au.exec(bd),be=bc.cur(true)||0;if(bb){var a8=parseFloat(bb[2]),ba=bb[3]||"px";if(ba!=="px"){a3.style[a9]=(a8||1)+ba;be=((a8||1)/bc.cur(true))*be;a3.style[a9]=be+ba}if(bb[1]){a8=((bb[1]==="-="?-1:1)*a8)+be}bc.custom(be,a8,ba)}else{bc.custom(be,bd,"")}}});return true})},stop:function(aZ,aY){var a0=a.timers;if(aZ){this.queue([])}this.each(function(){for(var a1=a0.length-1;a1>=0;a1--){if(a0[a1].elem===this){if(aY){a0[a1](true)}a0.splice(a1,1)}}});if(!aY){this.dequeue()}return this}});a.each({slideDown:aD("show",1),slideUp:aD("hide",1),slideToggle:aD("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(aY,aZ){a.fn[aY]=function(a0,a1){return this.animate(aZ,a0,a1)}});a.extend({speed:function(a0,a1,aZ){var aY=a0&&typeof a0==="object"?a0:{complete:aZ||!aZ&&a1||a.isFunction(a0)&&a0,duration:a0,easing:aZ&&a1||a1&&!a.isFunction(a1)&&a1};aY.duration=a.fx.off?0:typeof aY.duration==="number"?aY.duration:a.fx.speeds[aY.duration]||a.fx.speeds._default;aY.old=aY.complete;aY.complete=function(){if(aY.queue!==false){a(this).dequeue()}if(a.isFunction(aY.old)){aY.old.call(this)}};return aY},easing:{linear:function(a0,a1,aY,aZ){return aY+aZ*a0},swing:function(a0,a1,aY,aZ){return((-Math.cos(a0*Math.PI)/2)+0.5)*aZ+aY}},timers:[],fx:function(aZ,aY,a0){this.options=aY;this.elem=aZ;this.prop=a0;if(!aY.orig){aY.orig={}}}});a.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(a.fx.step[this.prop]||a.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(aZ){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var aY=parseFloat(a.css(this.elem,this.prop,aZ));return aY&&aY>-10000?aY:parseFloat(a.curCSS(this.elem,this.prop))||0},custom:function(a2,a1,a0){this.startTime=aP();this.start=a2;this.end=a1;this.unit=a0||this.unit||"px";this.now=this.start;this.pos=this.state=0;var aY=this;function aZ(a3){return aY.step(a3)}aZ.elem=this.elem;if(aZ()&&a.timers.push(aZ)&&!aF){aF=setInterval(a.fx.tick,13)}},show:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());a(this.elem).show()},hide:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a1){var a6=aP(),a2=true;if(a1||a6>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var a3 in this.options.curAnim){if(this.options.curAnim[a3]!==true){a2=false}}if(a2){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var a0=a.data(this.elem,"olddisplay");this.elem.style.display=a0?a0:this.options.display;if(a.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){a(this.elem).hide()}if(this.options.hide||this.options.show){for(var aY in this.options.curAnim){a.style(this.elem,aY,this.options.orig[aY])}}this.options.complete.call(this.elem)}return false}else{var aZ=a6-this.startTime;this.state=aZ/this.options.duration;var a4=this.options.specialEasing&&this.options.specialEasing[this.prop];var a5=this.options.easing||(a.easing.swing?"swing":"linear");this.pos=a.easing[a4||a5](this.state,aZ,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};a.extend(a.fx,{tick:function(){var aZ=a.timers;for(var aY=0;aY<aZ.length;aY++){if(!aZ[aY]()){aZ.splice(aY--,1)}}if(!aZ.length){a.fx.stop()}},stop:function(){clearInterval(aF);aF=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(aY){a.style(aY.elem,"opacity",aY.now)},_default:function(aY){if(aY.elem.style&&aY.elem.style[aY.prop]!=null){aY.elem.style[aY.prop]=(aY.prop==="width"||aY.prop==="height"?Math.max(0,aY.now):aY.now)+aY.unit}else{aY.elem[aY.prop]=aY.now}}}});if(a.expr&&a.expr.filters){a.expr.filters.animated=function(aY){return a.grep(a.timers,function(aZ){return aY===aZ.elem}).length}}function aD(aZ,aY){var a0={};a.each(aj.concat.apply([],aj.slice(0,aY)),function(){a0[this]=aZ});return a0}if("getBoundingClientRect" in ab.documentElement){a.fn.offset=function(a7){var a0=this[0];if(a7){return this.each(function(a8){a.offset.setOffset(this,a7,a8)})}if(!a0||!a0.ownerDocument){return null}if(a0===a0.ownerDocument.body){return a.offset.bodyOffset(a0)}var a2=a0.getBoundingClientRect(),a6=a0.ownerDocument,a3=a6.body,aY=a6.documentElement,a1=aY.clientTop||a3.clientTop||0,a4=aY.clientLeft||a3.clientLeft||0,a5=a2.top+(self.pageYOffset||a.support.boxModel&&aY.scrollTop||a3.scrollTop)-a1,aZ=a2.left+(self.pageXOffset||a.support.boxModel&&aY.scrollLeft||a3.scrollLeft)-a4;return{top:a5,left:aZ}}}else{a.fn.offset=function(a9){var a3=this[0];if(a9){return this.each(function(ba){a.offset.setOffset(this,a9,ba)})}if(!a3||!a3.ownerDocument){return null}if(a3===a3.ownerDocument.body){return a.offset.bodyOffset(a3)}a.offset.initialize();var a0=a3.offsetParent,aZ=a3,a8=a3.ownerDocument,a6,a1=a8.documentElement,a4=a8.body,a5=a8.defaultView,aY=a5?a5.getComputedStyle(a3,null):a3.currentStyle,a7=a3.offsetTop,a2=a3.offsetLeft;while((a3=a3.parentNode)&&a3!==a4&&a3!==a1){if(a.offset.supportsFixedPosition&&aY.position==="fixed"){break}a6=a5?a5.getComputedStyle(a3,null):a3.currentStyle;a7-=a3.scrollTop;a2-=a3.scrollLeft;if(a3===a0){a7+=a3.offsetTop;a2+=a3.offsetLeft;if(a.offset.doesNotAddBorder&&!(a.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a3.nodeName))){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aZ=a0,a0=a3.offsetParent}if(a.offset.subtractsBorderForOverflowNotVisible&&a6.overflow!=="visible"){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aY=a6}if(aY.position==="relative"||aY.position==="static"){a7+=a4.offsetTop;a2+=a4.offsetLeft}if(a.offset.supportsFixedPosition&&aY.position==="fixed"){a7+=Math.max(a1.scrollTop,a4.scrollTop);a2+=Math.max(a1.scrollLeft,a4.scrollLeft)}return{top:a7,left:a2}}}a.offset={initialize:function(){var aY=ab.body,aZ=ab.createElement("div"),a2,a4,a3,a5,a0=parseFloat(a.curCSS(aY,"marginTop",true))||0,a1="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.extend(aZ.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});aZ.innerHTML=a1;aY.insertBefore(aZ,aY.firstChild);a2=aZ.firstChild;a4=a2.firstChild;a5=a2.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(a4.offsetTop!==5);this.doesAddBorderForTableAndCells=(a5.offsetTop===5);a4.style.position="fixed",a4.style.top="20px";this.supportsFixedPosition=(a4.offsetTop===20||a4.offsetTop===15);a4.style.position=a4.style.top="";a2.style.overflow="hidden",a2.style.position="relative";this.subtractsBorderForOverflowNotVisible=(a4.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(aY.offsetTop!==a0);aY.removeChild(aZ);aY=aZ=a2=a4=a3=a5=null;a.offset.initialize=a.noop},bodyOffset:function(aY){var a0=aY.offsetTop,aZ=aY.offsetLeft;a.offset.initialize();if(a.offset.doesNotIncludeMarginInBodyOffset){a0+=parseFloat(a.curCSS(aY,"marginTop",true))||0;aZ+=parseFloat(a.curCSS(aY,"marginLeft",true))||0}return{top:a0,left:aZ}},setOffset:function(a3,aZ,a0){if(/static/.test(a.curCSS(a3,"position"))){a3.style.position="relative"}var a2=a(a3),a5=a2.offset(),aY=parseInt(a.curCSS(a3,"top",true),10)||0,a4=parseInt(a.curCSS(a3,"left",true),10)||0;if(a.isFunction(aZ)){aZ=aZ.call(a3,a0,a5)}var a1={top:(aZ.top-a5.top)+aY,left:(aZ.left-a5.left)+a4};if("using" in aZ){aZ.using.call(a3,a1)}else{a2.css(a1)}}};a.fn.extend({position:function(){if(!this[0]){return null}var a0=this[0],aZ=this.offsetParent(),a1=this.offset(),aY=/^body|html$/i.test(aZ[0].nodeName)?{top:0,left:0}:aZ.offset();a1.top-=parseFloat(a.curCSS(a0,"marginTop",true))||0;a1.left-=parseFloat(a.curCSS(a0,"marginLeft",true))||0;aY.top+=parseFloat(a.curCSS(aZ[0],"borderTopWidth",true))||0;aY.left+=parseFloat(a.curCSS(aZ[0],"borderLeftWidth",true))||0;return{top:a1.top-aY.top,left:a1.left-aY.left}},offsetParent:function(){return this.map(function(){var aY=this.offsetParent||ab.body;while(aY&&(!/^body|html$/i.test(aY.nodeName)&&a.css(aY,"position")==="static")){aY=aY.offsetParent}return aY})}});a.each(["Left","Top"],function(aZ,aY){var a0="scroll"+aY;a.fn[a0]=function(a3){var a1=this[0],a2;if(!a1){return null}if(a3!==C){return this.each(function(){a2=am(this);if(a2){a2.scrollTo(!aZ?a3:a(a2).scrollLeft(),aZ?a3:a(a2).scrollTop())}else{this[a0]=a3}})}else{a2=am(a1);return a2?("pageXOffset" in a2)?a2[aZ?"pageYOffset":"pageXOffset"]:a.support.boxModel&&a2.document.documentElement[a0]||a2.document.body[a0]:a1[a0]}}});function am(aY){return("scrollTo" in aY&&aY.document)?aY:aY.nodeType===9?aY.defaultView||aY.parentWindow:false}a.each(["Height","Width"],function(aZ,aY){var a0=aY.toLowerCase();a.fn["inner"+aY]=function(){return this[0]?a.css(this[0],a0,false,"padding"):null};a.fn["outer"+aY]=function(a1){return this[0]?a.css(this[0],a0,false,a1?"margin":"border"):null};a.fn[a0]=function(a1){var a2=this[0];if(!a2){return a1==null?null:this}if(a.isFunction(a1)){return this.each(function(a4){var a3=a(this);a3[a0](a1.call(this,a4,a3[a0]()))})}return("scrollTo" in a2&&a2.document)?a2.document.compatMode==="CSS1Compat"&&a2.document.documentElement["client"+aY]||a2.document.body["client"+aY]:(a2.nodeType===9)?Math.max(a2.documentElement["client"+aY],a2.body["scroll"+aY],a2.documentElement["scroll"+aY],a2.body["offset"+aY],a2.documentElement["offset"+aY]):a1===C?a.css(a2,a0):this.css(a0,typeof a1==="string"?a1:a1+"px")}});aM.jQuery=aM.$=a})(window);(function(bU,r,bi){var b8=bU.jQuery.noConflict(true);if(typeof r.getAttribute==q){r.getAttribute=function(){}}var am=function(cV){return ci(cV)?cV.toLowerCase():cV};var bI=function(cV){return ci(cV)?cV.toUpperCase():cV};var aE=function(cV){return ci(cV)?cV.replace(/[A-Z]/g,function(cW){return G(cW.charCodeAt(0)|32)}):cV};var ce=function(cV){return ci(cV)?cV.replace(/[a-z]/g,function(cW){return G(cW.charCodeAt(0)&~32)}):cV};if("i"!=="I".toLowerCase()){am=aE;bI=ce}function G(cV){return String.fromCharCode(cV)}var cS=undefined,a6=null,by="$element",ac="$update",bR="$scope",bf="$validate",R="angular",a3="array",b9="boolean",bA="console",bc="date",aL="display",cC="element",bz="function",ai="length",Y="name",b="none",cE="noop",v="null",ch="number",aP="object",P="string",ay="value",aA="selected",q="undefined",a="ng-exception",k="ng-validation-error",o="noop",bp=-99999,an=-1000,cg=99999,aM={FIRST:bp,LAST:cg,WATCH:an},cK=bU.Error,cx=bU.jQuery||bU["$"],ca=bU._,at=parseInt((/msie (\d+)/.exec(am(navigator.userAgent))||[])[1],10),ck=cx||cL,ad=Array.prototype.slice,C=Array.prototype.push,cG=bU[bA]?bF(bU[bA],bU[bA]["error"]||j):j,aB=bU[R]||(bU[R]={}),ag=bo(aB,"markup"),s=bo(aB,"attrMarkup"),Z=bo(aB,"directive"),B=bo(aB,"widget",am),aK=bo(aB,"validator"),cu=bo(aB,"filter"),l=bo(aB,"formatter"),bs=bo(aB,"service"),bg=bo(aB,"callbacks"),au,ab=/^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/;function aS(cY,cX,cW){var cV;if(cY){if(E(cY)){for(cV in cY){if(cV!="prototype"&&cV!=ai&&cV!=Y&&cY.hasOwnProperty(cV)){cX.call(cW,cY[cV],cV)}}}else{if(cY.forEach){cY.forEach(cX,cW)}else{if(cR(cY)&&aU(cY.length)){for(cV=0;cV<cY.length;cV++){cX.call(cW,cY[cV],cV)}}else{for(cV in cY){cX.call(cW,cY[cV],cV)}}}}}return cY}function ar(c0,cY,cX){var cZ=[];for(var cW in c0){cZ.push(cW)}cZ.sort();for(var cV=0;cV<cZ.length;cV++){cY.call(cX,c0[cZ[cV]],cZ[cV])}return cZ}function bb(cV){if(cV instanceof cK){if(cV.stack){cV=cV.stack}else{if(cV.sourceURL){cV=cV.message+"\n"+cV.sourceURL+":"+cV.line}}}return cV}function b7(cV){aS(arguments,function(cW){if(cW!==cV){aS(cW,function(cY,cX){cV[cX]=cY})}});return cV}function b5(cW,cV){return b7(new (b7(function(){},{prototype:cW}))(),cV)}function j(){}function aG(cV){return cV}function cr(cV){return function(){return cV}}function bo(cX,cW,cV){var cY;return cX[cW]||(cY=cX[cW]=function(cZ,c0,c1){cZ=(cV||aG)(cZ);if(cv(c0)){if(cv(cY[cZ])){aS(cY[cZ],function(c3,c2){if(c2.charAt(0)=="$"&&bB(c0[c2])){c0[c2]=c3}})}cY[cZ]=b7(c0,c1||{})}return cY[cZ]})}function cL(cV){if(cV){if(ci(cV)){var cW=r.createElement("div");cW.innerHTML=cV;cV=new bu(cW.childNodes)}else{if(!(cV instanceof bu)&&bJ(cV)){cV=new bu(cV)}}}return cV}function bB(cV){return typeof cV==q}function cv(cV){return typeof cV!=q}function cR(cV){return cV!=a6&&typeof cV==aP}function ci(cV){return typeof cV==P}function aU(cV){return typeof cV==ch}function ax(cV){return cV instanceof Date}function a9(cV){return cV instanceof Array}function E(cV){return typeof cV==bz}function be(cV){return typeof cV==b9}function t(cV){return au(cV)=="#text"}function av(cV){return ci(cV)?cV.replace(/^\s*/,"").replace(/\s*$/,""):cV}function bJ(cV){return cV&&(cV.nodeName||cV instanceof bu||(cx&&cV instanceof cx))}function aW(cW,cX){this.html=cW;this.get=am(cX)=="unsafe"?cr(cW):function cV(){var cY=[];aQ(cW,a5(cY));return cY.join("")}}if(at){au=function(cV){cV=cV.nodeName?cV:cV[0];return(cV.scopeName&&cV.scopeName!="HTML")?bI(cV.scopeName+":"+cV.nodeName):cV.nodeName}}else{au=function(cV){return cV.nodeName?cV.nodeName:cV[0].nodeName}}function A(cV){return ck(cV[0].cloneNode(true))}function aR(cW){var cY=cW[0].getBoundingClientRect(),cX=(cY.width||(cY.right||0-cY.left||0)),cV=(cY.height||(cY.bottom||0-cY.top||0));return cX>0&&cV>0}function aI(cY,cX,cW){var cV=[];aS(cY,function(c1,cZ,c0){cV.push(cX.call(cW,c1,cZ,c0))});return cV}function aw(cW){var cV=0;if(cW){if(aU(cW.length)){return cW.length}else{if(cR(cW)){for(key in cW){cV++}}}}return cV}function u(cX,cW){for(var cV=0;cV<cX.length;cV++){if(cW===cX[cV]){return true}}return false}function cO(cX,cW){for(var cV=0;cV<cX.length;cV++){if(cW===cX[cV]){return cV}}return -1}function b4(cV){if(cV){switch(cV.nodeName){case"OPTION":case"PRE":case"TITLE":return true}}return false}function bv(cY,cV){if(!cV){cV=cY;if(cY){if(a9(cY)){cV=bv(cY,[])}else{if(ax(cY)){cV=new Date(cY.getTime())}else{if(cR(cY)){cV=bv(cY,{})}}}}}else{if(a9(cY)){while(cV.length){cV.pop()}for(var cX=0;cX<cY.length;cX++){cV.push(bv(cY[cX]))}}else{aS(cV,function(c0,cZ){delete cV[cZ]});for(var cW in cY){cV[cW]=bv(cY[cW])}}}return cV}function p(c1,c0){if(c1==c0){return true}var cZ=typeof c1,cX=typeof c0,cY,cW,cV;if(cZ==cX&&cZ=="object"){if(c1 instanceof Array){if((cY=c1.length)==c0.length){for(cW=0;cW<cY;cW++){if(!p(c1[cW],c0[cW])){return false}}return true}}else{cV={};for(cW in c1){if(cW.charAt(0)!=="$"&&!E(c1[cW])&&!p(c1[cW],c0[cW])){return false}cV[cW]=true}for(cW in c0){if(!cV[cW]&&cW.charAt(0)!=="$"&&!E(c0[cW])){return false}}return true}}return false}function U(cW,cV){if(b4(cW)){if(at){cW.innerText=cV}else{cW.textContent=cV}}else{cW.innerHTML=cV}}function bM(cW){var cV=cW&&cW[0]&&cW[0].nodeName;return cV&&cV.charAt(0)!="#"&&!u(["TR","COL","COLGROUP","TBODY","THEAD","TFOOT"],cV)}function b0(cW,cX,cV){while(!bM(cW)){cW=cW.parent()||ck(r.body)}if(cW[0]["$NG_ERROR"]!==cV){cW[0]["$NG_ERROR"]=cV;if(cV){cW.addClass(cX);cW.attr(cX,cV)}else{cW.removeClass(cX);cW.removeAttr(cX)}}}function bd(cX,cW,cV){return cX.concat(ad.call(cW,cV,cW.length))}function bF(cW,cX){var cV=arguments.length>2?ad.call(arguments,2,arguments.length):[];if(typeof cX==bz){return cV.length?function(){return arguments.length?cX.apply(cW,cV.concat(ad.call(arguments,0,arguments.length))):cX.apply(cW,cV)}:function(){return arguments.length?cX.apply(cW,arguments):cX.call(cW)}}else{return cX}}function cp(cW){if(cW&&cW.length!==0){var cV=am(""+cW);cW=!(cV=="f"||cV=="0"||cV=="false"||cV=="no"||cV=="n"||cV=="[]")}else{cW=false}return cW}function bm(cY,cZ){for(var cV in cY){var cX=cZ[cV];var cW=typeof cX;if(cW==q){cZ[cV]=Q(cm(cY[cV]))}else{if(cW=="object"&&cX.constructor!=F&&cV.substring(0,1)!="$"){bm(cY[cV],cX)}}}}function a2(cW,cY){var cX=new ba(ag,s,Z,B),cV=ck(cW);return cX.compile(cV)(cV,cY)}function ah(cY){var cX={},cV,cW;aS((cY||"").split("&"),function(cZ){if(cZ){cV=cZ.split("=");cW=unescape(cV[0]);cX[cW]=cv(cV[1])?unescape(cV[1]):true}});return cX}function N(cW){var cV=[];aS(cW,function(cY,cX){cV.push(escape(cX)+(cY===true?"":"="+escape(cY)))});return cV.length?cV.join("&"):""}function bw(cW){if(cW.autobind){var cX=a2(bU.document,a6,{"$config":cW}),cV=cX.$inject("$browser");if(cW.css){cV.addCss(cW.base_url+cW.css)}else{if(at<8){cV.addJs(cW.base_url+cW.ie_compat,cW.ie_compat_id)}}cX.$init()}}function bH(cW,cZ){var cV=cW.getElementsByTagName("script"),cY;cZ=b7({ie_compat_id:"ng-ie-compat"},cZ);for(var cX=0;cX<cV.length;cX++){cY=(cV[cX].src||"").match(ab);if(cY){cZ.base_url=cY[1];cZ.ie_compat=cY[1]+"angular-ie-compat"+(cY[2]||"")+".js";b7(cZ,ah(cY[6]));a4(ck(cV[cX]),function(c1,c0){if(/^ng:/.exec(c0)){c0=c0.substring(3).replace(/-/g,"_");if(c0=="autobind"){c1=true}cZ[c0]=c1}})}}return cZ}var F=[].constructor;function cm(cX,cW){var cV=[];bS(cV,cX,cW?"\n ":a6,[]);return cV.join("")}function Q(cV){if(!cV){return cV}try{var cX=S(cV,true);var cY=cX.primary();cX.assertAllConsumed();return cY()}catch(cW){cG("fromJson error: ",cV,cW);throw cW}}aB.toJson=cm;aB.fromJson=Q;function bS(cW,cY,c1,c2){if(cR(cY)){if(cY===bU){cW.push("WINDOW");return}if(cY===r){cW.push("DOCUMENT");return}if(u(c2,cY)){cW.push("RECURSION");return}c2.push(cY)}if(cY===a6){cW.push(v)}else{if(cY instanceof RegExp){cW.push(aB.String["quoteUnicode"](cY.toString()))}else{if(E(cY)){return}else{if(be(cY)){cW.push(""+cY)}else{if(aU(cY)){if(isNaN(cY)){cW.push(v)}else{cW.push(""+cY)}}else{if(ci(cY)){return cW.push(aB.String["quoteUnicode"](cY))}else{if(cR(cY)){if(a9(cY)){cW.push("[");var c0=cY.length;var c9=false;for(var cZ=0;cZ<c0;cZ++){var c6=cY[cZ];if(c9){cW.push(",")}if(!(c6 instanceof RegExp)&&(E(c6)||bB(c6))){cW.push(v)}else{bS(cW,c6,c1,c2)}c9=true}cW.push("]")}else{if(ax(cY)){cW.push(aB.String["quoteUnicode"](aB.Date["toString"](cY)))}else{cW.push("{");if(c1){cW.push(c1)}var c8=false;var c7=c1?c1+" ":false;var c5=[];for(var cX in cY){if(cY[cX]===cS){continue}c5.push(cX)}c5.sort();for(var cV=0;cV<c5.length;cV++){var c4=c5[cV];var c3=cY[c4];if(typeof c3!=bz){if(c8){cW.push(",");if(c1){cW.push(c1)}}cW.push(aB.String["quote"](c4));cW.push(":");bS(cW,c3,c7,c2);c8=true}}cW.push("}")}}}}}}}}}if(cR(cY)){c2.pop()}}function cw(cV){this.paths=[];this.children=[];this.inits=[];this.priority=cV;this.newScope=false}cw.prototype={init:function(cV,cW){var cX={};this.collectInits(cV,cX,cW);ar(cX,function(cY){aS(cY,function(cZ){cZ()})})},collectInits:function(cX,c0,c3){var cZ=c0[this.priority],c1=c3;if(!cZ){c0[this.priority]=cZ=[]}cX=ck(cX);if(this.newScope){c1=bV(c3);c3.$onEval(c1.$eval);cX.data(bR,c1)}aS(this.inits,function(c5){cZ.push(function(){c1.$tryEval(function(){return c1.$inject(c5,c1,cX)},cX)})});var cY,c2=cX[0].childNodes,cW=this.children,c4=this.paths,cV=c4.length;for(cY=0;cY<cV;cY++){cW[cY].collectInits(c2[c4[cY]],c0,c1)}},addInit:function(cV){if(cV){this.inits.push(cV)}},addChild:function(cV,cW){if(cW){this.paths.push(cV);this.children.push(cW)}},empty:function(){return this.inits.length===0&&this.paths.length===0}};function ae(cV){var cW;while(cV&&!(cW=cV.data(bR))){cV=cV.parent()}return cW}function ba(cV,cW,cY,cX){this.markup=cV;this.attrMarkup=cW;this.directives=cY;this.widgets=cX}ba.prototype={compile:function(cZ){cZ=ck(cZ);var cV=0,cY,cX=cZ.parent();if(cX&&cX[0]){cX=cX[0];for(var cW=0;cW<cX.childNodes.length;cW++){if(cX.childNodes[cW]==cZ[0]){cV=cW}}}cY=this.templatize(cZ,cV,0)||new cw();return function(c0,c2){c0=ck(c0);var c1=c2&&c2.$eval?c2:bV(c2);c0.data(bR,c1);return b7(c1,{$element:c0,$init:function(){cY.init(c0,c1);c1.$eval();delete c1.$init;return c1}})}},templatize:function(c0,cW,c5){var c9=this,c1,c4,cX=c9.directives,c3=true,cY=true,da=au(c0),c8,c7={compile:bF(c9,c9.compile),comment:function(db){return ck(r.createComment(db))},element:function(db){return ck(r.createElement(db))},text:function(db){return ck(r.createTextNode(db))},descend:function(db){if(cv(db)){c3=db}return c3},directives:function(db){if(cv(db)){cY=db}return cY},scope:function(db){if(cv(db)){c8.newScope=c8.newScope||db}return c8.newScope}};try{c5=c0.attr("ng:eval-order")||c5||0}catch(c2){c5=c5||0}if(ci(c5)){c5=aM[bI(c5)]||parseInt(c5,10)}c8=new cw(c5);a4(c0,function(dc,db){if(!c1){if(c1=c9.widgets("@"+db)){c0.addClass("ng-attr-widget");c1=bF(c7,c1,dc,c0)}}});if(!c1){if(c1=c9.widgets(da)){if(da.indexOf(":")>0){c0.addClass("ng-widget")}c1=bF(c7,c1,c0)}}if(c1){c3=false;cY=false;var c6=c0.parent();c8.addInit(c1.call(c7,c0));if(c6&&c6[0]){c0=ck(c6[0].childNodes[cW])}}if(c3){for(var cZ=0,cV=c0[0].childNodes;cZ<cV.length;cZ++){if(t(cV[cZ])){aS(c9.markup,function(db){if(cZ<cV.length){var dc=ck(cV[cZ]);db.call(c7,dc.text(),dc,c0)}})}}}if(cY){a4(c0,function(dc,db){aS(c9.attrMarkup,function(dd){dd.call(c7,dc,db,c0)})});a4(c0,function(dc,db){c4=cX[db];if(c4){c0.addClass("ng-directive");c8.addInit((cX[db]).call(c7,dc,c0))}})}if(c3){aX(c0,function(dc,db){c8.addChild(db,c9.templatize(dc,db,c5))})}return c8.empty()?a6:c8}};function aX(cW,cX){var cV,cZ=cW[0].childNodes||[],cY;for(cV=0;cV<cZ.length;cV++){if(!t(cY=cZ[cV])){cX(ck(cY),cV)}}}function a4(cW,c0){var cX,c3=cW[0].attributes||[],c2,cZ,cV,c1,cY={};for(cX=0;cX<c3.length;cX++){cZ=c3[cX];cV=cZ.name;c1=cZ.value;if(at&&cV=="href"){c1=decodeURIComponent(cW[0].getAttribute(cV,2))}cY[cV]=c1}ar(cY,c0)}function bQ(c3,c4,c1){if(!c4){return c3}var cW=c4.split(".");var c2;var cV=c3;var cY=cW.length;for(var cX=0;cX<cY;cX++){c2=cW[cX];if(!c2.match(/^[\$\w][\$\w\d]*$/)){throw"Expression '"+c4+"' is not a valid expression for accesing variables."}if(c3){cV=c3;c3=c3[c2]}if(bB(c3)&&c2.charAt(0)=="$"){var cZ=aB.Global["typeOf"](cV);cZ=aB[cZ.charAt(0).toUpperCase()+cZ.substring(1)];var c0=cZ?cZ[[c2.substring(1)]]:cS;if(c0){c3=bF(cV,c0,cV);return c3}}}if(!c1&&E(c3)){return bF(cV,c3)}return c3}function cd(cV,c1,c0){var cZ=c1.split(".");for(var cY=0;cZ.length>1;cY++){var cX=cZ.shift();var cW=cV[cX];if(!cW){cW={};cV[cX]=cW}cV=cW}cV[cZ.shift()]=c0;return c0}var az=0,cD={},aN={},cN={};aS(("abstract,boolean,break,byte,case,catch,char,class,const,continue,debugger,default,delete,do,double,else,enum,export,extends,false,final,finally,float,for,function,goto,if,implements,import,ininstanceof,intinterface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,typeof,var,volatile,void,undefined,while,with").split(/,/),function(cV){cN[cV]=true});function co(cX){var cV=cD[cX];if(cV){return cV}var cW="var l, fn, t;\n";aS(cX.split("."),function(cZ){cZ=(cN[cZ])?'["'+cZ+'"]':"."+cZ;cW+="if(!s) return s;\nl=s;\ns=s"+cZ+';\nif(typeof s=="function") s = function(){ return l'+cZ+".apply(l, arguments); };\n";if(cZ.charAt(1)=="$"){var cY=cZ.substr(2);cW+='if(!s) {\n t = angular.Global.typeOf(l);\n fn = (angular[t.charAt(0).toUpperCase() + t.substring(1)]||{})["'+cY+'"];\n if (fn) s = function(){ return fn.apply(l, [l].concat(Array.prototype.slice.call(arguments, 0, arguments.length))); };\n}\n'}});cW+="return s;";cV=Function("s",cW);cV.toString=function(){return cW};return cD[cX]=cV}function bt(cY){if(typeof cY===bz){return cY}var cV=aN[cY];if(!cV){var cW=S(cY);var cX=cW.statements();cW.assertAllConsumed();cV=aN[cY]=b7(function(){return cX(this)},{fnSelf:cX})}return cV}function ao(cW,cV){b0(cW,a,cv(cV)?bb(cV):cV)}function bV(cY,c0,cW){function cX(){}cY=cX.prototype=(cY||{});var cV=new cX();var cZ={sorted:[]};b7(cV,{"this":cV,$id:(az++),$parent:cY,$bind:bF(cV,bF,cV),$get:bF(cV,bQ,cV),$set:bF(cV,cd,cV),$eval:function(c7){var c6=typeof c7;var c4,c3;var c2,c8;var c1;var c5;if(c6==q){for(c4=0,c3=cZ.sorted.length;c4<c3;c4++){for(c1=cZ.sorted[c4],c8=c1.length,c2=0;c2<c8;c2++){cV.$tryEval(c1[c2].fn,c1[c2].handler)}}}else{if(c6===bz){return c7.call(cV)}else{if(c6==="string"){return bt(c7).call(cV)}}}},$tryEval:function(c4,c1){var c2=typeof c4;try{if(c2==bz){return c4.call(cV)}else{if(c2=="string"){return bt(c4).call(cV)}}}catch(c3){(cV.$log||{error:cG}).error(c3);if(E(c1)){c1(c3)}else{if(c1){ao(c1,c3)}else{if(E(cV.$exceptionHandler)){cV.$exceptionHandler(c3)}}}}},$watch:function(c6,c5,c2,c1){var c7=bt(c6),c4=c7.call(cV);c5=bt(c5);function c3(da){var c9=c7.call(cV),c8=c4;if(da||c8!==c9){c4=c9;cV.$tryEval(function(){return c5.call(cV,c9,c8)},c2)}}cV.$onEval(an,c3);if(bB(c1)){c1=true}if(c1){c3(true)}},$onEval:function(c2,c4,c1){if(!aU(c2)){c1=c4;c4=c2;c2=0}var c3=cZ[c2];if(!c3){c3=cZ[c2]=[];c3.priority=c2;cZ.sorted.push(c3);cZ.sorted.sort(function(c6,c5){return c6.priority-c5.priority})}c3.push({fn:bt(c4),handler:c1})},$become:function(c1){if(E(c1)){cV.constructor=c1;aS(c1.prototype,function(c3,c2){cV[c2]=bF(cV,c3)});cV.$inject.apply(cV,bd([c1,cV],arguments,1));if(E(c1.prototype.init)){cV.init()}}},$new:function(c1){var c2=bV(cV);c2.$become.apply(cV,bd([c1],arguments,1));cV.$onEval(c2.$eval);return c2}});if(!cY.$root){cV.$root=cV;cV.$parent=cV;(cV.$inject=bY(cV,c0,cW))()}return cV}function bY(cW,cY,cV){cY=cY||bs;cV=cV||{};cW=cW||{};return function cX(c3,c2,c0){var c1,c4,cZ;if(ci(c3)){if(!cV.hasOwnProperty(c3)){c4=cY[c3];if(!c4){throw"Unknown provider for '"+c3+"'."}cV[c3]=cX(c4,cW)}c1=cV[c3]}else{if(a9(c3)){c1=[];aS(c3,function(c5){c1.push(cX(c5))})}else{if(E(c3)){c1=cX(c3.$inject||[]);c1=c3.apply(c2,bd(c1,arguments,2))}else{if(cR(c3)){aS(cY,function(c6,c5){cZ=c6.$creation;if(cZ=="eager"){cX(c5)}if(cZ=="eager-published"){cd(c3,c5,cX(c5))}})}else{c1=cX(cW)}}}}return c1}}var J={"null":function(cV){return a6},"true":function(cV){return true},"false":function(cV){return false},$undefined:j,"+":function(cX,cW,cV){return(cv(cW)?cW:0)+(cv(cV)?cV:0)},"-":function(cX,cW,cV){return(cv(cW)?cW:0)-(cv(cV)?cV:0)},"*":function(cX,cW,cV){return cW*cV},"/":function(cX,cW,cV){return cW/cV},"%":function(cX,cW,cV){return cW%cV},"^":function(cX,cW,cV){return cW^cV},"=":function(cX,cW,cV){return cd(cX,cW,cV)},"==":function(cX,cW,cV){return cW==cV},"!=":function(cX,cW,cV){return cW!=cV},"<":function(cX,cW,cV){return cW<cV},">":function(cX,cW,cV){return cW>cV},"<=":function(cX,cW,cV){return cW<=cV},">=":function(cX,cW,cV){return cW>=cV},"&&":function(cX,cW,cV){return cW&&cV},"||":function(cX,cW,cV){return cW||cV},"&":function(cX,cW,cV){return cW&cV},"|":function(cX,cW,cV){return cV(cX,cW)},"!":function(cW,cV){return !cV}};var T={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'};function bq(c9,cZ){var de=cZ?24:-1,db=[],c4,c3=0,dg=[],c7,di=":";while(c3<c9.length){c7=c9.charAt(c3);if(c2("\"'")){cX(c7)}else{if(da(c7)||c2(".")&&da(dd())){cY()}else{if(c6("({[:,;")&&c2("/")){cW()}else{if(dc(c7)){c8();if(c6("{,")&&dg[0]=="{"&&(c4=db[db.length-1])){c4.json=c4.text.indexOf(".")==-1}}else{if(c2("(){}[].,;:")){db.push({index:c3,text:c7,json:c2("{}[]:,")});if(c2("{[")){dg.unshift(c7)}if(c2("}]")){dg.shift()}c3++}else{if(c1(c7)){c3++;continue}else{var cV=c7+dd(),c5=J[c7],df=J[cV];if(df){db.push({index:c3,text:cV,fn:df});c3+=2}else{if(c5){db.push({index:c3,text:c7,fn:c5,json:c6("[,:")&&c2("+-")});c3+=1}else{dh("Unexpected next character ",c3,c3+1)}}}}}}}}di=c7}return db;function c2(dj){return dj.indexOf(c7)!=-1}function c6(dj){return dj.indexOf(di)!=-1}function dd(){return c3+1<c9.length?c9.charAt(c3+1):false}function da(dj){return"0"<=dj&&dj<="9"}function c1(dj){return dj==" "||dj=="\r"||dj=="\t"||dj=="\n"||dj=="\v"||dj=="\u00A0"}function dc(dj){return"a"<=dj&&dj<="z"||"A"<=dj&&dj<="Z"||"_"==dj||dj=="$"}function c0(dj){return dj=="-"||dj=="+"||da(dj)}function dh(dk,dl,dj){dj=dj||c3;throw cK("Lexer Error: "+dk+" at column"+(cv(dl)?"s "+dl+"-"+c3+" ["+c9.substring(dl,dj)+"]":" "+dj)+" in expression ["+c9+"].")}function cY(){var dl="";var dm=c3;while(c3<c9.length){var dk=am(c9.charAt(c3));if(dk=="."||da(dk)){dl+=dk}else{var dj=dd();if(dk=="e"&&c0(dj)){dl+=dk}else{if(c0(dk)&&dj&&da(dj)&&dl.charAt(dl.length-1)=="e"){dl+=dk}else{if(c0(dk)&&(!dj||!da(dj))&&dl.charAt(dl.length-1)=="e"){dh("Invalid exponent")}else{break}}}}c3++}dl=1*dl;db.push({index:dm,text:dl,json:true,fn:function(){return dl}})}function c8(){var dl="";var dm=c3;while(c3<c9.length){var dk=c9.charAt(c3);if(dk=="."||dc(dk)||da(dk)){dl+=dk}else{break}c3++}var dj=J[dl];if(!dj){dj=co(dl);dj.isAssignable=dl}db.push({index:dm,text:dl,fn:dj,json:J[dl]})}function cX(dj){var dr=c3;c3++;var dk="";var dl=dj;var dp=false;while(c3<c9.length){var dm=c9.charAt(c3);dl+=dm;if(dp){if(dm=="u"){var dn=c9.substring(c3+1,c3+5);if(!dn.match(/[\da-f]{4}/i)){dh("Invalid unicode escape [\\u"+dn+"]")}c3+=4;dk+=String.fromCharCode(parseInt(dn,16))}else{var dq=T[dm];if(dq){dk+=dq}else{dk+=dm}}dp=false}else{if(dm=="\\"){dp=true}else{if(dm==dj){c3++;db.push({index:dr,text:dl,string:dk,json:true,fn:function(){return(dk.length==de)?aB.String["toDate"](dk):dk}});return}else{dk+=dm}}}c3++}dh("Unterminated quote",dr)}function cW(dl){var dq=c3;c3++;var dp="";var dn=false;while(c3<c9.length){var dm=c9.charAt(c3);if(dn){dp+=dm;dn=false}else{if(dm==="\\"){dp+=dm;dn=true}else{if(dm==="/"){c3++;var dj="";if(dc(c9.charAt(c3))){c8();dj=db.pop().text}var dk=new RegExp(dp,dj);db.push({index:dq,text:dp,flags:dj,fn:function(){return dk}});return}else{dp+=dm}}}c3++}dh("Unterminated RegExp",dq)}}function S(dj,ds){var c9=cr(0),dm=bq(dj,ds);return{assertAllConsumed:de,primary:dc,statements:c0,validator:dt,filter:dn,watch:dd};function c7(dx,dw){throw cK("Parse Error: Token '"+dw.text+"' "+dx+" at column "+(dw.index+1)+" of expression ["+dj+"] starting at ["+dj.substring(dw.index)+"].")}function c1(){if(dm.length===0){throw cK("Unexpected end of expression: "+dj)}return dm[0]}function c3(dB,dA,dz,dy){if(dm.length>0){var dx=dm[0];var dw=dx.text;if(dw==dB||dw==dA||dw==dz||dw==dy||(!dB&&!dA&&!dz&&!dy)){return dx}}return false}function cX(dA,dz,dy,dx){var dw=c3(dA,dz,dy,dx);if(dw){if(ds&&!dw.json){index=dw.index;c7("is not valid json",dw)}dm.shift();this.currentToken=dw;return dw}return false}function dg(dw){if(!cX(dw)){c7("is unexpected, expecting ["+dw+"]",c3())}}function c8(dx,dw){return function(dy){return dx(dy,dw(dy))}}function du(dy,dx,dw){return function(dz){return dx(dz,dy(dz),dw(dz))}}function c6(){return dm.length>0}function de(){if(dm.length!==0){c7("is extra token not part of expression",dm[0])}}function c0(){var dw=[];while(true){if(dm.length>0&&!c3("}",")",";","]")){dw.push(c4())}if(!cX(";")){return function(dx){var dA;for(var dy=0;dy<dw.length;dy++){var dz=dw[dy];if(dz){dA=dz(dx)}}return dA}}}}function c4(){var dx=di();var dw;while(true){if((dw=cX("|"))){dx=du(dx,dw.fn,dn())}else{return dx}}}function dn(){return cV(cu)}function dt(){return cV(aK)}function cV(dy){var dz=cY(dy);var dw=[];var dx;while(true){if((dx=cX(":"))){dw.push(di())}else{var dA=function(dC,dB){var dD=[dB];for(var dE=0;dE<dw.length;dE++){dD.push(dw[dE](dC))}return dz.apply(dC,dD)};return function(){return dA}}}}function di(){return da()}function da(){var dy=dq();var dw;if(dw=cX("=")){if(!dy.isAssignable){c7("implies assignment but ["+dj.substring(0,dw.index)+"] can not be assigned to",dw)}var dx=function(){return dy.isAssignable};return du(dx,dw.fn,dq())}else{return dy}}function dq(){var dx=c5();var dw;while(true){if((dw=cX("||"))){dx=du(dx,dw.fn,c5())}else{return dx}}}function c5(){var dx=cZ();var dw;if((dw=cX("&&"))){dx=du(dx,dw.fn,c5())}return dx}function cZ(){var dx=dk();var dw;if((dw=cX("==","!="))){dx=du(dx,dw.fn,cZ())}return dx}function dk(){var dx=dl();var dw;if(dw=cX("<",">","<=",">=")){dx=du(dx,dw.fn,dk())}return dx}function dl(){var dx=cW();var dw;while(dw=cX("+","-")){dx=du(dx,dw.fn,cW())}return dx}function cW(){var dx=df();var dw;while(dw=cX("*","/","%")){dx=du(dx,dw.fn,df())}return dx}function df(){var dw;if(cX("+")){return dc()}else{if(dw=cX("-")){return du(c9,dw.fn,df())}else{if(dw=cX("!")){return c8(dw.fn,df())}else{return dc()}}}}function cY(dB){var dA=cX();var dz=dA.text.split(".");var dw=dB;var dy;for(var dx=0;dx<dz.length;dx++){dy=dz[dx];if(dw){dw=dw[dy]}}if(typeof dw!=bz){c7("should be a function",dA)}return dw}function dc(){var dy;if(cX("(")){var dz=c4();dg(")");dy=dz}else{if(cX("[")){dy=c2()}else{if(cX("{")){dy=dr()}else{var dw=cX();dy=dw.fn;if(!dy){c7("not a primary expression",dw)}}}}var dx;while(dx=cX("(","[",".")){if(dx.text==="("){dy=dh(dy)}else{if(dx.text==="["){dy=db(dy)}else{if(dx.text==="."){dy=dp(dy)}else{c7("IMPOSSIBLE")}}}}return dy}function dp(dx){var dz=cX().text;var dw=co(dz);var dy=function(dA){return dw(dx(dA))};dy.isAssignable=dz;return dy}function db(dx){var dw=di();dg("]");if(cX("=")){var dy=di();return function(dz){return dx(dz)[dw(dz)]=dy(dz)}}else{return function(dz){var dB=dx(dz);var dA=dw(dz);return(dB)?dB[dA]:cS}}}function dh(dx){var dw=[];if(c1().text!=")"){do{dw.push(di())}while(cX(","))}dg(")");return function(dz){var dA=[];for(var dB=0;dB<dw.length;dB++){dA.push(dw[dB](dz))}var dy=dx(dz)||j;return dy.apply?dy.apply(dz,dA):dy(dA[0],dA[1],dA[2],dA[3],dA[4])}}function c2(){var dw=[];if(c1().text!="]"){do{dw.push(di())}while(cX(","))}dg("]");return function(dx){var dz=[];for(var dy=0;dy<dw.length;dy++){dz.push(dw[dy](dx))}return dz}}function dr(){var dw=[];if(c1().text!="}"){do{var dy=cX(),dx=dy.string||dy.text;dg(":");var dz=di();dw.push({key:dx,value:dz})}while(cX(","))}dg("}");return function(dA){var dB={};for(var dC=0;dC<dw.length;dC++){var dE=dw[dC];var dD=dE.value(dA);dB[dE.key]=dD}return dB}}function dd(){var dw=[];while(c6()){dw.push(dv());if(!cX(";")){de()}}de();return function(dx){for(var dy=0;dy<dw.length;dy++){var dz=dw[dy](dx);dx.addListener(dz.name,dz.fn)}}}function dv(){var dw=cX().text;dg(":");var dx;if(c1().text=="{"){dg("{");dx=c0();dg("}")}else{dx=di()}return function(dy){return{name:dw,fn:dx}}}}function bX(cW,cX){this.template=cW=cW+"#";this.defaults=cX||{};var cV=this.urlParams={};aS(cW.split(/\W/),function(cY){if(cY&&cW.match(new RegExp(":"+cY+"\\W"))){cV[cY]=true}})}bX.prototype={url:function(cZ){var cY=[];var cV=this;var cW=this.template;cZ=cZ||{};aS(this.urlParams,function(c1,c0){var c2=cZ[c0]||cV.defaults[c0]||"";cW=cW.replace(new RegExp(":"+c0+"(\\W)"),c2+"$1")});cW=cW.replace(/\/?#$/,"");var cX=[];ar(cZ,function(c1,c0){if(!cV.urlParams[c0]){cX.push(encodeURI(c0)+"="+encodeURI(c1))}});cW=cW.replace(/\/*$/,"");return cW+(cX.length?"?"+cX.join("&"):"")}};function bO(cV){this.xhr=cV}bO.DEFAULT_ACTIONS={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:true},remove:{method:"DELETE"},"delete":{method:"DELETE"}};bO.prototype={route:function(cY,cZ,c1){var cW=this;var cV=new bX(cY);c1=b7({},bO.DEFAULT_ACTIONS,c1);function cX(c3){var c2={};aS(cZ||{},function(c5,c4){c2[c4]=c5.charAt&&c5.charAt(0)=="@"?bQ(c3,c5.substr(1)):c5});return c2}function c0(c2){bv(c2||{},this)}aS(c1,function(c4,c3){var c2=c4.method=="POST"||c4.method=="PUT";c0[c3]=function(c6,c5,db){var c9={};var c8;var da=j;switch(arguments.length){case 3:da=db;case 2:if(E(c5)){da=c5}else{c9=c6;c8=c5;break}case 1:if(E(c6)){da=c6}else{if(c2){c8=c6}else{c9=c6}}break;case 0:break;default:throw"Expected between 0-3 arguments [params, data, callback], got "+arguments.length+" arguments."}var c7=this instanceof c0?this:(c4.isArray?[]:new c0(c8));cW.xhr(c4.method,cV.url(b7({},c4.params||{},cX(c8),c9)),c8,function(dd,de,dc){if(dd==200){if(c4.isArray){c7.length=0;aS(de,function(df){c7.push(new c0(df))})}else{bv(de,c7)}(da||j)(c7)}else{throw {status:dd,response:de,message:dd+": "+de}}},c4.verifyCache);return c7};c0.bind=function(c5){return cW.route(cY,b7({},cZ,c5),c1)};c0.prototype["$"+c3]=function(c6,c5){var c8=cX(this);var c9=j;switch(arguments.length){case 2:c8=c6;c9=c5;case 1:if(typeof c6==bz){c9=c6}else{c8=c6}case 0:break;default:throw"Expected between 1-2 arguments [params, callback], got "+arguments.length+" arguments."}var c7=c2?this:cS;c0[c3].call(this,c8,c7,c9)}});return c0}};var L=bU.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(cX){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(cW){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(cV){}throw new cK("This browser does not support XMLHttpRequest.")};function aO(c7,c5,c6,c3,da,c2){var c8=this;c8.isMock=false;var cZ=0;var c1=0;var c9=[];function c4(db){try{db.apply(null,ad.call(arguments,1))}finally{c1--;if(c1===0){while(c9.length){try{c9.pop()()}catch(dc){da.error(dc)}}}}}c8.xhr=function(dh,dc,dd,dg){if(E(dd)){dg=dd;dd=a6}if(am(dh)=="json"){var de="angular_"+Math.random()+"_"+(cZ++);de=de.replace(/\d\./,"");var db=c5[0].createElement("script");db.type="text/javascript";db.src=dc.replace("JSON_CALLBACK",de);bU[de]=function(di){bU[de]=cS;dg(200,di)};c6.append(db)}else{var df=new c3();df.open(dh,dc,true);df.setRequestHeader("Content-Type","application/x-www-form-urlencoded");df.setRequestHeader("Accept","application/json, text/plain, */*");df.setRequestHeader("X-Requested-With","XMLHttpRequest");c1++;df.onreadystatechange=function(){if(df.readyState==4){c4(dg,df.status||200,df.responseText)}};df.send(dd||"")}};c8.notifyWhenNoOutstandingRequests=function(db){if(c1===0){db()}else{c9.push(db)}};var cY=[];c8.poll=function(){aS(cY,function(db){db()})};c8.addPollFn=function(db){cY.push(db);return db};c8.startPoller=function(dc,dd){(function db(){c8.poll();dd(db,dc)})()};c8.setUrl=function(dc){var db=c7.href;if(!db.match(/#/)){db+="#"}if(!dc.match(/#/)){dc+="#"}c7.href=dc};c8.getUrl=function(){return c7.href};var cV=c5[0];var cX={};var cW="";c8.cookies=function(dc,de){var dg,db,dd,df;if(dc){if(de===cS){cV.cookie=escape(dc)+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}else{if(ci(de)){cV.cookie=escape(dc)+"="+escape(de);dg=dc.length+de.length+1;if(dg>4096){da.warn("Cookie '"+dc+"' possibly not set or overflowed because it was too large ("+dg+" > 4096 bytes)!")}if(cX.length>20){da.warn("Cookie '"+dc+"' possibly not set or overflowed because too many cookies were already set ("+cX.length+" > 20 )")}}}}else{if(cV.cookie!==cW){cW=cV.cookie;db=cW.split("; ");cX={};for(dd=0;dd<db.length;dd++){df=db[dd].split("=");if(df.length===2){cX[unescape(df[0])]=unescape(df[1])}}}return cX}};c8.defer=function(db){c1++;c2(function(){c4(db)},0)};var c0=j;c8.hover=function(db){c0=db};c8.bind=function(){c5.bind("mouseover",function(db){c0(ck(at?db.srcElement:db.target),true);return true});c5.bind("mouseleave mouseout click dblclick keypress keyup",function(db){c0(ck(db.target),false);return true})};c8.addCss=function(db){var dc=ck(cV.createElement("link"));dc.attr("rel","stylesheet");dc.attr("type","text/css");dc.attr("href",db);c6.append(dc)};c8.addJs=function(dd,dc){var db=ck(cV.createElement("script"));db.attr("type","text/javascript");db.attr("src",dd);if(dc){db.attr("id",dc)}c6.append(db)}}var b6=/^<\s*([\w:]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,n=/^<\s*\/\s*([\w:]+)[^>]*>/,cs=/(\w+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,cy=/^</,g=/^<\s*\//,aD=/<!--(.*?)-->/g,bW=/<!\[CDATA\[(.*?)]]>/g,bC=/^((ftp|https?):\/\/|mailto:|#)/,bh=/([^\#-~| |!])/g;var aV=cF("area,br,col,hr,img");var b2=cF("address,blockquote,center,dd,del,dir,div,dl,dt,hr,ins,li,map,menu,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");var al=cF("a,abbr,acronym,b,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var");var K=cF("colgroup,dd,dt,li,p,td,tfoot,th,thead,tr");var bP=cF("script,style");var bx=b7({},aV,b2,al,K);var a1=cF("compact,ismap,nohref,nowrap");var cJ=cF("background,href,longdesc,src,usemap");var a8=b7({},a1,cJ,cF("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,coords,dir,face,headers,height,hreflang,hspace,lang,language,rel,rev,rows,rowspan,rules,scope,scrolling,shape,span,start,summary,target,title,type,valign,value,vspace,width"));function aQ(cW,c4){var cZ,c0,cX,c1=[],c2=cW;c1.last=function(){return c1[c1.length-1]};while(cW){c0=true;if(!c1.last()||!bP[c1.last()]){if(cW.indexOf("<!--")===0){cZ=cW.indexOf("-->");if(cZ>=0){if(c4.comment){c4.comment(cW.substring(4,cZ))}cW=cW.substring(cZ+3);c0=false}}else{if(g.test(cW)){cX=cW.match(n);if(cX){cW=cW.substring(cX[0].length);cX[0].replace(n,cY);c0=false}}else{if(cy.test(cW)){cX=cW.match(b6);if(cX){cW=cW.substring(cX[0].length);cX[0].replace(b6,cV);c0=false}}}}if(c0){cZ=cW.indexOf("<");var c3=cZ<0?cW:cW.substring(0,cZ);cW=cZ<0?"":cW.substring(cZ);c4.chars(aa(c3))}}else{cW=cW.replace(new RegExp("(.*)<\\s*\\/\\s*"+c1.last()+"[^>]*>","i"),function(c5,c6){c6=c6.replace(aD,"$1").replace(bW,"$1");c4.chars(aa(c6));return""});cY("",c1.last())}if(cW==c2){throw"Parse Error: "+cW}c2=cW}cY();function cV(c5,c8,c9,c6){c8=am(c8);if(b2[c8]){while(c1.last()&&al[c1.last()]){cY("",c1.last())}}if(K[c8]&&c1.last()==c8){cY("",c8)}c6=aV[c8]||!!c6;if(!c6){c1.push(c8)}var c7={};c9.replace(cs,function(db,da){var dc=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:a1[da]?da:"";c7[da]=aa(dc)});c4.start(c8,c7,c6)}function cY(c5,c7){var c8=0,c6;c7=am(c7);if(c7){for(c8=c1.length-1;c8>=0;c8--){if(c1[c8]==c7){break}}}if(c8>=0){for(c6=c1.length-1;c6>=c8;c6--){c4.end(c1[c6])}c1.length=c8}}}function cF(cY){var cX={},cV=cY.split(","),cW;for(cW=0;cW<cV.length;cW++){cX[cV[cW]]=true}return cX}var y=r.createElement("pre");function aa(cV){y.innerHTML=cV.replace(/</g,"&lt;");return y.innerText||y.textContent}function aF(cV){return cV.replace(/&/g,"&amp;").replace(bh,function(cW){return"&#"+cW.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a5(cW){var cX=false;var cV=bF(cW,cW.push);return{start:function(cY,c0,cZ){cY=am(cY);if(!cX&&bP[cY]){cX=cY}if(!cX&&bx[cY]==true){cV("<");cV(cY);aS(c0,function(c2,c1){var c3=am(c1);if(a8[c3]==true&&(cJ[c3]!==true||c2.match(bC))){cV(" ");cV(c1);cV('="');cV(aF(c2));cV('"')}});cV(cZ?"/>":">")}},end:function(cY){cY=am(cY);if(!cX&&bx[cY]==true){cV("</");cV(cY);cV(">")}if(cY==cX){cX=false}},chars:function(cY){if(!cX){cV(aF(cY))}}}}var cc={},cB="ng-"+new Date().getTime(),aj=1,aC=(bU.document.attachEvent?function(cV,cX,cW){cV.attachEvent("on"+cX,cW)}:function(cV,cX,cW){cV.addEventListener(cX,cW,false)}),e=(bU.document.detachEvent?function(cV,cX,cW){cV.detachEvent("on"+cX,cW)}:function(cV,cX,cW){cV.removeEventListener(cX,cW,false)});function cf(){return(aj++)}function cU(cW){var cX=cW[cB],cV=cc[cX];if(cV){aS(cV.bind||{},function(cZ,cY){e(cW,cY,cZ)});delete cc[cX];if(at){cW[cB]=""}else{delete cW[cB]}}}function cb(cX){var c0={},cY=cX[0].style,cZ,cV,cW;if(typeof cY.length=="number"){for(cW=0;cW<cY.length;cW++){cV=cY[cW];c0[cV]=cY[cV]}}else{for(cV in cY){cZ=cY[cV];if(1*cV!=cV&&cV!="cssText"&&cZ&&typeof cZ=="string"&&cZ!="false"){c0[cV]=cZ}}}return c0}function bu(cW){if(bJ(cW)){this[0]=cW;this.length=1}else{if(cv(cW.length)&&cW.item){for(var cV=0;cV<cW.length;cV++){this[cV]=cW[cV]}this.length=cW.length}}}bu.prototype={data:function(cX,cY){var cW=this[0],cZ=cW[cB],cV=cc[cZ||-1];if(cv(cY)){if(!cV){cW[cB]=cZ=cf();cV=cc[cZ]={}}cV[cX]=cY}else{return cV?cV[cX]:a6}},removeData:function(){cU(this[0])},dealoc:function(){(function cV(cY){cU(cY);for(var cX=0,cW=cY.childNodes;cX<cW.length;cX++){cV(cW[cX])}})(this[0])},bind:function(cZ,cY){var cV=this,cX=cV[0],c0=cV.data("bind"),cW;if(!c0){this.data("bind",c0={})}aS(cZ.split(" "),function(c1){cW=c0[c1];if(!cW){c0[c1]=cW=function(c2){if(!c2.preventDefault){c2.preventDefault=function(){c2.returnValue=false}}if(!c2.stopPropagation){c2.stopPropagation=function(){c2.cancelBubble=true}}aS(cW.fns,function(c3){c3.call(cV,c2)})};cW.fns=[];aC(cX,c1,cW)}cW.fns.push(cY)})},replaceWith:function(cV){this[0].parentNode.replaceChild(ck(cV)[0],this[0])},children:function(){return new bu(this[0].childNodes)},append:function(cW){var cV=this[0];cW=ck(cW);aS(cW,function(cX){cV.appendChild(cX)})},remove:function(){this.dealoc();var cV=this[0].parentNode;if(cV){cV.removeChild(this[0])}},removeAttr:function(cV){this[0].removeAttribute(cV)},after:function(cV){this[0].parentNode.insertBefore(ck(cV)[0],this[0].nextSibling)},hasClass:function(cV){var cW=" "+cV+" ";if((" "+this[0].className+" ").replace(/[\n\t]/g," ").indexOf(cW)>-1){return true}return false},removeClass:function(cV){this[0].className=av((" "+this[0].className+" ").replace(/[\n\t]/g," ").replace(" "+cV+" ",""))},toggleClass:function(cV,cX){var cW=this;(cX?cW.addClass:cW.removeClass).call(cW,cV)},addClass:function(cV){if(!this.hasClass(cV)){this[0].className=av(this[0].className+" "+cV)}},css:function(cV,cX){var cW=this[0].style;if(ci(cV)){if(cv(cX)){cW[cV]=cX}else{return cW[cV]}}else{b7(cW,cV)}},attr:function(cV,cW){var cX=this[0];if(cR(cV)){aS(cV,function(cZ,cY){cX.setAttribute(cY,cZ)})}else{if(cv(cW)){cX.setAttribute(cV,cW)}else{return cX.getAttribute(cV,2)}}},text:function(cV){if(cv(cV)){this[0].textContent=cV}return this[0].textContent},val:function(cV){if(cv(cV)){this[0].value=cV}return this[0].value},html:function(cW){if(cv(cW)){var cV=0,cX=this[0].childNodes;for(;cV<cX.length;cV++){ck(cX[cV]).dealoc()}this[0].innerHTML=cW}return this[0].innerHTML},parent:function(){return ck(this[0].parentNode)},clone:function(){return ck(this[0].cloneNode(true))}};if(at){b7(bu.prototype,{text:function(cV){var cW=this[0];if(cW.nodeType==3){if(cv(cV)){cW.nodeValue=cV}return cW.nodeValue}else{if(cv(cV)){cW.innerText=cV}return cW.innerText}}})}var aY={typeOf:function(cW){if(cW===a6){return v}var cV=typeof cW;if(cV==aP){if(cW instanceof Array){return a3}if(ax(cW)){return bc}if(cW.nodeType==1){return cC}}return cV}};var cQ={copy:bv,size:aw,equals:p};var bk={extend:b7};var M={indexOf:cO,sum:function(c0,cZ){var cX=aB.Function["compile"](cZ);var cW=0;for(var cV=0;cV<c0.length;cV++){var cY=1*cX(c0[cV]);if(!isNaN(cY)){cW+=cY}}return cW},remove:function(cX,cW){var cV=cO(cX,cW);if(cV>=0){cX.splice(cV,1)}return cW},filter:function(c2,c1){var cX=[];cX.check=function(c4){for(var c3=0;c3<cX.length;c3++){if(!cX[c3](c4)){return false}}return true};var cZ=function(c5,c6){if(c6.charAt(0)==="!"){return !cZ(c5,c6.substr(1))}switch(typeof c5){case"boolean":case"number":case"string":return(""+c5).toLowerCase().indexOf(c6)>-1;case"object":for(var c4 in c5){if(c4.charAt(0)!=="$"&&cZ(c5[c4],c6)){return true}}return false;case"array":for(var c3=0;c3<c5.length;c3++){if(cZ(c5[c3],c6)){return true}}return false;default:return false}};switch(typeof c1){case"boolean":case"number":case"string":c1={$:c1};case"object":for(var cY in c1){if(cY=="$"){(function(){var c3=(""+c1[cY]).toLowerCase();if(!c3){return}cX.push(function(c4){return cZ(c4,c3)})})()}else{(function(){var c3=cY;var c4=(""+c1[cY]).toLowerCase();if(!c4){return}cX.push(function(c5){return cZ(bQ(c5,c3),c4)})})()}}break;case bz:cX.push(c1);break;default:return c2}var cW=[];for(var cV=0;cV<c2.length;cV++){var c0=c2[cV];if(cX.check(c0)){cW.push(c0)}}return cW},add:function(cW,cV){cW.push(bB(cV)?{}:cV);return cW},count:function(cY,cX){if(!cX){return cY.length}var cV=aB.Function["compile"](cX),cW=0;aS(cY,function(cZ){if(cV(cZ)){cW++}});return cW},orderBy:function(c2,c1,cZ){c1=a9(c1)?c1:[c1];c1=aI(c1,function(c4){var c5=false,c3=c4||aG;if(ci(c4)){if((c4.charAt(0)=="+"||c4.charAt(0)=="-")){c5=c4.charAt(0)=="-";c4=c4.substring(1)}c3=bt(c4).fnSelf}return cW(function(c7,c6){return c0(c3(c7),c3(c6))},c5)});var cY=[];for(var cX=0;cX<c2.length;cX++){cY.push(c2[cX])}return cY.sort(cW(cV,cZ));function cV(c6,c5){for(var c4=0;c4<c1.length;c4++){var c3=c1[c4](c6,c5);if(c3!==0){return c3}}return 0}function cW(c3,c4){return cp(c4)?function(c6,c5){return c3(c5,c6)}:c3}function c0(c6,c5){var c4=typeof c6;var c3=typeof c5;if(c4==c3){if(c4=="string"){c6=c6.toLowerCase()}if(c4=="string"){c5=c5.toLowerCase()}if(c6===c5){return 0}return c6<c5?-1:1}else{return c4<c3?-1:1}}},limitTo:function(cZ,cV){cV=parseInt(cV,10);var cW=[],cX,cY;if(cV>0){cX=0;cY=cV}else{cX=cZ.length+cV;cY=cZ.length}for(;cX<cY;cX++){cW.push(cZ[cX])}return cW}};var a7=/^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d)(?:\:(\d\d)(?:\:(\d\d)(?:\.(\d{3}))?)?)?Z)?$/;var aq={quote:function(cV){return'"'+cV.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(cV){var c0=aB.String["quote"](cV);var cZ=[];for(var cW=0;cW<c0.length;cW++){var cX=c0.charCodeAt(cW);if(cX<128){cZ.push(c0.charAt(cW))}else{var cY="000"+cX.toString(16);cZ.push("\\u"+cY.substring(cY.length-4))}}return cZ.join("")},toDate:function(cX){var cW;if(ci(cX)&&(cW=cX.match(a7))){var cV=new Date(0);cV.setUTCFullYear(cW[1],cW[2]-1,cW[3]);cV.setUTCHours(cW[4]||0,cW[5]||0,cW[6]||0,cW[7]||0);return cV}return cX}};var af={toString:function(cV){return !cV?cV:cV.toISOString?cV.toISOString():cn(cV.getUTCFullYear(),4)+"-"+cn(cV.getUTCMonth()+1,2)+"-"+cn(cV.getUTCDate(),2)+"T"+cn(cV.getUTCHours(),2)+":"+cn(cV.getUTCMinutes(),2)+":"+cn(cV.getUTCSeconds(),2)+"."+cn(cV.getUTCMilliseconds(),3)+"Z"}};var w={compile:function(cV){if(E(cV)){return cV}else{if(cV){return bt(cV).fnSelf}else{return aG}}}};function I(cW,cV){aB[cW]=aB[cW]||{};aS(cV,function(cX){b7(aB[cW],cX)})}I("Global",[aY]);I("Collection",[aY,cQ]);I("Array",[aY,cQ,M]);I("Object",[aY,cQ,bk]);I("String",[aY,aq]);I("Date",[aY,af]);aB.Date["toString"]=af.toString;I("Function",[aY,cQ,w]);cu.currency=function(cV){this.$element.toggleClass("ng-format-negative",cV<0);return"$"+cu.number.apply(this,[cV,2])};cu.number=function(cY,cV){if(isNaN(cY)||!isFinite(cY)){return""}cV=typeof cV==q?2:cV;var cW=cY<0;cY=Math.abs(cY);var c1=Math.pow(10,cV);var c3=""+Math.round(cY*c1);var c2=c3.substring(0,c3.length-cV);c2=c2||"0";var cX=c3.substring(c3.length-cV);c3=cW?"-":"";for(var c0=0;c0<c2.length;c0++){if((c2.length-c0)%3===0&&c0!==0){c3+=","}c3+=c2.charAt(c0)}if(cV>0){for(var cZ=cX.length;cZ<cV;cZ++){cX+="0"}c3+="."+cX.substring(0,cV)}return c3};function cn(cW,cX,cV){var cY="";if(cW<0){cY="-";cW=-cW}cW=""+cW;while(cW.length<cX){cW="0"+cW}if(cV){cW=cW.substr(cW.length-cX)}return cY+cW}function br(cW,cX,cY,cV){return function(cZ){var c0=cZ["get"+cW]();if(cY>0||c0>-cY){c0+=cY}if(c0===0&&cY==-12){c0=12}return cn(c0,cX,cV)}}var bG={yyyy:br("FullYear",4),yy:br("FullYear",2,0,true),MM:br("Month",2,1),M:br("Month",1,1),dd:br("Date",2),d:br("Date",1),HH:br("Hours",2),H:br("Hours",1),hh:br("Hours",2,-12),h:br("Hours",1,-12),mm:br("Minutes",2),m:br("Minutes",1),ss:br("Seconds",2),s:br("Seconds",1),a:function(cV){return cV.getHours()<12?"am":"pm"},Z:function(cV){var cW=cV.getTimezoneOffset();return cn(cW/60,2)+cn(Math.abs(cW%60),2)}};var ap=/([^yMdHhmsaZ]*)(y+|M+|d+|H+|h+|m+|s+|a|Z)(.*)/;var cq=/^\d+$/;cu.date=function(cV,cY){if(ci(cV)){if(cq.test(cV)){cV=parseInt(cV,10)}else{cV=aq.toDate(cV)}}if(aU(cV)){cV=new Date(cV)}if(!ax(cV)){return cV}var cZ=cV.toLocaleDateString(),cW;if(cY&&ci(cY)){cZ="";var cX=[];while(cY){cX=bd(cX,ap.exec(cY),1);cY=cX.pop()}aS(cX,function(c0){cW=bG[c0];cZ+=cW?cW(cV):c0})}return cZ};cu.json=function(cV){this.$element.addClass("ng-monospace");return cm(cV,true)};cu.lowercase=am;cu.uppercase=bI;cu.html=function(cV,cW){return new aW(cV,cW)};cu.linky=function(c2){if(!c2){return c2}var cV=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/;var cY;var cX=c2;var c0=[];var c1=a5(c0);var cW;var cZ;while(cY=cX.match(cV)){cW=cY[0];if(cY[2]==cY[3]){cW="mailto:"+cW}cZ=cY.index;c1.chars(cX.substr(0,cZ));c1.start("a",{href:cW});c1.chars(cY[0].replace(/^mailto:/,""));c1.end("a");cX=cX.substring(cZ+cY[0].length)}c1.chars(cX);return new aW(c0.join(""))};function a0(cV,cW){return{format:cV,parse:cW||cV}}function D(cV){return(cv(cV)&&cV!==a6)?""+cV:cV}var aT=/^\s*[-+]?\d*(\.\d*)?\s*$/;l.noop=a0(aG,aG);l.json=a0(cm,Q);l["boolean"]=a0(D,cp);l.number=a0(D,function(cV){if(cV==a6||aT.exec(cV)){return cV===a6||cV===""?a6:1*cV}else{throw"Not a number"}});l.list=a0(function(cV){return cV?cV.join(", "):cV},function(cW){var cV=[];aS((cW||"").split(","),function(cX){cX=av(cX);if(cX){cV.push(cX)}});return cV});l.trim=a0(function(cV){return cV?av(""+cV):""});b7(aK,{noop:function(){return a6},regexp:function(cW,cV,cX){if(!cW.match(cV)){return cX||"Value does not match expected format "+cV+"."}else{return a6}},number:function(cY,cX,cV){var cW=1*cY;if(cW==cY){if(typeof cX!=q&&cW<cX){return"Value can not be less than "+cX+"."}if(typeof cX!=q&&cW>cV){return"Value can not be greater than "+cV+"."}return a6}else{return"Not a number"}},integer:function(cY,cW,cV){var cX=aK.number(cY,cW,cV);if(cX){return cX}if(!(""+cY).match(/^\s*[\d+]*\s*$/)||cY!=Math.round(cY)){return"Not a whole number"}return a6},date:function(cX){var cV=/^(\d\d?)\/(\d\d?)\/(\d\d\d\d)$/.exec(cX);var cW=cV?new Date(cV[3],cV[1]-1,cV[2]):0;return(cW&&cW.getFullYear()==cV[3]&&cW.getMonth()==cV[1]-1&&cW.getDate()==cV[2])?a6:"Value is not a date. (Expecting format: 12/31/2009)."},email:function(cV){if(cV.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/)){return a6}return"Email needs to be in username@host.com format."},phone:function(cV){if(cV.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/)){return a6}if(cV.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/)){return a6}return"Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly."},url:function(cV){if(cV.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/)){return a6}return"URL needs to be in http://server[:port]/path format."},json:function(cV){try{Q(cV);return a6}catch(cW){return cW.toString()}},asynchronous:function(cY,c1,cW){if(!cY){return}var c0=this;var cZ=c0.$element;var cX=cZ.data("$asyncValidator");if(!cX){cZ.data("$asyncValidator",cX={inputs:{}})}cX.current=cY;var cV=cX.inputs[cY];if(!cV){cX.inputs[cY]=cV={inFlight:true};c0.$invalidWidgets.markInvalid(c0.$element);cZ.addClass("ng-input-indicator-wait");c1(cY,function(c2,c3){cV.response=c3;cV.error=c2;cV.inFlight=false;if(cX.current==cY){cZ.removeClass("ng-input-indicator-wait");c0.$invalidWidgets.markValid(cZ)}cZ.data(bf)();c0.$root.$eval()})}else{if(cV.inFlight){c0.$invalidWidgets.markInvalid(c0.$element)}else{(cW||j)(cV.response)}}return cV.error}});var H=/^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,z=/^([^\?]*)?(\?([^\?]*))?$/,cA={http:80,https:443,ftp:21},bT="eager",bK=bT+"-published";function cl(cW,cY,cX,cV){bs(cW,cY,{$inject:cX,$creation:cV})}cl("$window",bF(bU,aG,bU),[],bK);cl("$document",function(cV){return ck(cV.document)},["$window"],bK);cl("$location",function(c2){var da=this,c6={toString:cW,update:c1,updateHash:c5},c0=c2.getUrl(),cY,c3;c2.addPollFn(function(){if(c0!=c2.getUrl()){c1(c0=c2.getUrl());c9();da.$eval()}});this.$onEval(bp,c4);this.$onEval(cg,c4);c1(c0);c9();return c6;function c1(db){if(ci(db)){b7(c6,c8(db))}else{if(cv(db.hash)){b7(db,cZ(db.hash))}b7(c6,db);if(cv(db.hashPath||db.hashSearch)){c6.hash=cX(c6)}c6.href=c7(c6)}}function c5(dd,db){var dc={};if(ci(dd)){dc.hashPath=dd;if(cv(db)){dc.hashSearch=db}}else{dc.hashSearch=dd}c1(dc)}function cW(){cV();return c6.href}function cV(){if(c6.href==cY){if(c6.hash==c3){c6.hash=cX(c6)}c6.href=c7(c6)}c1(c6.href)}function c9(){cY=c6.href;c3=c6.hash}function c4(){cV();if(c6.href!=cY){c2.setUrl(c0=c6.href);c9()}}function c7(dd){var dc=N(dd.search);var db=(dd.port==cA[dd.protocol]?a6:dd.port);return dd.protocol+"://"+dd.host+(db?":"+db:"")+dd.path+(dc?"?"+dc:"")+(dd.hash?"#"+dd.hash:"")}function cX(dc){var db=N(dc.hashSearch);return escape(dc.hashPath).replace(/%21/gi,"!").replace(/%3A/gi,":").replace(/%24/gi,"$")+(db?"?"+db:"")}function c8(db){var dd={};var dc=H.exec(db);if(dc){dd.href=db.replace(/#$/,"");dd.protocol=dc[1];dd.host=dc[3]||"";dd.port=dc[5]||cA[dd.protocol]||a6;dd.path=dc[6]||"";dd.search=ah(dc[8]);dd.hash=dc[10]||"";b7(dd,cZ(dd.hash))}return dd}function cZ(dd){var dc={};var db=z.exec(dd);if(db){dc.hash=dd;dc.hashPath=unescape(db[1]||"");dc.hashSearch=ah(db[3])}return dc}},["$browser"],bK);cl("$log",function(cW){return{log:cV("log"),warn:cV("warn"),info:cV("info"),error:cV("error")};function cV(cY){var cX=cW.console||{};var cZ=cX[cY]||cX.log||j;if(cZ.apply){return function(){var c0=[];aS(arguments,function(c1){c0.push(bb(c1))});return cZ.apply(cX,c0)}}else{return cZ}}},["$window"],bK);cl("$exceptionHandler",function(cV){return function(cW){cV.error(cW)}},["$log"],bK);cl("$hover",function(c0,cW){var c2,cY=this,cZ,c1=300,cX=10,cV=ck(cW[0].body);c0.hover(function(c6,c4){if(c4&&(cZ=c6.attr(a)||c6.attr(k))){if(!c2){c2={callout:ck('<div id="ng-callout"></div>'),arrow:ck("<div></div>"),title:ck('<div class="ng-title"></div>'),content:ck('<div class="ng-content"></div>')};c2.callout.append(c2.arrow);c2.callout.append(c2.title);c2.callout.append(c2.content);cV.append(c2.callout)}var c3=cV[0].getBoundingClientRect(),c5=c6[0].getBoundingClientRect(),c7=c3.right-c5.right-cX;c2.title.text(c6.hasClass("ng-exception")?"EXCEPTION:":"Validation error...");c2.content.text(cZ);if(c7<c1){c2.arrow.addClass("ng-arrow-right");c2.arrow.css({left:(c1+1)+"px"});c2.callout.css({position:"fixed",left:(c5.left-cX-c1-4)+"px",top:(c5.top-3)+"px",width:c1+"px"})}else{c2.arrow.addClass("ng-arrow-left");c2.callout.css({position:"fixed",left:(c5.right+cX)+"px",top:(c5.top-3)+"px",width:c1+"px"})}}else{if(c2){c2.callout.remove();c2=a6}}})},["$browser","$document"],bT);cl("$invalidWidgets",function(){var cW=[];cW.markValid=function(cY){var cX=cO(cW,cY);if(cX!=-1){cW.splice(cX,1)}};cW.markInvalid=function(cY){var cX=cO(cW,cY);if(cX===-1){cW.push(cY)}};cW.visible=function(){var cX=0;aS(cW,function(cY){cX=cX+(aR(cY)?1:0)});return cX};this.$onEval(cg,function(){for(var cX=0;cX<cW.length;){var cY=cW[cX];if(cV(cY[0])){cW.splice(cX,1);if(cY.dealoc){cY.dealoc()}}else{cX++}}});function cV(cY){if(cY==bU.document){return false}var cX=cY.parentNode;return !cX||cV(cX)}return cW},[],bK);function bj(cW,cV,cZ){var cY="^"+cV.replace(/[\.\\\(\)\^\$]/g,"$1")+"$",c0=[],c1={};aS(cV.split(/\W/),function(c3){if(c3){var c2=new RegExp(":"+c3+"([\\W])");if(cY.match(c2)){cY=cY.replace(c2,"([^/]*)$1");c0.push(c3)}}});var cX=cW.match(new RegExp(cY));if(cX){aS(c0,function(c3,c2){c1[c3]=cX[c2+1]});if(cZ){this.$set(cZ,c1)}}return cX?c1:a6}cl("$route",function(cW){var cV={},cX=[],c1=bj,cZ=this,cY=0,c2={routes:cV,onChange:bF(cX,cX.push),when:function(c4,c5){if(aB.isUndefined(c4)){return cV}var c3=cV[c4];if(!c3){c3=cV[c4]={}}if(c5){aB.extend(c3,c5)}cY++;return c3}};function c0(){var c3;c2.current=a6;aB.foreach(cV,function(c4,c5){if(!c3){var c6=c1(cW.hashPath,c5);if(c6){c3=aB.scope(cZ);c2.current=aB.extend({},c4,{scope:c3,params:aB.extend({},cW.hashSearch,c6)})}}});aB.foreach(cX,cZ.$tryEval);if(c3){c3.$become(c2.current.controller)}}this.$watch(function(){return cY+cW.hash},c0);return c2},["$location"],bK);cl("$xhr",function(cW,cV,cY){var cX=this;return function(c2,cZ,c0,c1){if(E(c0)){c1=c0;c0=a6}if(c0&&cR(c0)){c0=cm(c0)}cW.xhr(c2,cZ,c0,function(c4,c3){try{if(ci(c3)&&/^\s*[\[\{]/.exec(c3)&&/[\}\]]\s*$/.exec(c3)){c3=Q(c3)}if(c4==200){c1(c4,c3)}else{cV({method:c2,url:cZ,data:c0,callback:c1},{status:c4,body:c3})}}catch(c5){cY.error(c5)}finally{cX.$eval()}})}},["$browser","$xhr.error","$log"]);cl("$xhr.error",function(cV){return function(cX,cW){cV.error("ERROR: XHR: "+cX.url,cX,cW)}},["$log"]);cl("$xhr.bulk",function(cW,cV,cZ){var c0=[],cY=this;function cX(c5,c1,c2,c4){if(E(c2)){c4=c2;c2=a6}var c3;aS(cX.urls,function(c6){if(E(c6.match)?c6.match(c1):c6.match.exec(c1)){c3=c6}});if(c3){if(!c3.requests){c3.requests=[]}c3.requests.push({method:c5,url:c1,data:c2,callback:c4})}else{cW(c5,c1,c2,c4)}}cX.urls={};cX.flush=function(c1){aS(cX.urls,function(c2,c3){var c4=c2.requests;if(c4&&c4.length){c2.requests=[];c2.callbacks=[];cW("POST",c3,{requests:c4},function(c6,c5){aS(c5,function(c7,c8){try{if(c7.status==200){(c4[c8].callback||j)(c7.status,c7.response)}else{cV(c4[c8],c7)}}catch(c9){cZ.error(c9)}});(c1||j)()});cY.$eval()}})};this.$onEval(cg,cX.flush);return cX},["$xhr","$xhr.error","$log"]);cl("$defer",function(cV,cW){return function(cX){cV.defer(function(){try{cX()}catch(cY){cW(cY)}})}},["$browser","$exceptionHandler"]);cl("$xhr.cache",function(cV,cY){var cZ={},cX=this;function cW(c6,c0,c1,c5,c4){if(E(c1)){c5=c1;c1=a6}if(c6=="GET"){var c3,c2;if(c2=cW.data[c0]){cY(function(){c5(200,bv(c2.value))});if(!c4){return}}if(c3=cZ[c0]){c3.callbacks.push(c5)}else{cZ[c0]={callbacks:[c5]};cW.delegate(c6,c0,c1,function(c7,c8){if(c7==200){cW.data[c0]={value:c8}}var c9=cZ[c0].callbacks;delete cZ[c0];aS(c9,function(db){try{(db||j)(c7,bv(c8))}catch(da){cX.$log.error(da)}})})}}else{cW.data={};cW.delegate(c6,c0,c1,c5)}}cW.data={};cW.delegate=cV;return cW},["$xhr.bulk","$defer"]);cl("$resource",function(cV){var cW=new bO(cV);return bF(cW,cW.route)},["$xhr.cache"]);cl("$cookies",function(cW){var cZ=this,c0={},cX={},cV;cW.addPollFn(function(){var c1=cW.cookies();if(cV!=c1){cV=c1;bv(c1,cX);bv(c1,c0);cZ.$eval()}})();this.$onEval(cg,cY);return c0;function cY(){var c2,c3,c1;for(c2 in cX){if(bB(c0[c2])){cW.cookies(c2,cS)}}for(c2 in c0){if(c0[c2]!==cX[c2]){cW.cookies(c2,c0[c2]);c1=true}}if(c1){c1=!c1;c3=cW.cookies();for(c2 in c0){if(c0[c2]!==c3[c2]){if(bB(c3[c2])){delete c0[c2]}else{c0[c2]=c3[c2]}c1=true}}if(c1){cZ.$eval()}}}},["$browser"],bK);cl("$cookieStore",function(cV){return{get:function(cW){return Q(cV[cW])},put:function(cW,cX){cV[cW]=cm(cX)},remove:function(cW){delete cV[cW]}}},["$cookies"]);Z("ng:init",function(cV){return function(cW){this.$tryEval(cV,cW)}});Z("ng:controller",function(cV){this.scope(true);return function(cX){var cW=bQ(bU,cV,true)||bQ(this,cV,true);if(!cW){throw"Can not find '"+cV+"' controller."}if(!E(cW)){throw"Reference '"+cV+"' is not a class."}this.$become(cW)}});Z("ng:eval",function(cV){return function(cW){this.$onEval(cV,cW)}});Z("ng:bind",function(cW,cV){cV.addClass("ng-binding");return function(cY){var cX=j,cZ=j;this.$onEval(function(){var c1,c5,c2,c3,c4,c0=this.hasOwnProperty(by)?this.$element:cS;this.$element=cY;c5=this.$tryEval(cW,function(c6){c1=bb(c6)});this.$element=c0;if(c3=(c5 instanceof aW)){c5=(c2=c5).html}if(cX===c5&&cZ==c1){return}c4=bJ(c5);if(!c3&&!c4&&cR(c5)){c5=cm(c5)}if(c5!=cX||c1!=cZ){cX=c5;cZ=c1;b0(cY,a,c1);if(c1){c5=c1}if(c3){cY.html(c2.get())}else{if(c4){cY.html("");cY.append(c5)}else{cY.text(c5===cS?"":c5)}}}},cY)}});var bD={};function cT(cW){var cV=bD[cW];if(!cV){var cX=[];aS(aZ(cW),function(cZ){var cY=cI(cZ);cX.push(cY?function(c1){var c0,c2=this.$tryEval(cY,function(c3){c0=cm(c3)});b0(c1,a,c0);return c0?c0:c2}:function(){return cZ})});bD[cW]=cV=function(c1){var c3=[],cY=this,cZ=this.hasOwnProperty(by)?cY.$element:cS;cY.$element=c1;for(var c0=0;c0<cX.length;c0++){var c2=cX[c0].call(cY,c1);if(bJ(c2)){c2=""}else{if(cR(c2)){c2=cm(c2,true)}}c3.push(c2)}cY.$element=cZ;return c3.join("")}}return cV}Z("ng:bind-template",function(cW,cV){cV.addClass("ng-binding");var cX=cT(cW);return function(cZ){var cY;this.$onEval(function(){var c0=cX.call(this,cZ);if(c0!=cY){cZ.text(c0);cY=c0}},cZ)}});var f={disabled:"disabled",readonly:"readOnly",checked:"checked",selected:"selected"};Z("ng:bind-attr",function(cV){return function(cY){var cX={};var cW=cY.data(ac)||j;this.$onEval(function(){var cZ=this.$eval(cV),c1=j;for(var c0 in cZ){var c3=cT(cZ[c0]).call(this,cY),c2=f[am(c0)];if(cX[c0]!==c3){cX[c0]=c3;if(c2){if(cp(c3)){cY.attr(c2,c2);cY.attr("ng-"+c2,c3)}else{cY.removeAttr(c2);cY.removeAttr("ng-"+c2)}(cY.data(bf)||j)()}else{cY.attr(c0,c3)}c1=cW}}c1()},cY)}});Z("ng:click",function(cW,cV){return function(cY){var cX=this;cY.bind("click",function(cZ){cX.$tryEval(cW,cY);cX.$root.$eval();cZ.stopPropagation()})}});Z("ng:submit",function(cW,cV){return function(cY){var cX=this;cY.bind("submit",function(cZ){cX.$tryEval(cW,cY);cX.$root.$eval();cZ.preventDefault()})}});Z("ng:watch",function(cW,cV){return function(cY){var cX=this;S(cW).watch()({addListener:function(cZ,c0){cX.$watch(cZ,function(){return c0(cX)},cY)}})}});function bE(cV){return function(cY,cW){var cX=cW[0].className+" ";return function(cZ){this.$onEval(function(){if(cV(this.$index)){var c0=this.$eval(cY);if(a9(c0)){c0=c0.join(" ")}cZ[0].className=av(cX+c0)}},cZ)}}}Z("ng:class",bE(function(){return true}));Z("ng:class-odd",bE(function(cV){return cV%2===0}));Z("ng:class-even",bE(function(cV){return cV%2===1}));Z("ng:show",function(cW,cV){return function(cX){this.$onEval(function(){cX.css(aL,cp(this.$eval(cW))?"":b)},cX)}});Z("ng:hide",function(cW,cV){return function(cX){this.$onEval(function(){cX.css(aL,cp(this.$eval(cW))?b:"")},cX)}});Z("ng:style",function(cW,cV){return function(cX){var cY=cb(cX);this.$onEval(function(){var c0=this.$eval(cW)||{},cZ,c1={};for(cZ in c0){if(cY[cZ]===cS){cY[cZ]=""}c1[cZ]=c0[cZ]}for(cZ in cY){c1[cZ]=c1[cZ]||cY[cZ]}cX.css(c1)},cX)}});function aZ(cW){var cX=[];var cY=0;var cV;while((cV=cW.indexOf("{{",cY))>-1){if(cY<cV){cX.push(cW.substr(cY,cV-cY))}cY=cV;cV=cW.indexOf("}}",cV);cV=cV<0?cW.length:cV+2;cX.push(cW.substr(cY,cV-cY));cY=cV}if(cY!=cW.length){cX.push(cW.substr(cY,cW.length-cY))}return cX.length===0?[cW]:cX}function cI(cV){var cW=cV.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/);return cW?cW[1]:a6}function cH(cV){return cV.length>1||cI(cV[0])!==a6}ag("{{}}",function(cZ,cY,cV){var c1=aZ(cZ),cW=this;if(cH(c1)){if(b4(cV[0])){cV.attr("ng:bind-template",cZ)}else{var cX=cY,c0;aS(aZ(cZ),function(c4){var c3=cI(c4);if(c3){c0=cW.element("span");c0.attr("ng:bind",c3)}else{c0=cW.text(c4)}if(at&&c4.charAt(0)==" "){c0=ck("<span>&nbsp;</span>");var c2=c0.html();c0.text(c4.substr(1));c0.html(c2+c0.html())}cX.after(c0);cX=c0});cY.remove()}}});ag("OPTION",function(cY,cX,cW){if(au(cW)=="OPTION"){var cV=r.createElement("select");cV.insertBefore(cW[0].cloneNode(true),a6);if(!cV.innerHTML.match(/<option(\s.*\s|\s)value\s*=\s*.*>.*<\/\s*option\s*>/gi)){cW.attr("value",cY)}}});var bL="ng:bind-attr";var aH={"ng:src":"src","ng:href":"href"};s("{{}}",function(cY,cW,cX){if(Z(cW)||Z("@"+cW)){return}if(at&&cW=="src"){cY=decodeURI(cY)}var cZ=aZ(cY),cV;if(cH(cZ)){cX.removeAttr(cW);cV=Q(cX.attr(bL)||"{}");cV[aH[cW]||cW]=cY;cX.attr(bL,cm(cV))}});function bN(cW,cV){var cX=cV.attr("name");if(!cX){throw"Required field 'name' not found."}return{get:function(){return cW.$eval(cX)},set:function(cY){if(cY!==cS){return cW.$tryEval(cX+"="+cm(cY),cV)}}}}function bn(cY,cX){var cV=bN(cY,cX),cZ=cX.attr("ng:format")||o,cW=l(cZ);if(!cW){throw"Formatter named '"+cZ+"' not found."}return{get:function(){return cW.format(cV.get())},set:function(c0){return cV.set(cW.parse(c0))}}}function d(cV){return S(cV).validator()()}function b1(c6,cZ){var cX=cZ.attr("ng:validate")||o,cW=d(cX),cV=cZ.attr("ng:required"),c7=cZ.attr("ng:format")||o,c5=l(c7),c4,cY,c1,c0,c3=c6.$invalidWidgets||{markValid:j,markInvalid:j};if(!cW){throw"Validator named '"+cX+"' not found."}if(!c5){throw"Formatter named '"+c7+"' not found."}c4=c5.format;cY=c5.parse;if(cV){c6.$watch(cV,function(c8){c0=c8;c2()})}else{c0=cV===""}cZ.data(bf,c2);return{get:function(){if(c1){b0(cZ,k,a6)}try{var c8=cY(cZ.val());c2();return c8}catch(c9){c1=c9;b0(cZ,k,c9)}},set:function(c9){var c8=cZ.val(),da=c4(c9);if(c8!=da){cZ.val(da||"")}c2()}};function c2(){var da=av(cZ.val());if(cZ[0].disabled||cZ[0].readOnly){b0(cZ,k,a6);c3.markValid(cZ)}else{var c9,c8=b5(c6,{$element:cZ});c9=c0&&!da?"Required":(da?cW(c8,da):a6);b0(cZ,k,c9);c1=c9;if(c9){c3.markInvalid(cZ)}else{c3.markValid(cZ)}}}}function aJ(cW,cV){var cY=cV[0],cX=cY.value;return{get:function(){return !!cY.checked},set:function(cZ){cY.checked=cp(cZ)}}}function cP(cW,cV){var cX=cV[0];return{get:function(){return cX.checked?cX.value:a6},set:function(cY){cX.checked=cY==cX.value}}}function cz(cX,cW){var cV=cW[0].options;return{get:function(){var cY=[];aS(cV,function(cZ){if(cZ.selected){cY.push(cZ.value)}});return cY},set:function(cY){var cZ={};aS(cY,function(c0){cZ[c0]=true});aS(cV,function(c0){c0.selected=cZ[c0.value]})}}}function O(){return{get:j,set:j}}var bl=bZ("keyup change",bN,b1,h()),b3=bZ("click",O,O,j),cM={text:bl,textarea:bl,hidden:bl,password:bl,button:b3,submit:b3,reset:b3,image:b3,checkbox:bZ("click",bn,aJ,h(false)),radio:bZ("click",bn,cP,ct),"select-one":bZ("change",bn,b1,h(a6)),"select-multiple":bZ("change",bn,cz,h([]))};function h(cV){return function(cX,cW){var cY=cW.get();if(!cY&&cv(cV)){cY=bv(cV)}if(bB(cX.get())&&cv(cY)){cX.set(cY)}}}function ct(cY,cV,cZ){var cX=cY.get(),c0=cV.get(),cW=cZ[0];cW.checked=false;cW.name=this.$id+"@"+cW.name;if(bB(cX)){cY.set(cX=a6)}if(cX==a6&&c0!==a6){cY.set(c0)}cV.set(cX)}function bZ(cX,cW,cV,cY){return function(c2){var c3=this,c1=cW(c3,c2),cZ=cV(c3,c2),c4=c2.attr("ng:change")||"",c0;cY.call(c3,c1,cZ,c2);this.$eval(c2.attr("ng:init")||"");if(c4||cW!==O){c2.bind(cX,function(){c1.set(cZ.get());c0=c1.get();c3.$tryEval(c4,c2);c3.$root.$eval()})}c3.$watch(c1.get,function(c5){if(c0!==c5){cZ.set(c0=c5)}})}}function X(cV){this.directives(true);return cM[am(cV[0].type)]||j}B("input",X);B("textarea",X);B("button",X);B("select",function(cV){this.descend(true);return X.call(this,cV)});B("option",function(){this.descend(true);this.directives(true);return function(cZ){var cV=cZ.parent();var c1=ae(cV);var cY=bn(c1,cV);var cW=b1(c1,cV);var c0=cZ;var cX=c0.attr(ay);var c2=c0.attr("ng-"+aA);cZ.data(ac,function(){var c5=c0.attr(ay);var c4=c0.attr("ng-"+aA);var c3=cY.get();if(c2!=c4||cX!=c5){c2=c4;cX=c5;if(c4||c3==a6||c3==cS){cY.set(c5)}if(c5==c3){cW.set(cX)}}})}});B("ng:include",function(cX){var cY=this,cW=cX.attr("src"),cZ=cX.attr("scope")||"",cV=cX[0].getAttribute("onload")||"";if(cX[0]["ng:compiled"]){this.descend(true);this.directives(true)}else{cX[0]["ng:compiled"]=true;return b7(function(c5,c2){var c4=this,c0;var c6=0;var c3=false;function c1(){c6++}this.$watch(cW,c1);this.$watch(cZ,c1);c4.$onEval(function(){if(c0&&!c3){c3=true;try{c0.$eval()}finally{c3=false}}});this.$watch(function(){return c6},function(){var c8=this.$eval(cW),c7=this.$eval(cZ);if(c8){c5("GET",c8,function(da,c9){c2.html(c9);c0=c7||bV(c4);cY.compile(c2)(c2,c0);c0.$init();c4.$eval(cV)})}else{c0=null;c2.html("")}})},{$inject:["$xhr.cache"]})}});var m=B("ng:switch",function(cZ){var c0=this,cY=cZ.attr("on"),c2=(cZ.attr("using")||"equals"),cV=c2.split(":"),cW=m[cV.shift()],cX=cZ.attr("change")||"",c1=[];if(!cW){throw"Using expression '"+c2+"' unknown."}if(!cY){throw"Missing 'on' attribute."}aX(cZ,function(c5){var c3=c5.attr("ng:switch-when");var c4={change:cX,element:c5,template:c0.compile(c5)};if(ci(c3)){c4.when=function(c7,c8){var c6=[c8,c3];aS(cV,function(c9){c6.push(c9)});return cW.apply(c7,c6)};c1.unshift(c4)}else{if(ci(c5.attr("ng:switch-default"))){c4.when=cr(true);c1.push(c4)}}});aS(c1,function(c3){c3.element.remove()});cZ.html("");return function(c4){var c5=this,c3;this.$watch(cY,function(c7){var c6=false;c4.html("");c3=bV(c5);aS(c1,function(c8){if(!c6&&c8.when(c3,c7)){c6=true;var c9=A(c8.element);c4.append(c9);c3.$tryEval(c8.change,c4);c8.template(c9,c3);c3.$init()}})});c5.$onEval(function(){if(c3){c3.$eval()}})}},{equals:function(cW,cV){return""+cW==cV},route:bj});B("a",function(){this.descend(true);this.directives(true);return function(cV){if(cV.attr("href")===""){cV.bind("click",function(cW){cW.preventDefault()})}}});B("@ng:repeat",function(cX,cV){cV.removeAttr("ng:repeat");cV.replaceWith(this.comment("ng:repeat: "+cX));var cW=this.compile(cV);return function(cY){var c2=cX.match(/^\s*(.+)\s+in\s+(.*)\s*$/),cZ,c5,c0,c4;if(!c2){throw cK("Expected ng:repeat in form of 'item in collection' but got '"+cX+"'.")}cZ=c2[1];c5=c2[2];c2=cZ.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!c2){throw cK("'item' in 'item in collection' should be identifier or (key, value) but got '"+keyValue+"'.")}c0=c2[3]||c2[1];c4=c2[2];var c3=[],c1=this;this.$onEval(function(){var c8=0,c7=c3.length,dd=cY,dc=this.$tryEval(c5,cY),da=a9(dc),db=0,c6,c9;if(da){db=dc.length}else{for(c9 in dc){if(dc.hasOwnProperty(c9)){db++}}}for(c9 in dc){if(!da||dc.hasOwnProperty(c9)){if(c8<c7){c6=c3[c8];c6[c0]=dc[c9];if(c4){c6[c4]=c9}}else{c6=cW(A(cV),bV(c1));c6[c0]=dc[c9];if(c4){c6[c4]=c9}dd.after(c6.$element);c6.$index=c8;c6.$position=c8==0?"first":(c8==db-1?"last":"middle");c6.$element.attr("ng:repeat-index",c8);c6.$init();c3.push(c6)}c6.$eval();dd=c6.$element;c8++}}while(c3.length>c8){c3.pop().$element.remove()}},cY)}});B("@ng:non-bindable",j);var cj;bs("$browser",function(cV){if(!cj){cj=new aO(bU.location,ck(bU.document),ck(bU.document.getElementsByTagName("head")[0]),L,cV,bU.setTimeout);cj.startPoller(50,function(cW,cX){setTimeout(cW,cX)});cj.bind()}return cj},{inject:["$log"]});b7(aB,{element:ck,compile:a2,scope:bV,copy:bv,extend:b7,equals:p,foreach:aS,injector:bY,noop:j,bind:bF,toJson:cm,fromJson:Q,identity:aG,isUndefined:bB,isDefined:cv,isString:ci,isFunction:E,isObject:cR,isNumber:aU,isArray:a9});aB.scenario=aB.scenario||{};aB.scenario.output=aB.scenario.output||function(cV,cW){aB.scenario.output[cV]=cW};aB.scenario.dsl=aB.scenario.dsl||function(cV,cW){aB.scenario.dsl[cV]=function(){function cX(c3,c1){var cZ=c3.apply(this,c1);if(aB.isFunction(cZ)||cZ instanceof aB.scenario.Future){return cZ}var c0=this;var c2=aB.extend({},cZ);aB.foreach(c2,function(c5,c4){if(aB.isFunction(c5)){c2[c4]=function(){return cX.call(c0,c5,arguments)}}else{c2[c4]=c5}});return c2}var cY=cW.apply(this,arguments);return function(){return cX.call(this,cY,arguments)}}};aB.scenario.matcher=aB.scenario.matcher||function(cV,cW){aB.scenario.matcher[cV]=function(cY){var cZ="expect "+this.future.name+" ";if(this.inverse){cZ+="not "}var cX=this;this.addFuture(cZ+cV+" "+aB.toJson(cY),function(c0){var c1;cX.actual=cX.future.value;if((cX.inverse&&cW.call(cX,cY))||(!cX.inverse&&!cW.call(cX,cY))){c1="expected "+aB.toJson(cY)+" but was "+aB.toJson(cX.actual)}c0(c1)})}};function i(c0,cZ){var cX=bU.location.href;var cV=b8(r.body);var cW=[];if(cZ.scenario_output){cW=cZ.scenario_output.split(",")}aB.foreach(aB.scenario.output,function(c4,c2){if(!cW.length||cO(cW,c2)!=-1){var c3=cV.append("<div></div>").find("div:last");c3.attr("id",c2);c4.call({},c3,c0)}});if(!/^http/.test(cX)&&!/^https/.test(cX)){cV.append('<p id="system-error"></p>');cV.find("#system-error").text("Scenario runner must be run using http or https. The protocol "+cX.split(":")[0]+":// is not supported.");return}var c1=cV.append('<div id="application"></div>').find("#application");var cY=new aB.scenario.Application(c1);c0.on("RunnerEnd",function(){c1.css("display","none");c1.find("iframe").attr("src","about:blank")});c0.on("RunnerError",function(c2){if(bU.console){console.log(V(c2))}else{alert(c2)}});c0.run(cY)}function W(cZ,cY,cW){var cX=0;function cV(c1,c0){if(c0&&c0>cX){cX=c0}if(c1||cX>=cZ.length){cW(c1)}else{try{cY(cZ[cX++],cV)}catch(c2){cW(c2)}}}cV()}function V(cW,cX){cX=cX||5;var cY=cW.toString();if(cW.stack){var cV=cW.stack.split("\n");if(cV[0].indexOf(cY)===-1){cX++;cV.unshift(cW.message)}cY=cV.slice(0,cX).join("\n")}return cY}function x(cW){var cV=new cK();return function(){var cX=(cV.stack||"").split("\n")[cW];if(cX){if(cX.indexOf("@")!==-1){cX=cX.substring(cX.indexOf("@")+1)}else{cX=cX.substring(cX.indexOf("(")+1).replace(")","")}}return cX||""}}function c(cV,cW){if(cV&&!cV.nodeName){cV=cV[0]}if(!cV){return}if(!cW){cW={text:"change",textarea:"change",hidden:"change",password:"change",button:"click",submit:"click",reset:"click",image:"click",checkbox:"click",radio:"click","select-one":"change","select-multiple":"change"}[cV.type]||"click"}if(am(au(cV))=="option"){cV.parentNode.value=cV.value;cV=cV.parentNode;cW="change"}if(at){switch(cV.type){case"radio":case"checkbox":cV.checked=!cV.checked;break}cV.fireEvent("on"+cW);if(am(cV.type)=="submit"){while(cV){if(am(cV.nodeName)=="form"){cV.fireEvent("onsubmit");break}cV=cV.parentNode}}}else{var cX=r.createEvent("MouseEvents");cX.initMouseEvent(cW,true,true,bU,0,0,0,0,0,false,false,false,false,0,cV);cV.dispatchEvent(cX)}}(function(cW){var cV=cW.trigger;cW.trigger=function(cX){if(/(click|change|keyup)/.test(cX)){return this.each(function(cY,cZ){c(cZ,cX)})}return cV.apply(this,arguments)}})(b8.fn);b8.fn.bindings=function(cW){function cX(cZ,cY){return cY instanceof RegExp?cY.test(cZ):cZ&&cZ.indexOf(cY)>=0}var cV=[];this.find(".ng-binding:visible").each(function(){var cY=new b8(this);if(!aB.isDefined(cW)||cX(cY.attr("ng:bind"),cW)||cX(cY.attr("ng:bind-template"),cW)){if(cY.is("input, textarea")){cV.push(cY.val())}else{cV.push(cY.html())}}});return cV};aB.scenario.Application=function(cV){this.context=cV;cV.append('<h2>Current URL: <a href="about:blank">None</a></h2><div id="test-frames"></div>')};aB.scenario.Application.prototype.getFrame_=function(){return this.context.find("#test-frames iframe:last")};aB.scenario.Application.prototype.getWindow_=function(){var cV=this.getFrame_().attr("contentWindow");if(!cV){throw"Frame window is not accessible."}return cV};aB.scenario.Application.prototype.checkUrlStatus_=function(cW,cX){var cV=this;b8.ajax({url:cW,type:"HEAD",complete:function(cY){if(cY.status<200||cY.status>=300){if(!cY.status){cX.call(cV,"Sandbox Error: Cannot access "+cW)}else{cX.call(cV,cY.status+" "+cY.statusText)}}else{cX.call(cV)}}})};aB.scenario.Application.prototype.navigateTo=function(cW,cX,cZ){var cV=this;var cY=this.getFrame_();cZ=cZ||function(c0){throw c0};if(cW==="about:blank"){cZ("Sandbox Error: Navigating to about:blank is not allowed.")}else{if(cW.charAt(0)==="#"){cW=cY.attr("src").split("#")[0]+cW;cY.attr("src",cW);this.executeAction(cX)}else{cY.css("display","none").attr("src","about:blank");this.checkUrlStatus_(cW,function(c0){if(c0){return cZ(c0)}cV.context.find("#test-frames").append("<iframe>");cY=this.getFrame_();cY.load(function(){cY.unbind();try{cV.executeAction(cX)}catch(c1){cZ(c1)}}).attr("src",cW)})}}this.context.find("> h2 a").attr("href",cW).text(cW)};aB.scenario.Application.prototype.executeAction=function(cX){var cW=this;var cY=this.getWindow_();if(!cY.document){throw"Sandbox Error: Application document not accessible."}if(!cY.angular){return cX.call(this,cY,b8(cY.document))}var cV=cY.angular.service.$browser();cV.poll();cV.notifyWhenNoOutstandingRequests(function(){cX.call(cW,cY,b8(cY.document))})};aB.scenario.Describe=function(cW,cY){this.only=cY&&cY.only;this.beforeEachFns=[];this.afterEachFns=[];this.its=[];this.children=[];this.name=cW;this.parent=cY;this.id=aB.scenario.Describe.id++;var cV=this.beforeEachFns;this.setupBefore=function(){if(cY){cY.setupBefore.call(this)}aB.foreach(cV,function(cZ){cZ.call(this)},this)};var cX=this.afterEachFns;this.setupAfter=function(){aB.foreach(cX,function(cZ){cZ.call(this)},this);if(cY){cY.setupAfter.call(this)}}};aB.scenario.Describe.id=0;aB.scenario.Describe.prototype.beforeEach=function(cV){this.beforeEachFns.push(cV)};aB.scenario.Describe.prototype.afterEach=function(cV){this.afterEachFns.push(cV)};aB.scenario.Describe.prototype.describe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.ddescribe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);cX.only=true;this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.xdescribe=aB.noop;aB.scenario.Describe.prototype.it=function(cW,cV){this.its.push({definition:this,only:this.only,name:cW,before:this.setupBefore,body:cV,after:this.setupAfter})};aB.scenario.Describe.prototype.iit=function(cW,cV){this.it.apply(this,arguments);this.its[this.its.length-1].only=true};aB.scenario.Describe.prototype.xit=aB.noop;aB.scenario.Describe.prototype.getSpecs=function(){var cW=arguments[0]||[];aB.foreach(this.children,function(cX){cX.getSpecs(cW)});aB.foreach(this.its,function(cX){cW.push(cX)});var cV=[];aB.foreach(cW,function(cX){if(cX.only){cV.push(cX)}});return(cV.length&&cV)||cW};aB.scenario.Future=function(cW,cX,cV){this.name=cW;this.behavior=cX;this.fulfilled=false;this.value=undefined;this.parser=aB.identity;this.line=cV||function(){return""}};aB.scenario.Future.prototype.execute=function(cW){var cV=this;this.behavior(function(cY,cX){cV.fulfilled=true;if(cX){try{cX=cV.parser(cX)}catch(cZ){cY=cZ}}cV.value=cY||cX;cW(cY,cX)})};aB.scenario.Future.prototype.parsedWith=function(cV){this.parser=cV;return this};aB.scenario.Future.prototype.fromJson=function(){return this.parsedWith(aB.fromJson)};aB.scenario.Future.prototype.toJson=function(){return this.parsedWith(aB.toJson)};aB.scenario.ObjectModel=function(cX){var cW=this;this.specMap={};this.value={name:"",children:{}};cX.on("SpecBegin",function(cY){var cZ=cW.value;aB.foreach(cW.getDefinitionPath(cY),function(c0){if(!cZ.children[c0.name]){cZ.children[c0.name]={id:c0.id,name:c0.name,children:{},specs:{}}}cZ=cZ.children[c0.name]});cW.specMap[cY.id]=cZ.specs[cY.name]=new aB.scenario.ObjectModel.Spec(cY.id,cY.name)});cX.on("SpecError",function(cY,cZ){var c0=cW.getSpec(cY.id);c0.status="error";c0.error=cZ});cX.on("SpecEnd",function(cY){var cZ=cW.getSpec(cY.id);cV(cZ)});cX.on("StepBegin",function(cY,c0){var cZ=cW.getSpec(cY.id);cZ.steps.push(new aB.scenario.ObjectModel.Step(c0.name))});cX.on("StepEnd",function(cY,c0){var cZ=cW.getSpec(cY.id);if(cZ.getLastStep().name!==c0.name){throw"Events fired in the wrong order. Step names don' match."}cV(cZ.getLastStep())});cX.on("StepFailure",function(cY,c2,cZ){var c0=cW.getSpec(cY.id);var c1=c0.getLastStep();c1.error=cZ;if(!c0.status){c0.status=c1.status="failure"}});cX.on("StepError",function(cY,c2,cZ){var c0=cW.getSpec(cY.id);var c1=c0.getLastStep();c0.status="error";c1.status="error";c1.error=cZ});function cV(cY){cY.endTime=new Date().getTime();cY.duration=cY.endTime-cY.startTime;cY.status=cY.status||"success"}};aB.scenario.ObjectModel.prototype.getDefinitionPath=function(cV){var cX=[];var cW=cV.definition;while(cW&&cW.name){cX.unshift(cW);cW=cW.parent}return cX};aB.scenario.ObjectModel.prototype.getSpec=function(cV){return this.specMap[cV]};aB.scenario.ObjectModel.Spec=function(cW,cV){this.id=cW;this.name=cV;this.startTime=new Date().getTime();this.steps=[]};aB.scenario.ObjectModel.Spec.prototype.addStep=function(cV){var cW=new aB.scenario.ObjectModel.Step(cV);this.steps.push(cW);return cW};aB.scenario.ObjectModel.Spec.prototype.getLastStep=function(){return this.steps[this.steps.length-1]};aB.scenario.ObjectModel.Step=function(cV){this.name=cV;this.startTime=new Date().getTime()};aB.scenario.Describe=function(cW,cY){this.only=cY&&cY.only;this.beforeEachFns=[];this.afterEachFns=[];this.its=[];this.children=[];this.name=cW;this.parent=cY;this.id=aB.scenario.Describe.id++;var cV=this.beforeEachFns;this.setupBefore=function(){if(cY){cY.setupBefore.call(this)}aB.foreach(cV,function(cZ){cZ.call(this)},this)};var cX=this.afterEachFns;this.setupAfter=function(){aB.foreach(cX,function(cZ){cZ.call(this)},this);if(cY){cY.setupAfter.call(this)}}};aB.scenario.Describe.id=0;aB.scenario.Describe.prototype.beforeEach=function(cV){this.beforeEachFns.push(cV)};aB.scenario.Describe.prototype.afterEach=function(cV){this.afterEachFns.push(cV)};aB.scenario.Describe.prototype.describe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.ddescribe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);cX.only=true;this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.xdescribe=aB.noop;aB.scenario.Describe.prototype.it=function(cW,cV){this.its.push({definition:this,only:this.only,name:cW,before:this.setupBefore,body:cV,after:this.setupAfter})};aB.scenario.Describe.prototype.iit=function(cW,cV){this.it.apply(this,arguments);this.its[this.its.length-1].only=true};aB.scenario.Describe.prototype.xit=aB.noop;aB.scenario.Describe.prototype.getSpecs=function(){var cW=arguments[0]||[];aB.foreach(this.children,function(cX){cX.getSpecs(cW)});aB.foreach(this.its,function(cX){cW.push(cX)});var cV=[];aB.foreach(cW,function(cX){if(cX.only){cV.push(cX)}});return(cV.length&&cV)||cW};aB.scenario.Runner=function(cV){this.listeners=[];this.$window=cV;this.rootDescribe=new aB.scenario.Describe();this.currentDescribe=this.rootDescribe;this.api={it:this.it,iit:this.iit,xit:aB.noop,describe:this.describe,ddescribe:this.ddescribe,xdescribe:aB.noop,beforeEach:this.beforeEach,afterEach:this.afterEach};aB.foreach(this.api,aB.bind(this,function(cX,cW){this.$window[cW]=aB.bind(this,cX)}))};aB.scenario.Runner.prototype.emit=function(cW){var cV=this;var cX=Array.prototype.slice.call(arguments,1);cW=cW.toLowerCase();if(!this.listeners[cW]){return}aB.foreach(this.listeners[cW],function(cY){cY.apply(cV,cX)})};aB.scenario.Runner.prototype.on=function(cV,cW){cV=cV.toLowerCase();this.listeners[cV]=this.listeners[cV]||[];this.listeners[cV].push(cW)};aB.scenario.Runner.prototype.describe=function(cX,cV){var cW=this;this.currentDescribe.describe(cX,function(){var cY=cW.currentDescribe;cW.currentDescribe=this;try{cV.call(this)}finally{cW.currentDescribe=cY}})};aB.scenario.Runner.prototype.ddescribe=function(cX,cV){var cW=this;this.currentDescribe.ddescribe(cX,function(){var cY=cW.currentDescribe;cW.currentDescribe=this;try{cV.call(this)}finally{cW.currentDescribe=cY}})};aB.scenario.Runner.prototype.it=function(cW,cV){this.currentDescribe.it(cW,cV)};aB.scenario.Runner.prototype.iit=function(cW,cV){this.currentDescribe.iit(cW,cV)};aB.scenario.Runner.prototype.beforeEach=function(cV){this.currentDescribe.beforeEach(cV)};aB.scenario.Runner.prototype.afterEach=function(cV){this.currentDescribe.afterEach(cV)};aB.scenario.Runner.prototype.createSpecRunner_=function(cV){return cV.$new(aB.scenario.SpecRunner)};aB.scenario.Runner.prototype.run=function(cW){var cV=this;var cX=aB.scope(this);cX.application=cW;this.emit("RunnerBegin");W(this.rootDescribe.getSpecs(),function(cY,c1){var cZ={};var c0=cV.createSpecRunner_(cX);aB.foreach(aB.scenario.dsl,function(c3,c2){cZ[c2]=c3.call(cX)});aB.foreach(aB.scenario.dsl,function(c3,c2){cV.$window[c2]=function(){var c4=x(3);var c5=aB.scope(c0);c5.dsl={};aB.foreach(cZ,function(c7,c6){c5.dsl[c6]=function(){return cZ[c6].apply(c5,arguments)}});c5.addFuture=function(){Array.prototype.push.call(arguments,c4);return aB.scenario.SpecRunner.prototype.addFuture.apply(c5,arguments)};c5.addFutureAction=function(){Array.prototype.push.call(arguments,c4);return aB.scenario.SpecRunner.prototype.addFutureAction.apply(c5,arguments)};return c5.dsl[c2].apply(c5,arguments)}});c0.run(cY,c1)},function(cY){if(cY){cV.emit("RunnerError",cY)}cV.emit("RunnerEnd")})};aB.scenario.SpecRunner=function(){this.futures=[];this.afterIndex=0};aB.scenario.SpecRunner.prototype.run=function(cW,cY){var cV=this;this.spec=cW;this.emit("SpecBegin",cW);try{cW.before.call(this);cW.body.call(this);this.afterIndex=this.futures.length;cW.after.call(this)}catch(cX){this.emit("SpecError",cW,cX);this.emit("SpecEnd",cW);cY();return}var cZ=function(c1,c0){if(cV.error){return c0()}cV.error=true;c0(null,cV.afterIndex)};W(this.futures,function(c0,c1){cV.step=c0;cV.emit("StepBegin",cW,c0);try{c0.execute(function(c3){if(c3){cV.emit("StepFailure",cW,c0,c3);cV.emit("StepEnd",cW,c0);return cZ(c3,c1)}cV.emit("StepEnd",cW,c0);cV.$window.setTimeout(function(){c1()},0)})}catch(c2){cV.emit("StepError",cW,c0,c2);cV.emit("StepEnd",cW,c0);cZ(c2,c1)}},function(c0){if(c0){cV.emit("SpecError",cW,c0)}cV.emit("SpecEnd",cW);cV.$window.setTimeout(function(){cY()},0)})};aB.scenario.SpecRunner.prototype.addFuture=function(cX,cY,cW){var cV=new aB.scenario.Future(cX,aB.bind(this,cY),cW);this.futures.push(cV);return cV};aB.scenario.SpecRunner.prototype.addFutureAction=function(cX,cY,cV){var cW=this;return this.addFuture(cX,function(cZ){this.application.executeAction(function(c2,c1){c1.elements=function(c4){var c5=Array.prototype.slice.call(arguments,1);c4=(cW.selector||"")+" "+(c4||"");c4=b8.trim(c4)||"*";aB.foreach(c5,function(c7,c6){c4=c4.replace("$"+(c6+1),c7)});var c3=c1.find(c4);if(!c3.length){throw {type:"selector",message:"Selector "+c4+" did not match any elements."}}return c3};try{cY.call(cW,c2,c1,cZ)}catch(c0){if(c0.type&&c0.type==="selector"){cZ(c0.message)}else{throw c0}}})},cV)};aB.scenario.dsl("wait",function(){return function(){return this.addFuture("waiting for you to resume",function(cV){this.emit("InteractiveWait",this.spec,this.step);this.$window.resume=function(){cV()}})}});aB.scenario.dsl("pause",function(){return function(cV){return this.addFuture("pause for "+cV+" seconds",function(cW){this.$window.setTimeout(function(){cW(null,cV*1000)},cV*1000)})}});aB.scenario.dsl("browser",function(){var cV={};cV.navigateTo=function(cX,cY){var cW=this.application;return this.addFuture("browser navigate to '"+cX+"'",function(cZ){if(cY){cX=cY.call(this,cX)}cW.navigateTo(cX,function(){cZ(null,cX)},cZ)})};cV.reload=function(){var cW=this.application;return this.addFutureAction("browser reload",function(c0,cZ,cX){var cY=c0.location.href;cW.navigateTo(cY,function(){cX(null,cY)},cX)})};cV.location=function(){var cW={};cW.href=function(){return this.addFutureAction("browser url",function(cZ,cY,cX){cX(null,cZ.location.href)})};cW.hash=function(){return this.addFutureAction("browser url hash",function(cZ,cY,cX){cX(null,cZ.location.hash.replace("#",""))})};cW.path=function(){return this.addFutureAction("browser url path",function(cZ,cY,cX){cX(null,cZ.location.pathname)})};cW.search=function(){return this.addFutureAction("browser url search",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.search)})};cW.hashSearch=function(){return this.addFutureAction("browser url hash search",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.hashSearch)})};cW.hashPath=function(){return this.addFutureAction("browser url hash path",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.hashPath)})};return cW};return function(cW){return cV}});aB.scenario.dsl("expect",function(){var cV=aB.extend({},aB.scenario.matcher);cV.not=function(){this.inverse=true;return cV};return function(cW){this.future=cW;return cV}});aB.scenario.dsl("using",function(){return function(cV,cW){this.selector=b8.trim((this.selector||"")+" "+cV);if(aB.isString(cW)&&cW.length){this.label=cW+" ( "+this.selector+" )"}else{this.label=this.selector}return this.dsl}});aB.scenario.dsl("binding",function(){return function(cV){return this.addFutureAction("select binding '"+cV+"'",function(cZ,cY,cW){var cX=cY.elements().bindings(cV);if(!cX.length){return cW("Binding selector '"+cV+"' did not match.")}cW(null,cX[0])})}});aB.scenario.dsl("input",function(){var cV={};cV.enter=function(cW){return this.addFutureAction("input '"+this.name+"' enter '"+cW+"'",function(c0,cZ,cX){var cY=cZ.elements(':input[name="$1"]',this.name);cY.val(cW);cY.trigger("change");cX()})};cV.check=function(){return this.addFutureAction("checkbox '"+this.name+"' toggle",function(cZ,cY,cW){var cX=cY.elements(':checkbox[name="$1"]',this.name);cX.trigger("click");cW()})};cV.select=function(cW){return this.addFutureAction("radio button '"+this.name+"' toggle '"+cW+"'",function(c0,cZ,cX){var cY=cZ.elements(':radio[name$="@$1"][value="$2"]',this.name,cW);cY.trigger("click");cX()})};return function(cW){this.name=cW;return cV}});aB.scenario.dsl("repeater",function(){var cV={};cV.count=function(){return this.addFutureAction("repeater '"+this.label+"' count",function(cZ,cY,cW){try{cW(null,cY.elements().length)}catch(cX){cW(null,0)}})};cV.column=function(cW){return this.addFutureAction("repeater '"+this.label+"' column '"+cW+"'",function(cZ,cY,cX){cX(null,cY.elements().bindings(cW))})};cV.row=function(cW){return this.addFutureAction("repeater '"+this.label+"' row '"+cW+"'",function(c1,c0,cX){var cY=[];var cZ=c0.elements().slice(cW,cW+1);if(!cZ.length){return cX("row "+cW+" out of bounds")}cX(null,cZ.bindings())})};return function(cW,cX){this.dsl.using(cW,cX);return cV}});aB.scenario.dsl("select",function(){var cV={};cV.option=function(cW){return this.addFutureAction("select '"+this.name+"' option '"+cW+"'",function(c0,cZ,cY){var cX=cZ.elements('select[name="$1"]',this.name);cX.val(cW);cX.trigger("change");cY()})};cV.options=function(){var cW=arguments;return this.addFutureAction("select '"+this.name+"' options '"+cW+"'",function(c0,cZ,cY){var cX=cZ.elements('select[multiple][name="$1"]',this.name);cX.val(cW);cX.trigger("change");cY()})};return function(cW){this.name=cW;return cV}});aB.scenario.dsl("element",function(){var cV=["attr","css"];var cX=["val","text","html","height","innerHeight","outerHeight","width","innerWidth","outerWidth","position","scrollLeft","scrollTop","offset"];var cW={};cW.count=function(){return this.addFutureAction("element '"+this.label+"' count",function(c1,c0,cY){try{cY(null,c0.elements().length)}catch(cZ){cY(null,0)}})};cW.click=function(){return this.addFutureAction("element '"+this.label+"' click",function(c2,c1,cY){var c0=c1.elements();var cZ=c0.attr("href");c0.trigger("click");if(cZ&&c0[0].nodeName.toUpperCase()==="A"){this.application.navigateTo(cZ,function(){cY()},cY)}else{cY()}})};cW.query=function(cY){return this.addFutureAction("element "+this.label+" custom query",function(c1,c0,cZ){cY.call(this,c0.elements(),cZ)})};aB.foreach(cV,function(cY){cW[cY]=function(cZ,c1){var c0="element '"+this.label+"' get "+cY+" '"+cZ+"'";if(aB.isDefined(c1)){c0="element '"+this.label+"' set "+cY+" '"+cZ+"' to '"+c1+"'"}return this.addFutureAction(c0,function(c5,c4,c2){var c3=c4.elements();c2(null,c3[cY].call(c3,cZ,c1))})}});aB.foreach(cX,function(cY){cW[cY]=function(c0){var cZ="element '"+this.label+"' "+cY;if(aB.isDefined(c0)){cZ="element '"+this.label+"' set "+cY+" to '"+c0+"'"}return this.addFutureAction(cZ,function(c4,c3,c1){var c2=c3.elements();c1(null,c2[cY].call(c2,c0))})}});return function(cY,cZ){this.dsl.using(cY,cZ);return cW}});aB.scenario.matcher("toEqual",function(cV){return aB.equals(this.actual,cV)});aB.scenario.matcher("toBe",function(cV){return this.actual===cV});aB.scenario.matcher("toBeDefined",function(){return aB.isDefined(this.actual)});aB.scenario.matcher("toBeTruthy",function(){return this.actual});aB.scenario.matcher("toBeFalsy",function(){return !this.actual});aB.scenario.matcher("toMatch",function(cV){return new RegExp(cV).test(this.actual)});aB.scenario.matcher("toBeNull",function(){return this.actual===null});aB.scenario.matcher("toContain",function(cV){return u(this.actual,cV)});aB.scenario.matcher("toBeLessThan",function(cV){return this.actual<cV});aB.scenario.matcher("toBeGreaterThan",function(cV){return this.actual>cV});aB.scenario.output("html",function(cY,c0){var cX=new aB.scenario.ObjectModel(c0);cY.append('<div id="header"> <h1><span class="angular">&lt;angular/&gt;</span>: Scenario Test Runner</h1> <ul id="status-legend" class="status-display"> <li class="status-error">0 Errors</li> <li class="status-failure">0 Failures</li> <li class="status-success">0 Passed</li> </ul></div><div id="specs"> <div class="test-children"></div></div>');c0.on("InteractiveWait",function(c1,c2){var c3=cX.getSpec(c1.id).getLastStep().ui;c3.find(".test-title").html('waiting for you to <a href="javascript:resume()">resume</a>.')});c0.on("SpecBegin",function(c1){var c2=cZ(c1);c2.find("> .tests").append('<li class="status-pending test-it"></li>');c2=c2.find("> .tests li:last");c2.append('<div class="test-info"> <p class="test-title"> <span class="timer-result"></span> <span class="test-name"></span> </p></div><div class="scrollpane"> <ol class="test-actions"></ol></div>');c2.find("> .test-info .test-name").text(c1.name);c2.find("> .test-info").click(function(){var c4=c2.find("> .scrollpane");var c5=c4.find("> .test-actions");var c3=cY.find("> .test-info .test-name");if(c5.find(":visible").length){c5.hide();c3.removeClass("open").addClass("closed")}else{c5.show();c4.attr("scrollTop",c4.attr("scrollHeight"));c3.removeClass("closed").addClass("open")}});cX.getSpec(c1.id).ui=c2});c0.on("SpecError",function(c1,c2){var c3=cX.getSpec(c1.id).ui;c3.append("<pre></pre>");c3.find("> pre").text(V(c2))});c0.on("SpecEnd",function(c1){c1=cX.getSpec(c1.id);c1.ui.removeClass("status-pending");c1.ui.addClass("status-"+c1.status);c1.ui.find("> .test-info .timer-result").text(c1.duration+"ms");if(c1.status==="success"){c1.ui.find("> .test-info .test-name").addClass("closed");c1.ui.find("> .scrollpane .test-actions").hide()}cW(c1.status)});c0.on("StepBegin",function(c1,c3){c1=cX.getSpec(c1.id);c3=c1.getLastStep();c1.ui.find("> .scrollpane .test-actions").append('<li class="status-pending"></li>');c3.ui=c1.ui.find("> .scrollpane .test-actions li:last");c3.ui.append('<div class="timer-result"></div><div class="test-title"></div>');c3.ui.find("> .test-title").text(c3.name);var c2=c3.ui.parents(".scrollpane");c2.attr("scrollTop",c2.attr("scrollHeight"))});c0.on("StepFailure",function(c1,c3,c2){var c4=cX.getSpec(c1.id).getLastStep().ui;cV(c4,c3.line,c2)});c0.on("StepError",function(c1,c3,c2){var c4=cX.getSpec(c1.id).getLastStep().ui;cV(c4,c3.line,c2)});c0.on("StepEnd",function(c1,c3){c1=cX.getSpec(c1.id);c3=c1.getLastStep();c3.ui.find(".timer-result").text(c3.duration+"ms");c3.ui.removeClass("status-pending");c3.ui.addClass("status-"+c3.status);var c2=c1.ui.find("> .scrollpane");c2.attr("scrollTop",c2.attr("scrollHeight"))});function cZ(c1){var c2=cY.find("#specs");aB.foreach(cX.getDefinitionPath(c1),function(c3){var c4="describe-"+c3.id;if(!cY.find("#"+c4).length){c2.find("> .test-children").append('<div class="test-describe" id="'+c4+'"> <h2></h2> <div class="test-children"></div> <ul class="tests"></ul></div>');cY.find("#"+c4).find("> h2").text("describe: "+c3.name)}c2=cY.find("#"+c4)});return cY.find("#describe-"+c1.definition.id)}function cW(c1){var c2=cY.find("#status-legend .status-"+c1);var c4=c2.text().split(" ");var c3=(c4[0]*1)+1;c2.text(c3+" "+c4[1])}function cV(c3,c1,c2){c3.find(".test-title").append("<pre></pre>");var c4=b8.trim(c1()+"\n\n"+V(c2));c3.find(".test-title pre:last").text(c4)}});aB.scenario.output("json",function(cW,cX){var cV=new aB.scenario.ObjectModel(cX);cX.on("RunnerEnd",function(){cW.text(aB.toJson(cV.value))})});aB.scenario.output("xml",function(cW,cY){var cV=new aB.scenario.ObjectModel(cY);var cZ=function(c0){return new cW.init(c0)};cY.on("RunnerEnd",function(){var c0=cZ("<scenario></scenario>");cW.append(c0);cX(c0,cV.value)});function cX(c2,c0){aB.foreach(c0.children,function(c4){var c3=cZ("<describe></describe>");c3.attr("id",c4.id);c3.attr("name",c4.name);c2.append(c3);cX(c3,c4)});var c1=cZ("<its></its>");c2.append(c1);aB.foreach(c0.specs,function(c3){var c4=cZ("<it></it>");c4.attr("id",c3.id);c4.attr("name",c3.name);c4.attr("duration",c3.duration);c4.attr("status",c3.status);c1.append(c4);aB.foreach(c3.steps,function(c7){var c6=cZ("<step></step>");c6.attr("name",c7.name);c6.attr("duration",c7.duration);c6.attr("status",c7.status);c4.append(c6);if(c7.error){var c5=cZ("<error></error");c6.append(c5);c5.text(V(c6.error))}})})}});aB.scenario.output("object",function(cV,cW){cW.$window.$result=new aB.scenario.ObjectModel(cW).value});var ak=new aB.scenario.Runner(bU);bU.onload=function(){try{if(bi){bi()}}catch(cV){}i(ak,bH(r))}})(window,document,window.onload);document.write('<style type="text/css">@charset "UTF-8";\n\n.ng-format-negative {\n color: red;\n}\n\n.ng-exception {\n border: 2px solid #FF0000;\n font-family: "Courier New", Courier, monospace;\n font-size: smaller;\n white-space: pre;\n}\n\n.ng-validation-error {\n border: 2px solid #FF0000;\n}\n\n\n/*****************\n * TIP\n *****************/\n#ng-callout {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n font-size: 13px;\n font-weight: normal;\n font-family: Verdana, Arial, Helvetica, sans-serif;\n vertical-align: baseline;\n background: transparent;\n text-decoration: none;\n}\n\n#ng-callout .ng-arrow-left{\n background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7");\n background-repeat: no-repeat;\n background-position: left top;\n position: absolute;\n z-index:101;\n left:-12px;\n height:23px;\n width:10px;\n top:-3px;\n}\n\n#ng-callout .ng-arrow-right{\n background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7");\n background-repeat: no-repeat;\n background-position: left top;\n position: absolute;\n z-index:101;\n height:23px;\n width:11px;\n top:-2px;\n}\n\n#ng-callout {\n position: absolute;\n z-index:100;\n border: 2px solid #CCCCCC;\n background-color: #fff;\n}\n\n#ng-callout .ng-content{\n padding:10px 10px 10px 10px;\n color:#333333;\n}\n\n#ng-callout .ng-title{\n background-color: #CCCCCC;\n text-align: left;\n padding-left: 8px;\n padding-bottom: 5px;\n padding-top: 2px;\n font-weight:bold;\n}\n\n\n/*****************\n * indicators\n *****************/\n.ng-input-indicator-wait {\n background-image: url("data:image/png;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQJCgAAACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkECQoAAAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkECQoAAAAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAkKAAAALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==");\n background-position: right;\n background-repeat: no-repeat;\n}\n</style>');document.write("<style type=\"text/css\">@charset \"UTF-8\";\n/* CSS Document */\n\n/** Structure */\nbody {\n font-family: Arial, sans-serif;\n margin: 0;\n font-size: 14px;\n}\n\n#system-error {\n font-size: 1.5em;\n text-align: center;\n}\n\n#json, #xml {\n display: none;\n}\n\n#header {\n position: fixed;\n width: 100%;\n}\n\n#specs {\n padding-top: 50px;\n}\n\n#header .angular {\n font-family: Courier New, monospace;\n font-weight: bold;\n}\n\n#header h1 {\n font-weight: normal;\n float: left;\n font-size: 30px;\n line-height: 30px;\n margin: 0;\n padding: 10px 10px;\n height: 30px;\n}\n\n#application h2,\n#specs h2 {\n margin: 0;\n padding: 0.5em;\n font-size: 1.1em;\n}\n\n#status-legend {\n margin-top: 10px;\n margin-right: 10px;\n}\n\n#header,\n#application,\n.test-info,\n.test-actions li {\n overflow: hidden;\n}\n\n#application {\n margin: 10px;\n}\n\n#application iframe {\n width: 100%;\n height: 758px;\n}\n\n#application .popout {\n float: right;\n}\n\n#application iframe {\n border: none;\n}\n\n.tests li,\n.test-actions li,\n.test-it li,\n.test-it ol,\n.status-display {\n list-style-type: none;\n}\n\n.tests,\n.test-it ol,\n.status-display {\n margin: 0;\n padding: 0;\n}\n\n.test-info {\n margin-left: 1em;\n margin-top: 0.5em;\n border-radius: 8px 0 0 8px;\n -webkit-border-radius: 8px 0 0 8px;\n -moz-border-radius: 8px 0 0 8px;\n cursor: pointer;\n}\n\n.test-info:hover .test-name {\n text-decoration: underline;\n}\n\n.test-info .closed:before {\n content: '\\25b8\\00A0';\n}\n\n.test-info .open:before {\n content: '\\25be\\00A0';\n font-weight: bold;\n}\n\n.test-it ol {\n margin-left: 2.5em;\n}\n\n.status-display,\n.status-display li {\n float: right;\n}\n\n.status-display li {\n padding: 5px 10px;\n}\n\n.timer-result,\n.test-title {\n display: inline-block;\n margin: 0;\n padding: 4px;\n}\n\n.test-actions .test-title,\n.test-actions .test-result {\n display: table-cell;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n\n.test-actions {\n display: table;\n}\n\n.test-actions li {\n display: table-row;\n}\n\n.timer-result {\n width: 4em;\n padding: 0 10px;\n text-align: right;\n font-family: monospace;\n}\n\n.test-it pre,\n.test-actions pre {\n clear: left;\n color: black;\n margin-left: 6em;\n}\n\n.test-describe {\n padding-bottom: 0.5em;\n}\n\n.test-describe .test-describe {\n margin: 5px 5px 10px 2em;\n}\n\n.test-actions .status-pending .test-title:before {\n content: '\\00bb\\00A0';\n}\n\n.scrollpane {\n max-height: 20em;\n overflow: auto;\n}\n\n/** Colors */\n\n#header {\n background-color: #F2C200;\n}\n\n#specs h2 {\n border-top: 2px solid #BABAD1;\n}\n\n#specs h2,\n#application h2 {\n background-color: #efefef;\n}\n\n#application {\n border: 1px solid #BABAD1;\n}\n\n.test-describe .test-describe {\n border-left: 1px solid #BABAD1;\n border-right: 1px solid #BABAD1;\n border-bottom: 1px solid #BABAD1;\n}\n\n.status-display {\n border: 1px solid #777;\n}\n\n.status-display .status-pending,\n.status-pending .test-info {\n background-color: #F9EEBC;\n}\n\n.status-display .status-success,\n.status-success .test-info {\n background-color: #B1D7A1;\n}\n\n.status-display .status-failure,\n.status-failure .test-info {\n background-color: #FF8286;\n}\n\n.status-display .status-error,\n.status-error .test-info {\n background-color: black;\n color: white;\n}\n\n.test-actions .status-success .test-title {\n color: #30B30A;\n}\n\n.test-actions .status-failure .test-title {\n color: #DF0000;\n}\n\n.test-actions .status-error .test-title {\n color: black;\n}\n\n.test-actions .timer-result {\n color: #888;\n}\n</style>");
src/wics/node_modules/material-ui/svg-icons/image/timer-off.js
civiclee/Hack4Cause2017
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _SvgIcon = require('../../SvgIcon'); var _SvgIcon2 = _interopRequireDefault(_SvgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ImageTimerOff = function ImageTimerOff(props) { return _react2.default.createElement( _SvgIcon2.default, props, _react2.default.createElement('path', { d: 'M19.04 4.55l-1.42 1.42C16.07 4.74 14.12 4 12 4c-1.83 0-3.53.55-4.95 1.48l1.46 1.46C9.53 6.35 10.73 6 12 6c3.87 0 7 3.13 7 7 0 1.27-.35 2.47-.94 3.49l1.45 1.45C20.45 16.53 21 14.83 21 13c0-2.12-.74-4.07-1.97-5.61l1.42-1.42-1.41-1.42zM15 1H9v2h6V1zm-4 8.44l2 2V8h-2v1.44zM3.02 4L1.75 5.27 4.5 8.03C3.55 9.45 3 11.16 3 13c0 4.97 4.02 9 9 9 1.84 0 3.55-.55 4.98-1.5l2.5 2.5 1.27-1.27-7.71-7.71L3.02 4zM12 20c-3.87 0-7-3.13-7-7 0-1.28.35-2.48.95-3.52l9.56 9.56c-1.03.61-2.23.96-3.51.96z' }) ); }; ImageTimerOff = (0, _pure2.default)(ImageTimerOff); ImageTimerOff.displayName = 'ImageTimerOff'; ImageTimerOff.muiName = 'SvgIcon'; exports.default = ImageTimerOff;
src/components/Grid/Square.js
HichamBenjelloun/react-examples
import React from 'react'; const Square = ({ rowIndex, columnIndex, }) => { const [backgroundColor, color] = (rowIndex + columnIndex) % 2 ? ['white', 'black'] : ['grey', 'white']; const divStyle = { backgroundColor: backgroundColor, color: color, }; return ( <div className="Square br2 grow-large hide-child" style={divStyle} > <span className="child">{rowIndex}, {columnIndex}</span> </div> ); }; export default Square;
src/components/Statistic/ZKM.js
DOIS/ecampus.kpi.ua
import React from 'react'; // import { Link } from 'react-router-dom'; const ZKM = () => ( <div className="row"> <div className="col-md-12"> <h1>Статистика</h1> <h2>Забезпечення кредитного модуля</h2> <div className="row"> <div className="col-md-12"> <a className="btn btn-primary btn-lg" role="button" href="https://statistic.ecampus.kpi.ua/zkm.html" > Перейти до модуля <i className="fa fa-external-link" /> </a> </div> </div> </div> </div> ); export default ZKM;
webpack/components/Search/index.js
cfouant/katello
/* eslint-disable import/no-extraneous-dependencies */ import React, { Component } from 'react'; import { ControlLabel } from 'react-bootstrap'; import PropTypes from 'prop-types'; import { translate as __ } from 'foremanReact/common/I18n'; import TypeAhead from '../../move_to_pf/TypeAhead/TypeAhead'; import api from '../../services/api'; import { stringIncludes } from './helpers'; class Search extends Component { constructor(props) { super(props); this.state = { items: [] }; this.onInputUpdate = this.onInputUpdate.bind(this); this.onSearch = this.onSearch.bind(this); } componentDidMount() { this.onInputUpdate(); } onInputUpdate(searchTerm = '') { const items = this.state.items.filter(({ text }) => stringIncludes(text, searchTerm)); if (items.length !== this.state.items.length) { this.setState({ items }); } const params = this.props.getAutoCompleteParams(searchTerm); const autoCompleteParams = [ params.endpoint, params.headers || {}, params.params || {}, ]; if (autoCompleteParams[0] !== '') { api.get(...autoCompleteParams).then(({ data }) => { this.setState({ items: data.filter(({ error }) => !error).map(({ label }) => ({ text: label.trim(), })), }); }); } } onSearch(search) { if (this.props.updateSearchQuery) this.props.updateSearchQuery(search); this.props.onSearch(search); } render() { const { initialInputValue } = this.props; return ( <div> <ControlLabel srOnly>{__('Search')}</ControlLabel> <TypeAhead items={this.state.items} onInputUpdate={this.onInputUpdate} onSearch={this.onSearch} initialInputValue={initialInputValue} /> </div> ); } } Search.propTypes = { /** Callback function when the "Search" button is pressed: onSearch(searchQuery) */ onSearch: PropTypes.func.isRequired, /** Function returning params for the scoped-search complete api call: getAutoCompleteParams(searchQuery) Should return a shape { headers, params, endpoint }, e.g.: { headers: {}, params: { organization_id, search }, endpoint: '/subscriptions/auto_complete_search' } */ getAutoCompleteParams: PropTypes.func.isRequired, updateSearchQuery: PropTypes.func, initialInputValue: PropTypes.string, }; Search.defaultProps = { updateSearchQuery: undefined, initialInputValue: '', }; export default Search;
src/components/Content/index.js
bhargav175/resume
import React from 'react'; import styles from './style.scss'; class Content extends React.Component{ render(){ return <div>Content</div>; } } export default Content;
ajax/libs/babel-core/5.0.2/browser.min.js
perfect-pixell/cdnjs
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.babel=e()}}(function(){var e,t,n;return function r(e,t,n){function l(s,a){if(!t[s]){if(!e[s]){var o="function"==typeof require&&require;if(!a&&o)return o(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=t[s]={exports:{}};e[s][0].call(p.exports,function(t){var n=e[s][1][t];return l(n?n:t)},p,p.exports,r,e,t,n)}return t[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)l(n[s]);return l}({1:[function(e){"use strict";var t=e(".."),n=t.Parser.prototype,r=t.tokTypes;n.isRelational=function(e){return this.type===r.relational&&this.value===e},n.expectRelational=function(e){this.isRelational(e)?this.next():this.unexpected()},n.flow_parseDeclareClass=function(e){return this.next(),this.flow_parseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},n.flow_parseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdent(),n=this.startNode(),l=this.startNode();n.typeParameters=this.isRelational("<")?this.flow_parseTypeParameterDeclaration():null,this.expect(r.parenL);var i=this.flow_parseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,this.expect(r.parenR),this.expect(r.colon),n.returnType=this.flow_parseType(),l.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(l,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},n.flow_parseDeclare=function(e){return this.type===r._class?this.flow_parseDeclareClass(e):this.type===r._function?this.flow_parseDeclareFunction(e):this.type===r._var?this.flow_parseDeclareVariable(e):this.isContextual("module")?this.flow_parseDeclareModule(e):void this.unexpected()},n.flow_parseDeclareVariable=function(e){return this.next(),e.id=this.flow_parseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},n.flow_parseDeclareModule=function(e){this.next(),e.id=this.type===r.string?this.parseExprAtom():this.parseIdent();var t=e.body=this.startNode(),n=t.body=[];for(this.expect(r.braceL);this.type!==r.braceR;){var l=this.startNode();this.next(),n.push(this.flow_parseDeclare(l))}return this.expect(r.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},n.flow_parseInterfaceish=function(e,t){if(e.id=this.parseIdent(),e.typeParameters=this.isRelational("<")?this.flow_parseTypeParameterDeclaration():null,e["extends"]=[],this.eat(r._extends))do e["extends"].push(this.flow_parseInterfaceExtends());while(this.eat(r.comma));e.body=this.flow_parseObjectType(t)},n.flow_parseInterfaceExtends=function(){var e=this.startNode();return e.id=this.parseIdent(),e.typeParameters=this.isRelational("<")?this.flow_parseTypeParameterInstantiation():null,this.finishNode(e,"InterfaceExtends")},n.flow_parseInterface=function(e){return this.flow_parseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},n.flow_parseTypeAlias=function(e){return e.id=this.parseIdent(),e.typeParameters=this.isRelational("<")?this.flow_parseTypeParameterDeclaration():null,this.expect(r.eq),e.right=this.flow_parseType(),this.semicolon(),this.finishNode(e,"TypeAlias")},n.flow_parseTypeParameterDeclaration=function(){var e=this.startNode();for(e.params=[],this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flow_parseTypeAnnotatableIdentifier()),this.isRelational(">")||this.expect(r.comma);return this.expectRelational(">"),this.finishNode(e,"TypeParameterDeclaration")},n.flow_parseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.inType;for(e.params=[],this.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flow_parseType()),this.isRelational(">")||this.expect(r.comma);return this.expectRelational(">"),this.inType=t,this.finishNode(e,"TypeParameterInstantiation")},n.flow_parseObjectPropertyKey=function(){return this.type===r.num||this.type===r.string?this.parseExprAtom():this.parseIdent(!0)},n.flow_parseObjectTypeIndexer=function(e,t){return e["static"]=t,this.expect(r.bracketL),e.id=this.flow_parseObjectPropertyKey(),this.expect(r.colon),e.key=this.flow_parseType(),this.expect(r.bracketR),this.expect(r.colon),e.value=this.flow_parseType(),this.flow_objectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},n.flow_parseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flow_parseTypeParameterDeclaration()),this.expect(r.parenL);this.type===r.name;)e.params.push(this.flow_parseFunctionTypeParam()),this.type!==r.parenR&&this.expect(r.comma);return this.eat(r.ellipsis)&&(e.rest=this.flow_parseFunctionTypeParam()),this.expect(r.parenR),this.expect(r.colon),e.returnType=this.flow_parseType(),this.finishNode(e,"FunctionTypeAnnotation")},n.flow_parseObjectTypeMethod=function(e,t,n){var r=this.startNodeAt(e);return r.value=this.flow_parseObjectTypeMethodish(this.startNodeAt(e)),r["static"]=t,r.key=n,r.optional=!1,this.flow_objectTypeSemicolon(),this.finishNode(r,"ObjectTypeProperty")},n.flow_parseObjectTypeCallProperty=function(e,t){var n=this.startNode();return e["static"]=t,e.value=this.flow_parseObjectTypeMethodish(n),this.flow_objectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},n.flow_parseObjectType=function(e){var t,n,l,i=this.startNode(),s=!1;for(i.callProperties=[],i.properties=[],i.indexers=[],this.expect(r.braceL);this.type!==r.braceR;){var a=this.markPosition();t=this.startNode(),e&&this.isContextual("static")&&(this.next(),l=!0),this.type===r.bracketL?i.indexers.push(this.flow_parseObjectTypeIndexer(t,l)):this.type===r.parenL||this.isRelational("<")?i.callProperties.push(this.flow_parseObjectTypeCallProperty(t,e)):(n=l&&this.type===r.colon?this.parseIdent():this.flow_parseObjectPropertyKey(),this.isRelational("<")||this.type===r.parenL?i.properties.push(this.flow_parseObjectTypeMethod(a,l,n)):(this.eat(r.question)&&(s=!0),this.expect(r.colon),t.key=n,t.value=this.flow_parseType(),t.optional=s,t["static"]=l,this.flow_objectTypeSemicolon(),i.properties.push(this.finishNode(t,"ObjectTypeProperty"))))}return this.expect(r.braceR),this.finishNode(i,"ObjectTypeAnnotation")},n.flow_objectTypeSemicolon=function(){this.eat(r.semi)||this.type===r.braceR||this.unexpected()},n.flow_parseGenericType=function(e,t){var n=this.startNodeAt(e);for(n.typeParameters=null,n.id=t;this.eat(r.dot);){var l=this.startNodeAt(e);l.qualification=n.id,l.id=this.parseIdent(),n.id=this.finishNode(l,"QualifiedTypeIdentifier")}return this.isRelational("<")&&(n.typeParameters=this.flow_parseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")},n.flow_parseVoidType=function(){var e=this.startNode();return this.expect(r._void),this.finishNode(e,"VoidTypeAnnotation")},n.flow_parseTypeofType=function(){var e=this.startNode();return this.expect(r._typeof),e.argument=this.flow_parsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},n.flow_parseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(r.bracketL);this.pos<this.input.length&&this.type!==r.bracketR&&(e.types.push(this.flow_parseType()),this.type!==r.bracketR);)this.expect(r.comma);return this.expect(r.bracketR),this.finishNode(e,"TupleTypeAnnotation")},n.flow_parseFunctionTypeParam=function(){var e=!1,t=this.startNode();return t.name=this.parseIdent(),this.eat(r.question)&&(e=!0),this.expect(r.colon),t.optional=e,t.typeAnnotation=this.flow_parseType(),this.finishNode(t,"FunctionTypeParam")},n.flow_parseFunctionTypeParams=function(){for(var e={params:[],rest:null};this.type===r.name;)e.params.push(this.flow_parseFunctionTypeParam()),this.type!==r.parenR&&this.expect(r.comma);return this.eat(r.ellipsis)&&(e.rest=this.flow_parseFunctionTypeParam()),e},n.flow_identToTypeAnnotation=function(e,t,n){switch(n.name){case"any":return this.finishNode(t,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(t,"BooleanTypeAnnotation");case"number":return this.finishNode(t,"NumberTypeAnnotation");case"string":return this.finishNode(t,"StringTypeAnnotation");default:return this.flow_parseGenericType(e,n)}},n.flow_parsePrimaryType=function(){var e,t,n,l=this.markPosition(),i=this.startNode(),s=!1;switch(this.type){case r.name:return this.flow_identToTypeAnnotation(l,i,this.parseIdent());case r.braceL:return this.flow_parseObjectType();case r.bracketL:return this.flow_parseTupleType();case r.relational:if("<"===this.value)return i.typeParameters=this.flow_parseTypeParameterDeclaration(),this.expect(r.parenL),e=this.flow_parseFunctionTypeParams(),i.params=e.params,i.rest=e.rest,this.expect(r.parenR),this.expect(r.arrow),i.returnType=this.flow_parseType(),this.finishNode(i,"FunctionTypeAnnotation");case r.parenL:if(this.next(),this.type!==r.parenR&&this.type!==r.ellipsis)if(this.type===r.name){var t=this.lookahead().type;s=t!==r.question&&t!==r.colon}else s=!0;return s?(n=this.flow_parseType(),this.expect(r.parenR),this.eat(r.arrow)&&this.raise(i,"Unexpected token =>. It looks like you are trying to write a function type, but you ended up writing a grouped type followed by an =>, which is a syntax error. Remember, function type parameters are named so function types look like (name1: type1, name2: type2) => returnType. You probably wrote (type1) => returnType"),n):(e=this.flow_parseFunctionTypeParams(),i.params=e.params,i.rest=e.rest,this.expect(r.parenR),this.expect(r.arrow),i.returnType=this.flow_parseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation"));case r.string:return i.value=this.value,i.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(i,"StringLiteralTypeAnnotation");default:if(this.type.keyword)switch(this.type.keyword){case"void":return this.flow_parseVoidType();case"typeof":return this.flow_parseTypeofType()}}this.unexpected()},n.flow_parsePostfixType=function(){var e=this.startNode(),t=e.elementType=this.flow_parsePrimaryType();return this.type===r.bracketL?(this.expect(r.bracketL),this.expect(r.bracketR),this.finishNode(e,"ArrayTypeAnnotation")):t},n.flow_parsePrefixType=function(){var e=this.startNode();return this.eat(r.question)?(e.typeAnnotation=this.flow_parsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flow_parsePostfixType()},n.flow_parseIntersectionType=function(){var e=this.startNode(),t=this.flow_parsePrefixType();for(e.types=[t];this.eat(r.bitwiseAND);)e.types.push(this.flow_parsePrefixType());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},n.flow_parseUnionType=function(){var e=this.startNode(),t=this.flow_parseIntersectionType();for(e.types=[t];this.eat(r.bitwiseOR);)e.types.push(this.flow_parseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},n.flow_parseType=function(){var e=this.inType;this.inType=!0;var t=this.flow_parseUnionType();return this.inType=e,t},n.flow_parseTypeAnnotation=function(){var e=this.startNode(),t=this.inType;return this.inType=!0,this.expect(r.colon),e.typeAnnotation=this.flow_parseType(),this.inType=t,this.finishNode(e,"TypeAnnotation")},n.flow_parseTypeAnnotatableIdentifier=function(e,t){var n=(this.startNode(),this.parseIdent()),l=!1;return t&&this.eat(r.question)&&(this.expect(r.question),l=!0),(e||this.type===r.colon)&&(n.typeAnnotation=this.flow_parseTypeAnnotation(),this.finishNode(n,n.type)),l&&(n.optional=!0,this.finishNode(n,n.type)),n},t.plugins.flow=function(e){e.extend("parseFunctionBody",function(e){return function(t,n){return this.type===r.colon&&(t.returnType=this.flow_parseTypeAnnotation()),e.call(this,t,n)}}),e.extend("parseStatement",function(e){return function(t,n){if(this.strict&&this.type===r.name&&"interface"===this.value){var l=this.startNode();return this.next(),this.flow_parseInterface(l)}return e.call(this,t,n)}}),e.extend("parseExpressionStatement",function(e){return function(t,n){if("Identifier"===n.type)if("declare"===n.name){if(this.type===r._class||this.type===r.name||this.type===r._function||this.type===r._var)return this.flow_parseDeclare(t)}else if(this.type===r.name){if("interface"===n.name)return this.flow_parseInterface(t);if("type"===n.name)return this.flow_parseTypeAlias(t)}return e.call(this,t,n)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||e.call(this)}}),e.extend("parseParenItem",function(){return function(e,t){if(this.type===r.colon){var n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.flow_parseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return e}}),e.extend("parseClassId",function(e){return function(t,n){e.call(this,t,n),this.isRelational("<")&&(t.typeParameters=this.flow_parseTypeParameterDeclaration())}}),e.extend("readToken",function(e){return function(t){return!this.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(r.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){return this.inType?void 0:e.call(this)}}),e.extend("parseParenArrowList",function(e){return function(t,n,r){for(var l=0;l<n.length;l++){var i=n[l];if("TypeCastExpression"===i.type){var s=i.expression;s.typeAnnotation=i.typeAnnotation,n[l]=s}}return e.call(this,t,n,r)}}),e.extend("parseClassProperty",function(e){return function(t){return this.type===r.colon&&(t.typeAnnotation=this.flow_parseTypeAnnotation()),e.call(this,t)}}),e.extend("isClassProperty",function(e){return function(){return this.type===r.colon||e.call(this)}}),e.extend("parseClassMethod",function(){return function(e,t,n,r){var l;this.isRelational("<")&&(l=this.flow_parseTypeParameterDeclaration()),t.value=this.parseMethod(n,r),t.value.typeParameters=l,e.body.push(this.finishNode(t,"MethodDefinition"))}}),e.extend("parseClassSuper",function(e){return function(t,n){if(e.call(this,t,n),t.superClass&&this.isRelational("<")&&(t.superTypeParameters=this.flow_parseTypeParameterInstantiation()),this.isContextual("implements")){this.next();var l=t["implements"]=[];do{var t=this.startNode();t.id=this.parseIdent(),t.typeParameters=this.isRelational("<")?this.flow_parseTypeParameterInstantiation():null,l.push(this.finishNode(t,"ClassImplements"))}while(this.eat(r.comma))}}}),e.extend("parseObjPropValue",function(e){return function(t){var n;this.isRelational("<")&&(n=this.flow_parseTypeParameterDeclaration(),this.type!==r.parenL&&this.unexpected()),e.apply(this,arguments),t.value.typeParameters=n}}),e.extend("parseAssignableListItemTypes",function(){return function(e){return this.eat(r.question)&&(e.optional=!0),this.type===r.colon&&(e.typeAnnotation=this.flow_parseTypeAnnotation()),this.finishNode(e,e.type),e}}),e.extend("parseImportSpecifiers",function(e){return function(t){if(t.isType=!1,this.isContextual("type")){var n=this.markPosition(),l=this.parseIdent();if(this.type===r.name&&"from"!==this.value||this.type===r.braceL||this.type===r.star)t.isType=!0;else{if(t.specifiers.push(this.parseImportSpecifierDefault(l,n)),this.isContextual("from"))return;this.eat(r.comma)}}e.call(this,t)}}),e.extend("parseFunctionParams",function(e){return function(t){this.isRelational("<")&&(t.typeParameters=this.flow_parseTypeParameterDeclaration()),e.call(this,t)}}),e.extend("parseVarHead",function(e){return function(t){e.call(this,t),this.type===r.colon&&(t.id.typeAnnotation=this.flow_parseTypeAnnotation(),this.finishNode(t.id,t.id.type))}})}},{"..":5}],2:[function(e){"use strict";function t(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?t(e.object)+"."+t(e.property):void 0}var n=e(".."),r=n.tokTypes,l=n.tokContexts;l.j_oTag=new n.TokContext("<tag",!1),l.j_cTag=new n.TokContext("</tag",!1),l.j_expr=new n.TokContext("<tag>...</tag>",!0,!0),r.jsxName=new n.TokenType("jsxName"),r.jsxText=new n.TokenType("jsxText",{beforeExpr:!0}),r.jsxTagStart=new n.TokenType("jsxTagStart"),r.jsxTagEnd=new n.TokenType("jsxTagEnd"),r.jsxTagStart.updateContext=function(){this.context.push(l.j_expr),this.context.push(l.j_oTag),this.exprAllowed=!1},r.jsxTagEnd.updateContext=function(e){var t=this.context.pop();t===l.j_oTag&&e===r.slash||t===l.j_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===l.j_expr):this.exprAllowed=!0};var i=n.Parser.prototype;i.jsx_readToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");var l=this.input.charCodeAt(this.pos);switch(l){case 60:case 123:return this.pos===this.start?60===l&&this.exprAllowed?(++this.pos,this.finishToken(r.jsxTagStart)):this.getTokenFromCode(l):(e+=this.input.slice(t,this.pos),this.finishToken(r.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;default:n.isNewLine(l)?(e+=this.input.slice(t,this.pos),++this.pos,13===l&&10===this.input.charCodeAt(this.pos)?(++this.pos,e+="\n"):e+=String.fromCharCode(l),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos):++this.pos}}},i.jsx_readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var l=this.input.charCodeAt(this.pos);if(l===e)break;38===l?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(r.string,t)};var s={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},a=/^[\da-fA-F]+$/,o=/^\d+$/;i.jsx_readEntity=function(){var e,t="",n=0,r=this.input[this.pos];"&"!==r&&this.raise(this.pos,"Entity must start with an ampersand");for(var l=++this.pos;this.pos<this.input.length&&n++<10;){if(r=this.input[this.pos++],";"===r){"#"===t[0]?"x"===t[1]?(t=t.substr(2),a.test(t)&&(e=String.fromCharCode(parseInt(t,16)))):(t=t.substr(1),o.test(t)&&(e=String.fromCharCode(parseInt(t,10)))):e=s[t];break}t+=r}return e?e:(this.pos=l,"&")},i.jsx_readWord=function(){var e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(n.isIdentifierChar(e)||45===e);return this.finishToken(r.jsxName,this.input.slice(t,this.pos))},i.jsx_parseIdentifier=function(){var e=this.startNode();return this.type===r.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")},i.jsx_parseNamespacedName=function(){var e=this.markPosition(),t=this.jsx_parseIdentifier();if(!this.eat(r.colon))return t;var n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsx_parseIdentifier(),this.finishNode(n,"JSXNamespacedName")},i.jsx_parseElementName=function(){for(var e=this.markPosition(),t=this.jsx_parseNamespacedName();this.eat(r.dot);){var n=this.startNodeAt(e);n.object=t,n.property=this.jsx_parseIdentifier(),t=this.finishNode(n,"JSXMemberExpression")}return t},i.jsx_parseAttributeValue=function(){switch(this.type){case r.braceL:var e=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===e.expression.type&&this.raise(e.start,"JSX attributes must only be assigned a non-empty expression"),e;case r.jsxTagStart:case r.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}},i.jsx_parseEmptyExpression=function(){var e=this.start;return this.start=this.lastTokEnd,this.lastTokEnd=e,e=this.startLoc,this.startLoc=this.lastTokEndLoc,this.lastTokEndLoc=e,this.finishNode(this.startNode(),"JSXEmptyExpression")},i.jsx_parseExpressionContainer=function(){var e=this.startNode();return this.next(),e.expression=this.type===r.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(r.braceR),this.finishNode(e,"JSXExpressionContainer")},i.jsx_parseAttribute=function(){var e=this.startNode();return this.eat(r.braceL)?(this.expect(r.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(r.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(r.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,"JSXAttribute"))},i.jsx_parseOpeningElementAt=function(e){var t=this.startNodeAt(e);for(t.attributes=[],t.name=this.jsx_parseElementName();this.type!==r.slash&&this.type!==r.jsxTagEnd;)t.attributes.push(this.jsx_parseAttribute());return t.selfClosing=this.eat(r.slash),this.expect(r.jsxTagEnd),this.finishNode(t,"JSXOpeningElement")},i.jsx_parseClosingElementAt=function(e){var t=this.startNodeAt(e);return t.name=this.jsx_parseElementName(),this.expect(r.jsxTagEnd),this.finishNode(t,"JSXClosingElement")},i.jsx_parseElementAt=function(e){var n=this.startNodeAt(e),l=[],i=this.jsx_parseOpeningElementAt(e),s=null;if(!i.selfClosing){e:for(;;)switch(this.type){case r.jsxTagStart:if(e=this.markPosition(),this.next(),this.eat(r.slash)){s=this.jsx_parseClosingElementAt(e);break e}l.push(this.jsx_parseElementAt(e));break;case r.jsxText:l.push(this.parseExprAtom());break;case r.braceL:l.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}t(s.name)!==t(i.name)&&this.raise(s.start,"Expected corresponding JSX closing tag for <"+t(i.name)+">")}return n.openingElement=i,n.closingElement=s,n.children=l,this.finishNode(n,"JSXElement")},i.jsx_parseElement=function(){var e=this.markPosition();return this.next(),this.jsx_parseElementAt(e)},n.plugins.jsx=function(e){e.extend("parseExprAtom",function(e){return function(t){return this.type===r.jsxText?this.parseLiteral(this.value):this.type===r.jsxTagStart?this.jsx_parseElement():e.call(this,t)}}),e.extend("readToken",function(e){return function(t){var i=this.curContext();if(i===l.j_expr)return this.jsx_readToken();if(i===l.j_oTag||i===l.j_cTag){if(n.isIdentifierStart(t))return this.jsx_readWord();if(62==t)return++this.pos,this.finishToken(r.jsxTagEnd);if((34===t||39===t)&&i==l.j_oTag)return this.jsx_readString(t)}return 60===t&&this.exprAllowed?(++this.pos,this.finishToken(r.jsxTagStart)):e.call(this,t)}}),e.extend("updateContext",function(e){return function(t){if(this.type==r.braceL){var n=this.curContext();n==l.j_oTag?this.context.push(l.b_expr):n==l.j_expr?this.context.push(l.b_tmpl):e.call(this,t),this.exprAllowed=!0}else{if(this.type!==r.slash||t!==r.jsxTagStart)return e.call(this,t);this.context.length-=2,this.context.push(l.j_cTag),this.exprAllowed=!1}}})}},{"..":5}],3:[function(e){"use strict";var t=e("./tokentype").types,n=e("./state").Parser,r=e("./identifier").reservedWords,l=e("./util").has,i=n.prototype;i.checkPropClash=function(e,t){if(!(this.options.ecmaVersion>=6)){var n=e.key,r=void 0;switch(n.type){case"Identifier":r=n.name;break;case"Literal":r=String(n.value);break;default:return}var i=e.kind||"init",s=void 0;if(l(t,r)){s=t[r];var a="init"!==i;((this.strict||a)&&s[i]||!(a^s.init))&&this.raise(n.start,"Redefinition of property")}else s=t[r]={init:!1,get:!1,set:!1};s[i]=!0}},i.parseExpression=function(e,n){var r=this.markPosition(),l=this.parseMaybeAssign(e,n);if(this.type===t.comma){var i=this.startNodeAt(r);for(i.expressions=[l];this.eat(t.comma);)i.expressions.push(this.parseMaybeAssign(e,n));return this.finishNode(i,"SequenceExpression")}return l},i.parseMaybeAssign=function(e,n,r){if(this.type==t._yield&&this.inGenerator)return this.parseYield();var l=void 0;n?l=!1:(n={start:0},l=!0);var i=this.markPosition(),s=this.parseMaybeConditional(e,n);if(r&&(s=r.call(this,s,i)),this.type.isAssign){var a=this.startNodeAt(i);return a.operator=this.value,a.left=this.type===t.eq?this.toAssignable(s):s,n.start=0,this.checkLVal(s),s.parenthesizedExpression&&("ObjectPattern"===s.type?this.raise(s.start,"You're trying to assign to a parenthesized expression, instead of `({ foo }) = {}` use `({ foo } = {})`"):this.raise(s.start,"Parenthesized left hand expressions are illegal")),this.next(),a.right=this.parseMaybeAssign(e),this.finishNode(a,"AssignmentExpression")}return l&&n.start&&this.unexpected(n.start),s},i.parseMaybeConditional=function(e,n){var r=this.markPosition(),l=this.parseExprOps(e,n);if(n&&n.start)return l;if(this.eat(t.question)){var i=this.startNodeAt(r);return i.test=l,i.consequent=this.parseMaybeAssign(),this.expect(t.colon),i.alternate=this.parseMaybeAssign(e),this.finishNode(i,"ConditionalExpression")}return l},i.parseExprOps=function(e,t){var n=this.markPosition(),r=this.parseMaybeUnary(t);return t&&t.start?r:this.parseExprOp(r,n,-1,e)},i.parseExprOp=function(e,n,r,l){var i=this.type.binop;if(null!=i&&(!l||this.type!==t._in)&&i>r){var s=this.startNodeAt(n);s.left=e,s.operator=this.value;var a=this.type;this.next();var o=this.markPosition();return s.right=this.parseExprOp(this.parseMaybeUnary(),o,a.rightAssociative?i-1:i,l),this.finishNode(s,a===t.logicalOR||a===t.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(s,n,r,l)}return e},i.parseMaybeUnary=function(e){if(this.type.prefix){var n=this.startNode(),r=this.type===t.incDec;return n.operator=this.value,n.prefix=!0,this.next(),n.argument=this.parseMaybeUnary(),e&&e.start&&this.unexpected(e.start),r?this.checkLVal(n.argument):this.strict&&"delete"===n.operator&&"Identifier"===n.argument.type&&this.raise(n.start,"Deleting local variable in strict mode"),this.finishNode(n,r?"UpdateExpression":"UnaryExpression")}var l=this.markPosition(),i=this.parseExprSubscripts(e);if(e&&e.start)return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var n=this.startNodeAt(l);n.operator=this.value,n.prefix=!1,n.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(n,"UpdateExpression")}return i},i.parseExprSubscripts=function(e){var t=this.markPosition(),n=this.parseExprAtom(e);return e&&e.start?n:this.parseSubscripts(n,t)},i.parseSubscripts=function(e,n,r){if(this.eat(t.dot)){var l=this.startNodeAt(n);return l.object=e,l.property=this.parseIdent(!0),l.computed=!1,this.parseSubscripts(this.finishNode(l,"MemberExpression"),n,r)}if(this.eat(t.bracketL)){var l=this.startNodeAt(n);return l.object=e,l.property=this.parseExpression(),l.computed=!0,this.expect(t.bracketR),this.parseSubscripts(this.finishNode(l,"MemberExpression"),n,r)}if(!r&&this.eat(t.parenL)){var l=this.startNodeAt(n);return l.callee=e,l.arguments=this.parseExprList(t.parenR,!1),this.parseSubscripts(this.finishNode(l,"CallExpression"),n,r)}if(this.type===t.backQuote){var l=this.startNodeAt(n);return l.tag=e,l.quasi=this.parseTemplate(),this.parseSubscripts(this.finishNode(l,"TaggedTemplateExpression"),n,r)}return e},i.parseExprAtom=function(e){var n=void 0;switch(this.type){case t._this:case t._super:var r=this.type===t._this?"ThisExpression":"Super";return n=this.startNode(),this.next(),this.finishNode(n,r);case t._yield:this.inGenerator&&unexpected();case t._do:if(this.options.features["es7.doExpressions"]){var l=this.startNode();return this.next(),l.body=this.parseBlock(),this.finishNode(l,"DoExpression")}case t.name:var i=this.markPosition();n=this.startNode();var s=this.parseIdent(this.type!==t.name);if(this.options.features["es7.asyncFunctions"])if("async"===s.name){if(this.type===t.parenL){var a=this.parseParenAndDistinguishExpression(i,!0);return a&&"ArrowFunctionExpression"===a.type?a:(n.callee=s,n.arguments=a?"SequenceExpression"===a.type?a.expressions:[a]:[],this.parseSubscripts(this.finishNode(n,"CallExpression"),i))}if(this.type===t.name)return s=this.parseIdent(),this.expect(t.arrow),this.parseArrowExpression(n,[s],!0);if(this.type===t._function&&!this.canInsertSemicolon())return this.next(),this.parseFunction(n,!1,!1,!0)}else if("await"===s.name&&this.inAsync)return this.parseAwait(n);return!this.canInsertSemicolon()&&this.eat(t.arrow)?this.parseArrowExpression(this.startNodeAt(i),[s]):s;case t.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case t.num:case t.string:return this.parseLiteral(this.value);case t._null:case t._true:case t._false:return n=this.startNode(),n.value=this.type===t._null?null:this.type===t._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case t.parenL:return this.parseParenAndDistinguishExpression();case t.bracketL:return n=this.startNode(),this.next(),(this.options.ecmaVersion>=7||this.options.features["es7.comprehensions"])&&this.type===t._for?this.parseComprehension(n,!1):(n.elements=this.parseExprList(t.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression"));case t.braceL:return this.parseObj(!1,e);case t._function:return n=this.startNode(),this.next(),this.parseFunction(n,!1);case t.at:this.parseDecorators();case t._class:return n=this.startNode(),this.takeDecorators(n),this.parseClass(n,!1);case t._new:return this.parseNew();case t.backQuote:return this.parseTemplate();default:this.unexpected()}},i.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},i.parseParenExpression=function(){this.expect(t.parenL);var e=this.parseExpression();return this.expect(t.parenR),e},i.parseParenAndDistinguishExpression=function(e,n){e=e||this.markPosition();var r=void 0;if(this.options.ecmaVersion>=6){if(this.next(),(this.options.features["es7.comprehensions"]||this.options.ecmaVersion>=7)&&this.type===t._for)return this.parseComprehension(this.startNodeAt(e),!0);for(var l=this.markPosition(),i=[],s=!0,a={start:0},o=void 0,u=void 0;this.type!==t.parenR;){if(s?s=!1:this.expect(t.comma),this.type===t.ellipsis){var p=this.markPosition();o=this.start,i.push(this.parseParenItem(this.parseRest(),p));break}this.type!==t.parenL||u||(u=this.start),i.push(this.parseMaybeAssign(!1,a,this.parseParenItem))}var c=this.markPosition(); if(this.expect(t.parenR),!this.canInsertSemicolon()&&this.eat(t.arrow))return u&&this.unexpected(u),this.parseParenArrowList(e,i,n);if(!i.length){if(n)return;this.unexpected(this.lastTokStart)}o&&this.unexpected(o),a.start&&this.unexpected(a.start),i.length>1?(r=this.startNodeAt(l),r.expressions=i,this.finishNodeAt(r,"SequenceExpression",c)):r=i[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var d=this.startNodeAt(e);return d.expression=r,this.finishNode(d,"ParenthesizedExpression")}return r.parenthesizedExpression=!0,r},i.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e),t,n)},i.parseParenItem=function(e){return e};var s=[];i.parseNew=function(){var e=this.startNode(),n=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(t.dot))return e.meta=n,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raise(e.property.start,"The only valid meta property for new is new.target"),this.finishNode(e,"MetaProperty");var r=this.markPosition();return e.callee=this.parseSubscripts(this.parseExprAtom(),r,!0),e.arguments=this.eat(t.parenL)?this.parseExprList(t.parenR,!1):s,this.finishNode(e,"NewExpression")},i.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end),cooked:this.value},this.next(),e.tail=this.type===t.backQuote,this.finishNode(e,"TemplateElement")},i.parseTemplate=function(){var e=this.startNode();this.next(),e.expressions=[];var n=this.parseTemplateElement();for(e.quasis=[n];!n.tail;)this.expect(t.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(t.braceR),e.quasis.push(n=this.parseTemplateElement());return this.next(),this.finishNode(e,"TemplateLiteral")},i.parseObj=function(e,n){var r=this.startNode(),l=!0,i={};for(r.properties=[],this.next();!this.eat(t.braceR);){if(l)l=!1;else if(this.expect(t.comma),this.afterTrailingComma(t.braceR))break;var s=this.startNode(),a=!1,o=!1,u=void 0;if(this.options.features["es7.objectRestSpread"]&&this.type===t.ellipsis)s=this.parseSpread(),s.type="SpreadProperty",r.properties.push(s);else{if(this.options.ecmaVersion>=6&&(s.method=!1,s.shorthand=!1,(e||n)&&(u=this.markPosition()),e||(a=this.eat(t.star))),this.options.features["es7.asyncFunctions"]&&this.isContextual("async")){(a||e)&&this.unexpected();var p=this.parseIdent();this.type===t.colon||this.type===t.parenL?s.key=p:(o=!0,this.parsePropertyName(s))}else this.parsePropertyName(s);this.parseObjPropValue(s,u,a,o,e,n),this.checkPropClash(s,i),r.properties.push(this.finishNode(s,"Property"))}}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},i.parseObjPropValue=function(e,n,l,i,s,a){this.eat(t.colon)?(e.value=s?this.parseMaybeDefault():this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===t.parenL?(s&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(l,i)):this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=t.comma&&this.type!=t.braceR?((l||i||s)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1)):this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?(e.kind="init",s?((this.isKeyword(e.key.name)||this.strict&&(r.strictBind(e.key.name)||r.strict(e.key.name))||!this.options.allowReserved&&this.isReservedWord(e.key.name))&&this.raise(e.key.start,"Binding "+e.key.name),e.value=this.parseMaybeDefault(n,e.key)):this.type===t.eq&&a?(a.start||(a.start=this.start),e.value=this.parseMaybeDefault(n,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},i.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(t.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),void this.expect(t.bracketR);e.computed=!1}e.key=this.type===t.num||this.type===t.string?this.parseExprAtom():this.parseIdent(!0)},i.initFunction=function(e,t){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.features["es7.asyncFunctions"]&&(e.async=!!t)},i.parseMethod=function(e,n){var r=this.startNode();return this.initFunction(r,n),this.expect(t.parenL),r.params=this.parseBindingList(t.parenR,!1,!1),this.options.ecmaVersion>=6&&(r.generator=e),this.parseFunctionBody(r),this.finishNode(r,"FunctionExpression")},i.parseArrowExpression=function(e,t,n){return this.initFunction(e,n),e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},i.parseFunctionBody=function(e,n){var r=n&&this.type!==t.braceL,l=this.inAsync;if(this.inAsync=e.async,r)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.inFunction,s=this.inGenerator,a=this.labels;this.inFunction=!0,this.inGenerator=e.generator,this.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.inFunction=i,this.inGenerator=s,this.labels=a}if(this.inAsync=l,this.strict||!r&&e.body.body.length&&this.isUseStrict(e.body.body[0])){var o={},u=this.strict;this.strict=!0,e.id&&this.checkLVal(e.id,!0);for(var p=0;p<e.params.length;p++)this.checkLVal(e.params[p],!0,o);this.strict=u}},i.parseExprList=function(e,n,r,l){for(var i=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(t.comma),n&&this.afterTrailingComma(e))break;i.push(r&&this.type===t.comma?null:this.type===t.ellipsis?this.parseSpread(l):this.parseMaybeAssign(!1,l))}return i},i.parseIdent=function(e){var n=this.startNode();return e&&"never"==this.options.allowReserved&&(e=!1),this.type===t.name?(!e&&(!this.options.allowReserved&&this.isReservedWord(this.value)||this.strict&&r.strict(this.value)&&(this.options.ecmaVersion>=6||-1==this.input.slice(this.start,this.end).indexOf("\\")))&&this.raise(this.start,"The keyword '"+this.value+"' is reserved"),n.name=this.value):e&&this.type.keyword?n.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(n,"Identifier")},i.parseAwait=function(e){return(this.eat(t.semi)||this.canInsertSemicolon())&&this.unexpected(),e.all=this.eat(t.star),e.argument=this.parseMaybeAssign(!0),this.finishNode(e,"AwaitExpression")},i.parseYield=function(){var e=this.startNode();return this.next(),this.type==t.semi||this.canInsertSemicolon()||this.type!=t.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(t.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")},i.parseComprehension=function(e,n){for(e.blocks=[];this.type===t._for;){var r=this.startNode();this.next(),this.expect(t.parenL),r.left=this.parseBindingAtom(),this.checkLVal(r.left,!0),this.expectContextual("of"),r.right=this.parseExpression(),this.expect(t.parenR),e.blocks.push(this.finishNode(r,"ComprehensionBlock"))}return e.filter=this.eat(t._if)?this.parseParenExpression():null,e.body=this.parseExpression(),this.expect(n?t.parenR:t.bracketR),e.generator=n,this.finishNode(e,"ComprehensionExpression")}},{"./identifier":4,"./state":12,"./tokentype":16,"./util":17}],4:[function(e,t,n){"use strict";function r(e){function t(e){if(1==e.length)return n+="return str === "+JSON.stringify(e[0])+";";n+="switch(str){";for(var t=0;t<e.length;++t)n+="case "+JSON.stringify(e[t])+":";n+="return true}return false;"}e=e.split(" ");var n="",r=[];e:for(var l=0;l<e.length;++l){for(var i=0;i<r.length;++i)if(r[i][0].length==e[l].length){r[i].push(e[l]);continue e}r.push([e[l]])}if(r.length>3){r.sort(function(e,t){return t.length-e.length}),n+="switch(str.length){";for(var l=0;l<r.length;++l){var s=r[l];n+="case "+s[0].length+":",t(s)}n+="}"}else t(e);return new Function("str",n)}function l(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}}function i(e,t){return 65>e?36===e:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&d.test(String.fromCharCode(e)):t===!1?!1:l(e,h)}function s(e,t){return 48>e?36===e:58>e?!0:65>e?!1:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&f.test(String.fromCharCode(e)):t===!1?!1:l(e,h)||l(e,m)}n.isIdentifierStart=i,n.isIdentifierChar=s,n.__esModule=!0;var a={3:r("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),5:r("class enum extends super const export import"),6:r("enum await"),strict:r("implements interface let package private protected public static yield"),strictBind:r("eval arguments")};n.reservedWords=a;var o="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",u={5:r(o),6:r(o+" let const class extends export import yield super")};n.keywords=u;var p="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_",d=new RegExp("["+p+"]"),f=new RegExp("["+p+c+"]");p=c=null;var h=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,98,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,955,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,38,17,2,24,133,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,32,4,287,47,21,1,2,0,185,46,82,47,21,0,60,42,502,63,32,0,449,56,1288,920,104,110,2962,1070,13266,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,16355,541],m=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,16,9,83,11,168,11,6,9,8,2,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,112,16,16,9,82,12,9,9,535,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,4305,6,792618,239]},{}],5:[function(e,t,n){"use strict";function r(e,t){var n=s(t,e),r=n.options.locations?[n.pos,n.curPosition()]:n.pos;return n.nextToken(),n.parseTopLevel(n.options.program||n.startNodeAt(r))}function l(e,t,n){var r=s(n,e,t);return r.nextToken(),r.parseExpression()}function i(e,t){return s(t,e)}function s(e,t){return new o(p(e),String(t))}n.parse=r,n.parseExpressionAt=l,n.tokenizer=i,n.__esModule=!0;var a=e("./state"),o=a.Parser,u=e("./options"),p=u.getOptions;e("./parseutil"),e("./statement"),e("./lval"),e("./expression"),e("./lookahead"),n.Parser=a.Parser,n.plugins=a.plugins,n.defaultOptions=u.defaultOptions;var c=e("./location");n.SourceLocation=c.SourceLocation,n.getLineInfo=c.getLineInfo,n.Node=e("./node").Node;var d=e("./tokentype");n.TokenType=d.TokenType,n.tokTypes=d.types;var f=e("./tokencontext");n.TokContext=f.TokContext,n.tokContexts=f.types;var h=e("./identifier");n.isIdentifierChar=h.isIdentifierChar,n.isIdentifierStart=h.isIdentifierStart,n.Token=e("./tokenize").Token;var m=e("./whitespace");n.isNewLine=m.isNewLine,n.lineBreak=m.lineBreak,n.lineBreakG=m.lineBreakG,e("../plugins/flow"),e("../plugins/jsx");var g="1.0.0";n.version=g},{"../plugins/flow":1,"../plugins/jsx":2,"./expression":3,"./identifier":4,"./location":6,"./lookahead":7,"./lval":8,"./node":9,"./options":10,"./parseutil":11,"./state":12,"./statement":13,"./tokencontext":14,"./tokenize":15,"./tokentype":16,"./whitespace":18}],6:[function(e,t,n){"use strict";function r(e,t){for(var n=1,r=0;;){s.lastIndex=r;var l=s.exec(e);if(!(l&&l.index<t))return new a(n,t-r);++n,r=l.index+l[0].length}}var l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.getLineInfo=r,n.__esModule=!0;var i=e("./state").Parser,s=e("./whitespace").lineBreakG,a=n.Position=function(){function e(t,n){l(this,e),this.line=t,this.column=n}return e.prototype.offset=function(t){return new e(this.line,this.column+t)},e}(),o=(n.SourceLocation=function u(e,t,n){l(this,u),this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},i.prototype);o.raise=function(e,t){var n=r(this.input,e);t+=" ("+n.line+":"+n.column+")";var l=new SyntaxError(t);throw l.pos=e,l.loc=n,l.raisedAt=this.pos,l},o.curPosition=function(){return new a(this.curLine,this.pos-this.lineStart)},o.markPosition=function(){return this.options.locations?[this.start,this.startLoc]:this.start}},{"./state":12,"./whitespace":18}],7:[function(e){"use strict";var t=e("./state").Parser,n=t.prototype,r=["lastTokStartLoc","lastTokEndLoc","lastTokStart","lastTokEnd","lineStart","startLoc","endLoc","start","pos","end","type","value"];n.getState=function(){for(var e={},t=0;t<r.length;t++){var n=r[t];e[n]=this[n]}return e},n.lookahead=function(){var e=this.getState();this.next();var t=this.getState();for(var n in e)this[n]=e[n];return t}},{"./state":12}],8:[function(e){"use strict";var t=e("./tokentype").types,n=e("./state").Parser,r=e("./identifier").reservedWords,l=e("./util").has,i=n.prototype;i.toAssignable=function(e,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=0;n<e.properties.length;n++){var r=e.properties[n];"init"!==r.kind&&this.raise(r.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(r.value,t)}break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t);break;case"AssignmentExpression":"="===e.operator?e.type="AssignmentPattern":this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}return e},i.toAssignableList=function(e,t){var n=e.length;if(n){var r=e[n-1];if(r&&"RestElement"==r.type)--n;else if(r&&"SpreadElement"==r.type){r.type="RestElement";var l=r.argument;this.toAssignable(l,t),"Identifier"!==l.type&&"MemberExpression"!==l.type&&"ArrayPattern"!==l.type&&this.unexpected(l.start),--n}}for(var i=0;n>i;i++){var s=e[i];s&&this.toAssignable(s,t)}return e},i.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(e),this.finishNode(t,"SpreadElement")},i.parseRest=function(){var e=this.startNode();return this.next(),e.argument=this.type===t.name||this.type===t.bracketL?this.parseBindingAtom():this.unexpected(),this.finishNode(e,"RestElement")},i.parseBindingAtom=function(){if(this.options.ecmaVersion<6)return this.parseIdent();switch(this.type){case t.name:return this.parseIdent();case t.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(t.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case t.braceL:return this.parseObj(!0);default:this.unexpected()}},i.parseBindingList=function(e,n,r){for(var l=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(t.comma),n&&this.type===t.comma)l.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===t.ellipsis){l.push(this.parseAssignableListItemTypes(this.parseRest())),this.expect(e);break}l.push(this.parseAssignableListItemTypes(this.parseMaybeDefault()))}return l},i.parseAssignableListItemTypes=function(e){return e},i.parseMaybeDefault=function(e,n){if(e=e||this.markPosition(),n=n||this.parseBindingAtom(),!this.eat(t.eq))return n;var r=this.startNodeAt(e);return r.operator="=",r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},i.checkLVal=function(e,t,n){switch(e.type){case"Identifier":this.strict&&(r.strictBind(e.name)||r.strict(e.name))&&this.raise(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(l(n,e.name)&&this.raise(e.start,"Argument name clash in strict mode"),n[e.name]=!0);break;case"MemberExpression":t&&this.raise(e.start,(t?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var i=0;i<e.properties.length;i++){var s=e.properties[i];"Property"===s.type&&(s=s.value),this.checkLVal(s,t,n)}break;case"ArrayPattern":for(var i=0;i<e.elements.length;i++){var a=e.elements[i];a&&this.checkLVal(a,t,n)}break;case"AssignmentPattern":this.checkLVal(e.left,t,n);break;case"SpreadProperty":case"RestElement":this.checkLVal(e.argument,t,n);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}}},{"./identifier":4,"./state":12,"./tokentype":16,"./util":17}],9:[function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var l=e("./state").Parser,i=e("./location").SourceLocation,s=l.prototype,a=n.Node=function o(){r(this,o)};s.startNode=function(){var e=new a;return e.start=this.start,this.options.locations&&(e.loc=new i(this,this.startLoc)),this.options.directSourceFile&&(e.sourceFile=this.options.directSourceFile),this.options.ranges&&(e.range=[this.start,0]),e},s.startNodeAt=function(e){var t=new a,n=e;return this.options.locations&&(t.loc=new i(this,n[1]),n=e[0]),t.start=n,this.options.directSourceFile&&(t.sourceFile=this.options.directSourceFile),this.options.ranges&&(t.range=[n,0]),t},s.finishNode=function(e,t){return e.type=t,e.end=this.lastTokEnd,this.options.locations&&(e.loc.end=this.lastTokEndLoc),this.options.ranges&&(e.range[1]=this.lastTokEnd),e},s.finishNodeAt=function(e,t,n){return this.options.locations&&(e.loc.end=n[1],n=n[0]),e.type=t,e.end=n,this.options.ranges&&(e.range[1]=n),e}},{"./location":6,"./state":12}],10:[function(e,t,n){"use strict";function r(e){var t={};for(var n in u)t[n]=e&&s(e,n)?e[n]:u[n];return a(t.onToken)&&!function(){var e=t.onToken;t.onToken=function(t){return e.push(t)}}(),a(t.onComment)&&(t.onComment=l(t,t.onComment)),t}function l(e,t){return function(n,r,l,i,s,a){var u={type:n?"Block":"Line",value:r,start:l,end:i};e.locations&&(u.loc=new o(this,s,a)),e.ranges&&(u.range=[l,i]),t.push(u)}}n.getOptions=r,n.__esModule=!0;var i=e("./util"),s=i.has,a=i.isArray,o=e("./location").SourceLocation,u={ecmaVersion:5,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:!0,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{},features:{},strictMode:null};n.defaultOptions=u},{"./location":6,"./util":17}],11:[function(e){"use strict";var t=e("./tokentype").types,n=e("./state").Parser,r=e("./whitespace").lineBreak,l=n.prototype;l.isUseStrict=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.value},l.eat=function(e){return this.type===e?(this.next(),!0):!1},l.isContextual=function(e){return this.type===t.name&&this.value===e},l.eatContextual=function(e){return this.value===e&&this.eat(t.name)},l.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},l.canInsertSemicolon=function(){return this.type===t.eof||this.type===t.braceR||r.test(this.input.slice(this.lastTokEnd,this.start))},l.insertSemicolon=function(){return this.canInsertSemicolon()?(this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0):void 0},l.semicolon=function(){this.eat(t.semi)||this.insertSemicolon()||this.unexpected()},l.afterTrailingComma=function(e){return this.type==e?(this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),this.next(),!0):void 0},l.expect=function(e){this.eat(e)||this.unexpected()},l.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")}},{"./state":12,"./tokentype":16,"./whitespace":18}],12:[function(e,t,n){"use strict";function r(e,t,n){this.options=e,this.loadPlugins(this.options.plugins),this.sourceFile=this.options.sourceFile||null,this.isKeyword=s[this.options.ecmaVersion>=6?6:5],this.isReservedWord=i[this.options.ecmaVersion],this.input=t,n?(this.pos=n,this.lineStart=Math.max(0,this.input.lastIndexOf("\n",n)),this.curLine=this.input.slice(0,this.lineStart).split(u).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=null,this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===this.options.sourceType,this.strict=this.options.strictMode===!1?!1:this.inModule,this.inFunction=this.inGenerator=!1,this.labels=[],this.decorators=[],0===this.pos&&this.options.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)}n.Parser=r,n.__esModule=!0;var l=e("./identifier"),i=l.reservedWords,s=l.keywords,a=e("./tokentype"),o=a.types,u=a.lineBreak;r.prototype.extend=function(e,t){this[e]=t(this[e])};var p={};n.plugins=p,r.prototype.loadPlugins=function(e){for(var t in e){var r=n.plugins[t];if(!r)throw new Error("Plugin '"+t+"' not found");r(this,e[t])}}},{"./identifier":4,"./tokentype":16}],13:[function(e){"use strict";var t=e("./tokentype").types,n=e("./state").Parser,r=e("./whitespace").lineBreak,l=n.prototype;l.parseTopLevel=function(e){var n=!0;for(e.body||(e.body=[]);this.type!==t.eof;){var r=this.parseStatement(!0,!0);e.body.push(r),n&&this.isUseStrict(r)&&this.setStrict(!0),n=!1}return this.next(),this.options.ecmaVersion>=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var i={kind:"loop"},s={kind:"switch"};l.parseStatement=function(e,n){this.type===t.at&&this.parseDecorators(!0);var r=this.type,l=this.startNode();switch(r){case t._break:case t._continue:return this.parseBreakContinueStatement(l,r.keyword);case t._debugger:return this.parseDebuggerStatement(l);case t._do:return this.parseDoStatement(l);case t._for:return this.parseForStatement(l);case t._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(l);case t._class:return e||this.unexpected(),this.takeDecorators(l),this.parseClass(l,!0);case t._if:return this.parseIfStatement(l);case t._return:return this.parseReturnStatement(l);case t._switch:return this.parseSwitchStatement(l);case t._throw:return this.parseThrowStatement(l);case t._try:return this.parseTryStatement(l);case t._let:case t._const:e||this.unexpected();case t._var:return this.parseVarStatement(l,r);case t._while:return this.parseWhileStatement(l);case t._with:return this.parseWithStatement(l);case t.braceL:return this.parseBlock();case t.semi:return this.parseEmptyStatement(l);case t._export:case t._import:return this.options.allowImportExportEverywhere||(n||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===t._import?this.parseImport(l):this.parseExport(l);case t.name:if(this.options.features["es7.asyncFunctions"]&&"async"===this.value&&this.lookahead().type===t._function)return this.next(),this.expect(t._function),this.parseFunction(l,!0,!1,!0);default:var i=this.value,s=this.parseExpression();return r===t.name&&"Identifier"===s.type&&this.eat(t.colon)?this.parseLabeledStatement(l,i,s):this.parseExpressionStatement(l,s)}},l.takeDecorators=function(e){this.decorators.length&&(e.decorators=this.decorators,this.decorators=[])},l.parseDecorators=function(e){for(;this.type===t.at;)this.decorators.push(this.parseDecorator());e&&this.type===t._export||this.type!==t._class&&this.raise(this.start,"Leading decorators must be attached to a class declaration")},l.parseDecorator=function(){this.options.features["es7.decorators"]||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},l.parseBreakContinueStatement=function(e,n){var r="break"==n;this.next(),this.eat(t.semi)||this.insertSemicolon()?e.label=null:this.type!==t.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var l=0;l<this.labels.length;++l){var i=this.labels[l];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(r||"loop"===i.kind))break;if(e.label&&r)break}}return l===this.labels.length&&this.raise(e.start,"Unsyntactic "+n),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},l.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},l.parseDoStatement=function(e){var n=this.markPosition();if(this.next(),this.labels.push(i),e.body=this.parseStatement(!1),this.labels.pop(),this.options.features["es7.doExpressions"]&&this.type!==t._while){var r=this.startNodeAt(n);return r.expression=this.finishNode(e,"DoExpression"),this.semicolon(),this.finishNode(r,"ExpressionStatement")}return this.expect(t._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(t.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},l.parseForStatement=function(e){if(this.next(),this.labels.push(i),this.expect(t.parenL),this.type===t.semi)return this.parseFor(e,null);if(this.type===t._var||this.type===t._let||this.type===t._const){var n=this.startNode(),r=this.type;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===t._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||r!==t._var&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var l={start:0},s=this.parseExpression(!0,l);return this.type===t._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.toAssignable(s),this.checkLVal(s),this.parseForIn(e,s)):(l.start&&this.unexpected(l.start),this.parseFor(e,s))},l.parseFunctionStatement=function(e){return this.next(),this.parseFunction(e,!0)},l.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!1),e.alternate=this.eat(t._else)?this.parseStatement(!1):null,this.finishNode(e,"IfStatement")},l.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(t.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},l.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(t.braceL),this.labels.push(s);for(var n,r;this.type!=t.braceR;)if(this.type===t._case||this.type===t._default){var l=this.type===t._case;n&&this.finishNode(n,"SwitchCase"),e.cases.push(n=this.startNode()),n.consequent=[],this.next(),l?n.test=this.parseExpression():(r&&this.raise(this.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),this.expect(t.colon)}else n||this.unexpected(),n.consequent.push(this.parseStatement(!0));return n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},l.parseThrowStatement=function(e){return this.next(),r.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var a=[];l.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===t._catch){var n=this.startNode();this.next(),this.expect(t.parenL),n.param=this.parseBindingAtom(),this.checkLVal(n.param,!0),this.expect(t.parenR),n.guard=null,n.body=this.parseBlock(),e.handler=this.finishNode(n,"CatchClause")}return e.guardedHandlers=a,e.finalizer=this.eat(t._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},l.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},l.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(i),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},l.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},l.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},l.parseLabeledStatement=function(e,n,r){for(var l=0;l<this.labels.length;++l)this.labels[l].name===n&&this.raise(r.start,"Label '"+n+"' is already declared");var i=this.type.isLoop?"loop":this.type===t._switch?"switch":null;return this.labels.push({name:n,kind:i}),e.body=this.parseStatement(!0),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},l.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},l.parseBlock=function(e){var n=this.startNode(),r=!0,l=void 0;for(n.body=[],this.expect(t.braceL);!this.eat(t.braceR);){var i=this.parseStatement(!0);n.body.push(i),r&&e&&this.isUseStrict(i)&&(l=this.strict,this.setStrict(this.strict=!0)),r=!1}return l===!1&&this.setStrict(!1),this.finishNode(n,"BlockStatement")},l.parseFor=function(e,n){return e.init=n,this.expect(t.semi),e.test=this.type===t.semi?null:this.parseExpression(),this.expect(t.semi),e.update=this.type===t.parenR?null:this.parseExpression(),this.expect(t.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},l.parseForIn=function(e,n){var r=this.type===t._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=n,e.right=this.parseExpression(),this.expect(t.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,r)},l.parseVar=function(e,n,r){for(e.declarations=[],e.kind=r.keyword;;){var l=this.startNode();if(this.parseVarHead(l),this.eat(t.eq)?l.init=this.parseMaybeAssign(n):r!==t._const||this.type===t._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"==l.id.type||n&&(this.type===t._in||this.isContextual("of"))?l.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(l,"VariableDeclarator")),!this.eat(t.comma))break}return e},l.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0)},l.parseFunction=function(e,n,r,l){return this.initFunction(e,l),this.options.ecmaVersion>=6&&(e.generator=this.eat(t.star)),(n||this.type===t.name)&&(e.id=this.parseIdent()),this.parseFunctionParams(e),this.parseFunctionBody(e,r),this.finishNode(e,n?"FunctionDeclaration":"FunctionExpression")},l.parseFunctionParams=function(e){this.expect(t.parenL),e.params=this.parseBindingList(t.parenR,!1,!1) },l.parseClass=function(e,n){this.next(),this.parseClassId(e,n),this.parseClassSuper(e);var r=this.startNode();for(r.body=[],this.expect(t.braceL);!this.eat(t.braceR);)if(!this.eat(t.semi))if(this.type!==t.at){var l=this.startNode();this.takeDecorators(l);var i=this.eat(t.star),s=!1;this.parsePropertyName(l),this.type===t.parenL||l.computed||"Identifier"!==l.key.type||"static"!==l.key.name?l["static"]=!1:(i&&this.unexpected(),l["static"]=!0,i=this.eat(t.star),this.parsePropertyName(l)),i||"Identifier"!==l.key.type||l.computed||!this.isClassProperty()?(this.options.features["es7.asyncFunctions"]&&this.type!==t.parenL&&!l.computed&&"Identifier"===l.key.type&&"async"===l.key.name&&(s=!0,this.parsePropertyName(l)),l.kind="method",l.computed||i||("Identifier"===l.key.type?this.type===t.parenL||"get"!==l.key.name&&"set"!==l.key.name?l["static"]||"constructor"!==l.key.name||(l.kind="constructor"):(l.kind=l.key.name,this.parsePropertyName(l)):l["static"]||"Literal"!==l.key.type||"constructor"!==l.key.value||(l.kind="constructor")),"constructor"===l.kind&&l.decorators&&this.raise(l.start,"You can't attach decorators to a class constructor"),this.parseClassMethod(r,l,i,s)):r.body.push(this.parseClassProperty(l))}else this.decorators.push(this.parseDecorator());return this.decorators.length&&this.raise(this.start,"You have trailing decorators with no method"),e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,n?"ClassDeclaration":"ClassExpression")},l.isClassProperty=function(){return this.type===t.eq||this.type===t.semi||this.canInsertSemicolon()},l.parseClassProperty=function(e){return this.type===t.eq?(this.options.features["es7.classProperties"]||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.finishNode(e,"ClassProperty")},l.parseClassMethod=function(e,t,n,r){t.value=this.parseMethod(n,r),e.body.push(this.finishNode(t,"MethodDefinition"))},l.parseClassId=function(e,n){e.id=this.type===t.name?this.parseIdent():n?this.unexpected():null},l.parseClassSuper=function(e){e.superClass=this.eat(t._extends)?this.parseExprSubscripts():null},l.parseExport=function(e){if(this.next(),this.type===t.star){var n=this.startNode();if(this.next(),!this.options.features["es7.exportExtensions"]||!this.eatContextual("as"))return this.parseExportFrom(e),this.finishNode(e,"ExportAllDeclaration");n.exported=this.parseIdent(),e.specifiers=[this.finishNode(n,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e)}else if(this.isExportDefaultSpecifier()){var n=this.startNode();if(n.exported=this.parseIdent(!0),e.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],this.type===t.comma&&this.lookahead().type===t.star){this.expect(t.comma);var r=this.startNode();this.expect(t.star),this.expectContextual("as"),r.exported=this.parseIdent(),e.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e)}else{if(this.eat(t._default)){var l=this.parseMaybeAssign(),i=!0;return("FunctionExpression"==l.type||"ClassExpression"==l.type)&&(i=!1,l.id&&(l.type="FunctionExpression"==l.type?"FunctionDeclaration":"ClassDeclaration")),e.declaration=l,i&&this.semicolon(),this.checkExport(e),this.finishNode(e,"ExportDefaultDeclaration")}this.type.keyword||this.shouldParseExportDeclaration()?(e.declaration=this.parseStatement(!0),e.specifiers=[],e.source=null):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),e.source=this.eatContextual("from")?this.type===t.string?this.parseExprAtom():this.unexpected():null,this.semicolon())}return this.checkExport(e),this.finishNode(e,"ExportNamedDeclaration")},l.isExportDefaultSpecifier=function(){if(this.type===t.name)return"type"!==this.value&&"async"!==this.value;if(this.type!==t._default)return!1;var e=this.lookahead();return e.type===t.comma||e.type===t.name&&"from"===e.value},l.parseExportSpecifiersMaybe=function(e){this.eat(t.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},l.parseExportFrom=function(e){this.expectContextual("from"),e.source=this.type===t.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.checkExport(e)},l.shouldParseExportDeclaration=function(){return this.options.features["es7.asyncFunctions"]&&this.isContextual("async")},l.checkExport=function(e){if(this.decorators.length){var t=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&t||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},l.parseExportSpecifiers=function(){var e=[],n=!0;for(this.expect(t.braceL);!this.eat(t.braceR);){if(n)n=!1;else if(this.expect(t.comma),this.afterTrailingComma(t.braceR))break;var r=this.startNode();r.local=this.parseIdent(this.type===t._default),r.exported=this.eatContextual("as")?this.parseIdent(!0):r.local,e.push(this.finishNode(r,"ExportSpecifier"))}return e},l.parseImport=function(e){return this.next(),this.type===t.string?(e.specifiers=a,e.source=this.parseExprAtom(),e.kind=""):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.type===t.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},l.parseImportSpecifiers=function(e){var n=!0;if(this.type===t.name){var r=this.markPosition();if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdent(),r)),!this.eat(t.comma))return}if(this.type===t.star){var l=this.startNode();return this.next(),this.expectContextual("as"),l.local=this.parseIdent(),this.checkLVal(l.local,!0),void e.specifiers.push(this.finishNode(l,"ImportNamespaceSpecifier"))}for(this.expect(t.braceL);!this.eat(t.braceR);){if(n)n=!1;else if(this.expect(t.comma),this.afterTrailingComma(t.braceR))break;var l=this.startNode();l.imported=this.parseIdent(!0),l.local=this.eatContextual("as")?this.parseIdent():l.imported,this.checkLVal(l.local,!0),e.specifiers.push(this.finishNode(l,"ImportSpecifier"))}},l.parseImportSpecifierDefault=function(e,t){var n=this.startNodeAt(t);return n.local=e,this.checkLVal(n.local,!0),this.finishNode(n,"ImportDefaultSpecifier")}},{"./state":12,"./tokentype":16,"./whitespace":18}],14:[function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var l=e("./state").Parser,i=e("./tokentype").types,s=e("./whitespace").lineBreak,a=n.TokContext=function p(e,t,n,l){r(this,p),this.token=e,this.isExpr=t,this.preserveSpace=n,this.override=l},o={b_stat:new a("{",!1),b_expr:new a("{",!0),b_tmpl:new a("${",!0),p_stat:new a("(",!1),p_expr:new a("(",!0),q_tmpl:new a("`",!0,!0,function(e){return e.readTmplToken()}),f_expr:new a("function",!0)};n.types=o;var u=l.prototype;u.initialContext=function(){return[o.b_stat]},u.braceIsBlock=function(e){var t=void 0;return e===i.colon&&"{"==(t=this.curContext()).token?!t.isExpr:e===i._return?s.test(this.input.slice(this.lastTokEnd,this.start)):e===i._else||e===i.semi||e===i.eof?!0:e==i.braceL?this.curContext()===o.b_stat:!this.exprAllowed},u.updateContext=function(e){var t=void 0,n=this.type;n.keyword&&e==i.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},i.parenR.updateContext=i.braceR.updateContext=function(){if(1==this.context.length)return void(this.exprAllowed=!0);var e=this.context.pop();e===o.b_stat&&this.curContext()===o.f_expr?(this.context.pop(),this.exprAllowed=!1):this.exprAllowed=e===o.b_tmpl?!0:!e.isExpr},i.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?o.b_stat:o.b_expr),this.exprAllowed=!0},i.dollarBraceL.updateContext=function(){this.context.push(o.b_tmpl),this.exprAllowed=!0},i.parenL.updateContext=function(e){var t=e===i._if||e===i._for||e===i._with||e===i._while;this.context.push(t?o.p_stat:o.p_expr),this.exprAllowed=!0},i.incDec.updateContext=function(){},i._function.updateContext=function(){this.curContext()!==o.b_stat&&this.context.push(o.f_expr),this.exprAllowed=!1},i.backQuote.updateContext=function(){this.curContext()===o.q_tmpl?this.context.pop():this.context.push(o.q_tmpl),this.exprAllowed=!1}},{"./state":12,"./tokentype":16,"./whitespace":18}],15:[function(e,t,n){"use strict";function r(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var i=e("./identifier"),s=i.isIdentifierStart,a=i.isIdentifierChar,o=e("./tokentype"),u=o.types,p=o.keywords,c=e("./state").Parser,d=e("./location").SourceLocation,f=e("./whitespace"),h=f.lineBreak,m=f.lineBreakG,g=f.isNewLine,y=f.nonASCIIwhitespace,b=n.Token=function S(e){l(this,S),this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new d(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},v=c.prototype;v.next=function(){this.options.onToken&&this.options.onToken(new b(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},v.getToken=function(){return this.next(),new b(this)},"undefined"!=typeof Symbol&&(v[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===u.eof,value:t}}}}),v.setStrict=function(e){if(this.strict=e,this.type===u.num||this.type===u.string){if(this.pos=this.start,this.options.locations)for(;this.pos<this.lineStart;)this.lineStart=this.input.lastIndexOf("\n",this.lineStart-2)+1,--this.curLine;this.nextToken()}},v.curContext=function(){return this.context[this.context.length-1]},v.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(u.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},v.readToken=function(e){return s(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},v.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(55295>=e||e>=57344)return e;var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888},v.skipBlockComment=function(){var e=this.options.onComment&&this.options.locations&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations){m.lastIndex=t;for(var r=void 0;(r=m.exec(this.input))&&r.index<this.pos;)++this.curLine,this.lineStart=r.index+r[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.options.locations&&this.curPosition())},v.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.options.locations&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&10!==r&&13!==r&&8232!==r&&8233!==r;)++this.pos,r=this.input.charCodeAt(this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.options.locations&&this.curPosition())},v.skipSpace=function(){for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);if(32===e)++this.pos;else if(13===e){++this.pos;var t=this.input.charCodeAt(this.pos);10===t&&++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos)}else if(10===e||8232===e||8233===e)++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);else if(e>8&&14>e)++this.pos;else if(47===e){var t=this.input.charCodeAt(this.pos+1);if(42===t)this.skipBlockComment();else{if(47!==t)break;this.skipLineComment(2)}}else if(160===e)++this.pos;else{if(!(e>=5760&&y.test(String.fromCharCode(e))))break;++this.pos}}},v.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},v.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&57>=e)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))},v.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(u.assign,2):this.finishOp(u.slash,1)},v.readToken_mult_modulo=function(e){var t=42===e?u.star:u.modulo,n=1,r=this.input.charCodeAt(this.pos+1);return 42===r&&(n++,r=this.input.charCodeAt(this.pos+2),t=u.exponent),61===r&&(n++,t=u.assign),this.finishOp(t,n)},v.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?u.logicalOR:u.logicalAND,2):61===t?this.finishOp(u.assign,2):this.finishOp(124===e?u.bitwiseOR:u.bitwiseAND,1)},v.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)},v.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45==t&&62==this.input.charCodeAt(this.pos+2)&&h.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(u.incDec,2):61===t?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)},v.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(u.assign,n+1):this.finishOp(u.bitShift,n)):33==t&&60==e&&45==this.input.charCodeAt(this.pos+2)&&45==this.input.charCodeAt(this.pos+3)?(this.inModule&&unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(n=61===this.input.charCodeAt(this.pos+2)?3:2),this.finishOp(u.relational,n))},v.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(u.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(61===e?u.eq:u.prefix,1)},v.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 63:return++this.pos,this.finishToken(u.question);case 64:return++this.pos,this.finishToken(u.at);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(u.prefix,1)}this.raise(this.pos,"Unexpected character '"+r(e)+"'")},v.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};var x=!1;try{new RegExp("￿","u"),x=!0}catch(E){}v.readRegexp=function(){for(var e=void 0,t=void 0,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(h.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.pos}var l=this.input.slice(n,this.pos);++this.pos;var i=this.readWord1(),s=l;if(i){var a=/^[gmsiy]*$/;this.options.ecmaVersion>=6&&(a=/^[gmsiyu]*$/),a.test(i)||this.raise(n,"Invalid regular expression flag"),i.indexOf("u")>=0&&!x&&(s=s.replace(/\\u([a-fA-F0-9]{4})|\\u\{([0-9a-fA-F]+)\}|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"))}try{new RegExp(s)}catch(o){o instanceof SyntaxError&&this.raise(n,"Error parsing regular expression: "+o.message),this.raise(o)}var p=void 0;try{p=new RegExp(l,i)}catch(c){p=null}return this.finishToken(u.regexp,{pattern:l,flags:i,value:p})},v.readInt=function(e,t){for(var n=this.pos,r=0,l=0,i=null==t?1/0:t;i>l;++l){var s=this.input.charCodeAt(this.pos),a=void 0;if(a=s>=97?s-97+10:s>=65?s-65+10:s>=48&&57>=s?s-48:1/0,a>=e)break;++this.pos,r=r*e+a}return this.pos===n||null!=t&&this.pos-n!==t?null:r},v.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),s(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,t)},v.readNumber=function(e){var t=this.pos,n=!1,r=48===this.input.charCodeAt(this.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number"),46===this.input.charCodeAt(this.pos)&&(++this.pos,this.readInt(10),n=!0);var l=this.input.charCodeAt(this.pos);(69===l||101===l)&&(l=this.input.charCodeAt(++this.pos),(43===l||45===l)&&++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),s(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=this.input.slice(t,this.pos),a=void 0;return n?a=parseFloat(i):r&&1!==i.length?/[89]/.test(i)||this.strict?this.raise(t,"Invalid number"):a=parseInt(i,8):a=parseInt(i,10),this.finishToken(u.num,a)},v.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t=void 0;return 123===e?(this.options.ecmaVersion<6&&this.unexpected(),++this.pos,t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.unexpected()):t=this.readHexChar(4),t},v.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(),n=this.pos):(g(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(u.string,t)},v.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos===this.start&&this.type===u.template?36===n?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(u.template,e));92===n?(e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(),t=this.pos):g(n)?(e+=this.input.slice(t,this.pos),++this.pos,13===n&&10===this.input.charCodeAt(this.pos)?(++this.pos,e+="\n"):e+=String.fromCharCode(n),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos):++this.pos}},v.readEscapedChar=function(){var e=this.input.charCodeAt(++this.pos),t=/^[0-7]+/.exec(this.input.slice(this.pos,this.pos+3));for(t&&(t=t[0]);t&&parseInt(t,8)>255;)t=t.slice(0,-1);if("0"===t&&(t=null),++this.pos,t)return this.strict&&this.raise(this.pos-2,"Octal literal in strict mode"),this.pos+=t.length-1,String.fromCharCode(parseInt(t,8));switch(e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return r(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return" ";case 102:return"\f";case 48:return"\x00";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:return String.fromCharCode(e)}},v.readHexChar=function(e){var t=this.readInt(16,e);return null===t&&this.raise(this.start,"Bad character escape sequence"),t};var _;v.readWord1=function(){_=!1;for(var e="",t=!0,n=this.pos,l=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(a(i,l))this.pos+=65535>=i?1:2;else{if(92!==i)break;_=!0,e+=this.input.slice(n,this.pos);var o=this.pos;117!=this.input.charCodeAt(++this.pos)&&this.raise(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var u=this.readCodePoint();(t?s:a)(u,l)||this.raise(o,"Invalid Unicode escape"),e+=r(u),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},v.readWord=function(){var e=this.readWord1(),t=u.name;return(this.options.ecmaVersion>=6||!_)&&this.isKeyword(e)&&(t=p[e]),this.finishToken(t,e)}},{"./identifier":4,"./location":6,"./state":12,"./tokentype":16,"./whitespace":18}],16:[function(e,t,n){"use strict";function r(e,t){return new s(e,{beforeExpr:!0,binop:t})}function l(e){var t=void 0===arguments[1]?{}:arguments[1];t.keyword=e,p[e]=u["_"+e]=new s(e,t)}var i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var s=n.TokenType=function c(e){var t=void 0===arguments[1]?{}:arguments[1];i(this,c),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},a={beforeExpr:!0},o={startsExpr:!0},u={num:new s("num",o),regexp:new s("regexp",o),string:new s("string",o),name:new s("name",o),eof:new s("eof"),bracketL:new s("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new s("]"),braceL:new s("{",{beforeExpr:!0,startsExpr:!0}),braceR:new s("}"),parenL:new s("(",{beforeExpr:!0,startsExpr:!0}),parenR:new s(")"),comma:new s(",",a),semi:new s(";",a),colon:new s(":",a),dot:new s("."),question:new s("?",a),arrow:new s("=>",a),template:new s("template"),ellipsis:new s("...",a),backQuote:new s("`",o),dollarBraceL:new s("${",{beforeExpr:!0,startsExpr:!0}),at:new s("@"),eq:new s("=",{beforeExpr:!0,isAssign:!0}),assign:new s("_=",{beforeExpr:!0,isAssign:!0}),incDec:new s("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new s("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:r("||",1),logicalAND:r("&&",2),bitwiseOR:r("|",3),bitwiseXOR:r("^",4),bitwiseAND:r("&",5),equality:r("==/!=",6),relational:r("</>",7),bitShift:r("<</>>",8),plusMin:new s("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:r("%",10),star:r("*",10),slash:r("/",10),exponent:new s("**",{beforeExpr:!0,binop:11,rightAssociative:!0})};n.types=u;var p={};n.keywords=p,l("break"),l("case",a),l("catch"),l("continue"),l("debugger"),l("default"),l("do",{isLoop:!0}),l("else",a),l("finally"),l("for",{isLoop:!0}),l("function"),l("if"),l("return",a),l("switch"),l("throw",a),l("try"),l("var"),l("let"),l("const"),l("while",{isLoop:!0}),l("with"),l("new",{beforeExpr:!0,startsExpr:!0}),l("this",o),l("super",o),l("class"),l("extends",a),l("export"),l("import"),l("yield",{beforeExpr:!0,startsExpr:!0}),l("null",o),l("true",o),l("false",o),l("in",{beforeExpr:!0,binop:7}),l("instanceof",{beforeExpr:!0,binop:7}),l("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),l("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),l("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},{}],17:[function(e,t,n){"use strict";function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.isArray=r,n.has=l,n.__esModule=!0},{}],18:[function(e,t,n){"use strict";function r(e){return 10===e||13===e||8232===e||8233==e}n.isNewLine=r,n.__esModule=!0;var l=/\r\n?|\n|\u2028|\u2029/;n.lineBreak=l;var i=new RegExp(l.source,"g");n.lineBreakG=i;var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;n.nonASCIIwhitespace=s},{}],19:[function(e,t){(function(n){"use strict";var r=t.exports=e("../transformation");r.options=e("../transformation/file/options"),r.version=e("../../../package").version,r.transform=r,r.run=function(e){var t=void 0===arguments[1]?{}:arguments[1];return t.sourceMaps="inline",new Function(r(e,t).code)()},r.load=function(e,t,l,i){var s=void 0===arguments[2]?{}:arguments[2],a=s;a.filename||(a.filename=e);var o=n.ActiveXObject?new n.ActiveXObject("Microsoft.XMLHTTP"):new n.XMLHttpRequest;o.open("GET",e,!0),"overrideMimeType"in o&&o.overrideMimeType("text/plain"),o.onreadystatechange=function(){if(4===o.readyState){var n=o.status;if(0!==n&&200!==n)throw new Error("Could not load "+e);var l=[o.responseText,s];i||r.run.apply(r,l),t&&t(l)}},o.send(null)};var l=function(){for(var e=[],t=["text/ecmascript-6","text/6to5","text/babel","module"],l=0,i=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(){var t=e[l];t instanceof Array&&(r.run.apply(r,t),l++,i())}),s=function(t,n){var l={};t.src?r.load(t.src,function(t){e[n]=t,i()},l,!0):(l.filename="embedded",e[n]=[t.innerHTML,l])},a=n.document.getElementsByTagName("script"),o=0;o<a.length;++o){var u=a[o];t.indexOf(u.type)>=0&&e.push(u)}for(o in e)s(e[o],o);i()};n.addEventListener?n.addEventListener("DOMContentLoaded",l,!1):n.attachEvent&&n.attachEvent("onload",l)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../../package":452,"../transformation":63,"../transformation/file/options":49}],20:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("repeating")),i=n(e("trim-right")),s=n(e("lodash/lang/isBoolean")),a=n(e("lodash/collection/includes")),o=n(e("lodash/lang/isNumber")),u=function(){function e(t,n){r(this,e),this.position=t,this._indent=n.indent.base,this.format=n,this.buf=""}return e.prototype.get=function(){return i(this.buf)},e.prototype.getIndent=function(){return this.format.compact||this.format.concise?"":l(this.format.indent.style,this._indent)},e.prototype.indentSize=function(){return this.getIndent().length},e.prototype.indent=function(){this._indent++},e.prototype.dedent=function(){this._indent--},e.prototype.semicolon=function(){this.push(";")},e.prototype.ensureSemicolon=function(){this.isLast(";")||this.semicolon()},e.prototype.rightBrace=function(){this.newline(!0),this.push("}")},e.prototype.keyword=function(e){this.push(e),this.space()},e.prototype.space=function(){this.format.compact||!this.buf||this.isLast(" ")||this.isLast("\n")||this.push(" ")},e.prototype.removeLast=function(e){this.format.compact||this.isLast(e)&&(this.buf=this.buf.substr(0,this.buf.length-1),this.position.unshift(e))},e.prototype.newline=function(e,t){if(!this.format.compact){if(this.format.concise)return void this.space();if(t||(t=!1),o(e)){if(e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,0>=e)return;for(;e>0;)this._newline(t),e--}else s(e)&&(t=e),this._newline(t)}},e.prototype._newline=function(e){this.endsWith("\n\n")||(e&&this.isLast("\n")&&this.removeLast("\n"),this.removeLast(" "),this._removeSpacesAfterLastNewline(),this._push("\n"))},e.prototype._removeSpacesAfterLastNewline=function(){var e=this.buf.lastIndexOf("\n");if(-1!==e){for(var t=this.buf.length-1;t>e&&" "===this.buf[t];)t--;t===e&&(this.buf=this.buf.substring(0,t+1))}},e.prototype.push=function(e,t){if(!this.format.compact&&this._indent&&!t&&"\n"!==e){var n=this.getIndent();e=e.replace(/\n/g,"\n"+n),this.isLast("\n")&&this._push(n)}this._push(e)},e.prototype._push=function(e){this.position.push(e),this.buf+=e},e.prototype.endsWith=function(e){return this.buf.slice(-e.length)===e},e.prototype.isLast=function(e){if(this.format.compact)return!1;var t=this.buf,n=t[t.length-1];return Array.isArray(e)?a(e,n):e===n},e}();t.exports=u},{"lodash/collection/includes":319,"lodash/lang/isBoolean":391,"lodash/lang/isNumber":395,repeating:435,"trim-right":451}],21:[function(e,t,n){"use strict";function r(e,t){t(e.program)}function l(e,t){t.sequence(e.body)}function i(e,t){0===e.body.length?this.push("{}"):(this.push("{"),this.newline(),t.sequence(e.body,{indent:!0}),this.removeLast("\n"),this.rightBrace())}n.File=r,n.Program=l,n.BlockStatement=i,n.__esModule=!0},{}],22:[function(e,t,n){"use strict";function r(e,t){t.list(e.decorators),this.push("class"),e.id&&(this.space(),t(e.id)),t(e.typeParameters),e.superClass&&(this.push(" extends "),t(e.superClass),t(e.superTypeParameters)),e["implements"]&&(this.push(" implements "),t.join(e["implements"],{separator:", "})),this.space(),t(e.body)}function l(e,t){0===e.body.length?this.push("{}"):(this.push("{"),this.newline(),this.indent(),t.sequence(e.body),this.dedent(),this.rightBrace())}function i(e,t){t.list(e.decorators),e["static"]&&this.push("static "),t(e.key),t(e.typeAnnotation),e.value&&(this.space(),this.push("="),this.space(),t(e.value)),this.semicolon()}function s(e,t){t.list(e.decorators),e["static"]&&this.push("static "),this._method(e,t)}n.ClassDeclaration=r,n.ClassBody=l,n.ClassProperty=i,n.MethodDefinition=s,n.__esModule=!0,n.ClassExpression=r},{}],23:[function(e,t,n){"use strict";function r(e,t){this.keyword("for"),this.push("("),t(e.left),this.push(" of "),t(e.right),this.push(")")}function l(e,t){this.push(e.generator?"(":"["),t.join(e.blocks,{separator:" "}),this.space(),e.filter&&(this.keyword("if"),this.push("("),t(e.filter),this.push(")"),this.space()),t(e.body),this.push(e.generator?")":"]")}n.ComprehensionBlock=r,n.ComprehensionExpression=l,n.__esModule=!0},{}],24:[function(e,t,n){"use strict";function r(e,t){var n=/[a-z]$/.test(e.operator),r=e.argument;(E.isUpdateExpression(r)||E.isUnaryExpression(r))&&(n=!0),E.isUnaryExpression(r)&&"!"===r.operator&&(n=!1),this.push(e.operator),n&&this.push(" "),t(e.argument)}function l(e,t){this.push("do"),this.space(),t(e.body)}function i(e,t){e.prefix?(this.push(e.operator),t(e.argument)):(t(e.argument),this.push(e.operator))}function s(e,t){t(e.test),this.space(),this.push("?"),this.space(),t(e.consequent),this.space(),this.push(":"),this.space(),t(e.alternate)}function a(e,t){this.push("new "),t(e.callee),this.push("("),t.list(e.arguments),this.push(")")}function o(e,t){t.list(e.expressions)}function u(){this.push("this")}function p(){this.push("super")}function c(e,t){this.push("@"),t(e.expression)}function d(e,t){t(e.callee),this.push("(");var n=",";e._prettyCall?(n+="\n",this.newline(),this.indent()):n+=" ",t.list(e.arguments,{separator:n}),e._prettyCall&&(this.newline(),this.dedent()),this.push(")")}function f(){this.semicolon()}function h(e,t){t(e.expression),this.semicolon()}function m(e,t){t(e.left),this.push(" "),this.push(e.operator),this.push(" "),t(e.right)}function g(e,t){var n=e.object;if(t(n),!e.computed&&E.isMemberExpression(e.property))throw new TypeError("Got a MemberExpression for MemberExpression property");var r=e.computed;E.isLiteral(e.property)&&x(e.property.value)&&(r=!0),r?(this.push("["),t(e.property),this.push("]")):(E.isLiteral(n)&&v(n.value)&&!w.test(n.value.toString())&&this.push("."),this.push("."),t(e.property))}var y=function(e){return e&&e.__esModule?e:{"default":e}},b=function(e){return e&&e.__esModule?e["default"]:e};n.UnaryExpression=r,n.DoExpression=l,n.UpdateExpression=i,n.ConditionalExpression=s,n.NewExpression=a,n.SequenceExpression=o,n.ThisExpression=u,n.Super=p,n.Decorator=c,n.CallExpression=d,n.EmptyStatement=f,n.ExpressionStatement=h,n.AssignmentExpression=m,n.MemberExpression=g,n.__esModule=!0;var v=b(e("is-integer")),x=b(e("lodash/lang/isNumber")),E=y(e("../../types")),_=function(e){return function(t,n){this.push(e),(t.delegate||t.all)&&this.push("*"),t.argument&&(this.space(),n(t.argument))}},S=_("yield"); n.YieldExpression=S;var I=_("await");n.AwaitExpression=I,n.BinaryExpression=m,n.LogicalExpression=m,n.AssignmentPattern=m;var w=/e/i;n.MetaProperty=g},{"../../types":153,"is-integer":303,"lodash/lang/isNumber":395}],25:[function(e,t,n){"use strict";function r(){this.push("any")}function l(e,t){t(e.elementType),this.push("["),this.push("]")}function i(){this.push("bool")}function s(e,t){this.push("declare class "),this._interfaceish(e,t)}function a(e,t){this.push("declare function "),t(e.id),t(e.id.typeAnnotation.typeAnnotation),this.semicolon()}function o(e,t){this.push("declare module "),t(e.id),this.space(),t(e.body)}function u(e,t){this.push("declare var "),t(e.id),t(e.id.typeAnnotation),this.semicolon()}function p(e,t,n){t(e.typeParameters),this.push("("),t.list(e.params),e.rest&&(e.params.length&&(this.push(","),this.space()),this.push("..."),t(e.rest)),this.push(")"),"ObjectTypeProperty"===n.type||"ObjectTypeCallProperty"===n.type||"DeclareFunction"===n.type?this.push(":"):(this.space(),this.push("=>")),this.space(),t(e.returnType)}function c(e,t){t(e.name),e.optional&&this.push("?"),this.push(":"),this.space(),t(e.typeAnnotation)}function d(e,t){t(e.id),t(e.typeParameters)}function f(e,t){t(e.id),t(e.typeParameters),e["extends"].length&&(this.push(" extends "),t.join(e["extends"],{separator:", "})),this.space(),t(e.body)}function h(e,t){this.push("interface "),this._interfaceish(e,t)}function m(e,t){t.join(e.types,{separator:" & "})}function g(e,t){this.push("?"),t(e.typeAnnotation)}function y(){this.push("number")}function b(e){this._stringLiteral(e.value)}function v(){this.push("string")}function x(e,t){this.push("["),t.join(e.types,{separator:", "}),this.push("]")}function E(e,t){this.push("typeof "),t(e.argument)}function _(e,t){this.push("type "),t(e.id),t(e.typeParameters),this.space(),this.push("="),this.space(),t(e.right),this.semicolon()}function S(e,t){this.push(":"),this.space(),e.optional&&this.push("?"),t(e.typeAnnotation)}function I(e,t){this.push("<"),t.join(e.params,{separator:", "}),this.push(">")}function w(e,t){var n=this;this.push("{");var r=e.properties.concat(e.callProperties,e.indexers);r.length&&(this.space(),t.list(r,{separator:!1,indent:!0,iterator:function(){1!==r.length&&(n.semicolon(),n.space())}}),this.space()),this.push("}")}function k(e,t){e["static"]&&this.push("static "),t(e.value)}function A(e,t){e["static"]&&this.push("static "),this.push("["),t(e.id),this.push(":"),this.space(),t(e.key),this.push("]"),this.push(":"),this.space(),t(e.value)}function C(e,t){e["static"]&&this.push("static "),t(e.key),e.optional&&this.push("?"),O.isFunctionTypeAnnotation(e.value)||(this.push(":"),this.space()),t(e.value)}function T(e,t){t(e.qualification),this.push("."),t(e.id)}function j(e,t){t.join(e.types,{separator:" | "})}function M(e,t){this.push("("),t(e.expression),t(e.typeAnnotation),this.push(")")}function P(){this.push("void")}var L=function(e){return e&&e.__esModule?e:{"default":e}};n.AnyTypeAnnotation=r,n.ArrayTypeAnnotation=l,n.BooleanTypeAnnotation=i,n.DeclareClass=s,n.DeclareFunction=a,n.DeclareModule=o,n.DeclareVariable=u,n.FunctionTypeAnnotation=p,n.FunctionTypeParam=c,n.InterfaceExtends=d,n._interfaceish=f,n.InterfaceDeclaration=h,n.IntersectionTypeAnnotation=m,n.NullableTypeAnnotation=g,n.NumberTypeAnnotation=y,n.StringLiteralTypeAnnotation=b,n.StringTypeAnnotation=v,n.TupleTypeAnnotation=x,n.TypeofTypeAnnotation=E,n.TypeAlias=_,n.TypeAnnotation=S,n.TypeParameterInstantiation=I,n.ObjectTypeAnnotation=w,n.ObjectTypeCallProperty=k,n.ObjectTypeIndexer=A,n.ObjectTypeProperty=C,n.QualifiedTypeIdentifier=T,n.UnionTypeAnnotation=j,n.TypeCastExpression=M,n.VoidTypeAnnotation=P,n.__esModule=!0;var O=L(e("../../types"));n.ClassImplements=d,n.GenericTypeAnnotation=d,n.TypeParameterDeclaration=I},{"../../types":153}],26:[function(e,t,n){"use strict";function r(e,t){t(e.name),e.value&&(this.push("="),t(e.value))}function l(e){this.push(e.name)}function i(e,t){t(e.namespace),this.push(":"),t(e.name)}function s(e,t){t(e.object),this.push("."),t(e.property)}function a(e,t){this.push("{..."),t(e.argument),this.push("}")}function o(e,t){this.push("{"),t(e.expression),this.push("}")}function u(e,t){var n=this,r=e.openingElement;t(r),r.selfClosing||(this.indent(),m(e.children,function(e){g.isLiteral(e)?n.push(e.value):t(e)}),this.dedent(),t(e.closingElement))}function p(e,t){this.push("<"),t(e.name),e.attributes.length>0&&(this.push(" "),t.join(e.attributes,{separator:" "})),this.push(e.selfClosing?" />":">")}function c(e,t){this.push("</"),t(e.name),this.push(">")}function d(){}var f=function(e){return e&&e.__esModule?e:{"default":e}},h=function(e){return e&&e.__esModule?e["default"]:e};n.JSXAttribute=r,n.JSXIdentifier=l,n.JSXNamespacedName=i,n.JSXMemberExpression=s,n.JSXSpreadAttribute=a,n.JSXExpressionContainer=o,n.JSXElement=u,n.JSXOpeningElement=p,n.JSXClosingElement=c,n.JSXEmptyExpression=d,n.__esModule=!0;var m=h(e("lodash/collection/each")),g=f(e("../../types"))},{"../../types":153,"lodash/collection/each":316}],27:[function(e,t,n){"use strict";function r(e,t){var n=this;t(e.typeParameters),this.push("("),t.list(e.params,{iterator:function(e){e.optional&&n.push("?"),t(e.typeAnnotation)}}),this.push(")"),e.returnType&&t(e.returnType)}function l(e,t){var n=e.value,r=e.kind,l=e.key;("method"===r||"init"===r)&&n.generator&&this.push("*"),("get"===r||"set"===r)&&this.push(r+" "),n.async&&this.push("async "),e.computed?(this.push("["),t(l),this.push("]")):t(l),this._params(n,t),this.push(" "),t(n.body)}function i(e,t){e.async&&this.push("async "),this.push("function"),e.generator&&this.push("*"),e.id?(this.push(" "),t(e.id)):this.space(),this._params(e,t),this.space(),t(e.body)}function s(e,t){e.async&&this.push("async "),1===e.params.length&&o.isIdentifier(e.params[0])?t(e.params[0]):this._params(e,t),this.push(" => "),t(e.body)}var a=function(e){return e&&e.__esModule?e:{"default":e}};n._params=r,n._method=l,n.FunctionExpression=i,n.ArrowFunctionExpression=s,n.__esModule=!0;var o=a(e("../../types"));n.FunctionDeclaration=i},{"../../types":153}],28:[function(e,t,n){"use strict";function r(e,t){t(e.imported),e.local&&e.local!==e.imported&&(this.push(" as "),t(e.local))}function l(e,t){t(e.local)}function i(e,t){t(e.exported)}function s(e,t){t(e.local),e.exported&&e.local!==e.exported&&(this.push(" as "),t(e.exported))}function a(e,t){this.push("* as "),t(e.exported)}function o(e,t){this.push("export *"),e.exported&&(this.push(" as "),t(e.exported)),this.push(" from "),t(e.source),this.semicolon()}function u(e,t){this.push("export "),c.call(this,e,t)}function p(e,t){this.push("export default "),c.call(this,e,t)}function c(e,t){var n=e.specifiers;if(e.declaration){var r=e.declaration;if(t(r),g.isStatement(r)||g.isFunction(r)||g.isClass(r))return}else{var l=n[0],i=!1;(g.isExportDefaultSpecifier(l)||g.isExportNamespaceSpecifier(l))&&(i=!0,t(n.shift()),n.length&&this.push(", ")),(n.length||!n.length&&!i)&&(this.push("{"),n.length&&(this.space(),t.join(n,{separator:", "}),this.space()),this.push("}")),e.source&&(this.push(" from "),t(e.source))}this.ensureSemicolon()}function d(e,t){this.push("import "),e.isType&&this.push("type ");var n=e.specifiers;if(n&&n.length){var r=e.specifiers[0];(g.isImportDefaultSpecifier(r)||g.isImportNamespaceSpecifier(r))&&(t(e.specifiers.shift()),e.specifiers.length&&this.push(", ")),e.specifiers.length&&(this.push("{"),this.space(),t.join(e.specifiers,{separator:", "}),this.space(),this.push("}")),this.push(" from ")}t(e.source),this.semicolon()}function f(e,t){this.push("* as "),t(e.local)}var h=function(e){return e&&e.__esModule?e:{"default":e}},m=function(e){return e&&e.__esModule?e["default"]:e};n.ImportSpecifier=r,n.ImportDefaultSpecifier=l,n.ExportDefaultSpecifier=i,n.ExportSpecifier=s,n.ExportNamespaceSpecifier=a,n.ExportAllDeclaration=o,n.ExportNamedDeclaration=u,n.ExportDefaultDeclaration=p,n.ImportDeclaration=d,n.ImportNamespaceSpecifier=f,n.__esModule=!0;var g=(m(e("lodash/collection/each")),h(e("../../types")))},{"../../types":153,"lodash/collection/each":316}],29:[function(e,t,n){"use strict";function r(e,t){this.keyword("with"),this.push("("),t(e.object),this.push(")"),t.block(e.body)}function l(e,t){this.keyword("if"),this.push("("),t(e.test),this.push(")"),this.space(),t.indentOnComments(e.consequent),e.alternate&&(this.isLast("}")&&this.space(),this.push("else "),t.indentOnComments(e.alternate))}function i(e,t){this.keyword("for"),this.push("("),t(e.init),this.push(";"),e.test&&(this.push(" "),t(e.test)),this.push(";"),e.update&&(this.push(" "),t(e.update)),this.push(")"),t.block(e.body)}function s(e,t){this.keyword("while"),this.push("("),t(e.test),this.push(")"),t.block(e.body)}function a(e,t){this.keyword("do"),t(e.body),this.space(),this.keyword("while"),this.push("("),t(e.test),this.push(");")}function o(e,t){t(e.label),this.push(": "),t(e.body)}function u(e,t){this.keyword("try"),t(e.block),this.space(),t(e.handlers?e.handlers[0]:e.handler),e.finalizer&&(this.space(),this.push("finally "),t(e.finalizer))}function p(e,t){this.keyword("catch"),this.push("("),t(e.param),this.push(") "),t(e.body)}function c(e,t){this.push("throw "),t(e.argument),this.semicolon()}function d(e,t){this.keyword("switch"),this.push("("),t(e.discriminant),this.push(")"),this.space(),this.push("{"),t.sequence(e.cases,{indent:!0,addNewlines:function(t,n){return t||e.cases[e.cases.length-1]!==n?void 0:-1}}),this.push("}")}function f(e,t){e.test?(this.push("case "),t(e.test),this.push(":")):this.push("default:"),e.consequent.length&&(this.newline(),t.sequence(e.consequent,{indent:!0}))}function h(){this.push("debugger;")}function m(e,t,n){this.push(e.kind+" ");var r=!1;if(!x.isFor(n))for(var l=0;l<e.declarations.length;l++)e.declarations[l].init&&(r=!0);var i=",";i+=!this.format.compact&&r?"\n"+v(" ",e.kind.length+1):" ",t.list(e.declarations,{separator:i}),(!x.isFor(n)||n.left!==e&&n.init!==e)&&this.semicolon()}function g(e,t){t(e.id),t(e.id.typeAnnotation),e.init&&(this.space(),this.push("="),this.space(),t(e.init))}var y=function(e){return e&&e.__esModule?e:{"default":e}},b=function(e){return e&&e.__esModule?e["default"]:e};n.WithStatement=r,n.IfStatement=l,n.ForStatement=i,n.WhileStatement=s,n.DoWhileStatement=a,n.LabeledStatement=o,n.TryStatement=u,n.CatchClause=p,n.ThrowStatement=c,n.SwitchStatement=d,n.SwitchCase=f,n.DebuggerStatement=h,n.VariableDeclaration=m,n.VariableDeclarator=g,n.__esModule=!0;var v=b(e("repeating")),x=y(e("../../types")),E=function(e){return function(t,n){this.keyword("for"),this.push("("),n(t.left),this.push(" "+e+" "),n(t.right),this.push(")"),n.block(t.body)}},_=E("in");n.ForInStatement=_;var S=E("of");n.ForOfStatement=S;var I=function(e,t){return function(n,r){this.push(e);var l=n[t||"label"];l&&(this.push(" "),r(l)),this.semicolon()}},w=I("continue");n.ContinueStatement=w;var k=I("return","argument");n.ReturnStatement=k;var A=I("break");n.BreakStatement=A},{"../../types":153,repeating:435}],30:[function(e,t,n){"use strict";function r(e,t){t(e.tag),t(e.quasi)}function l(e){this._push(e.value.raw)}function i(e,t){var n=this;this.push("`");var r=e.quasis,l=r.length;a(r,function(r,i){t(r),l>i+1&&(n.push("${ "),t(e.expressions[i]),n.push(" }"))}),this._push("`")}var s=function(e){return e&&e.__esModule?e["default"]:e};n.TaggedTemplateExpression=r,n.TemplateElement=l,n.TemplateLiteral=i,n.__esModule=!0;var a=s(e("lodash/collection/each"))},{"lodash/collection/each":316}],31:[function(e,t,n){"use strict";function r(e){this.push(e.name)}function l(e,t){this.push("..."),t(e.argument)}function i(e,t){var n=e.properties;n.length?(this.push("{"),this.space(),t.list(n,{indent:!0}),this.space(),this.push("}")):this.push("{}")}function s(e,t){if(e.method||"get"===e.kind||"set"===e.kind)this._method(e,t);else{if(e.computed)this.push("["),t(e.key),this.push("]");else if(t(e.key),e.shorthand)return;this.push(":"),this.space(),t(e.value)}}function a(e,t){var n=this,r=e.elements,l=r.length;this.push("["),c(r,function(e,r){e?(r>0&&n.push(" "),t(e),l-1>r&&n.push(",")):n.push(",")}),this.push("]")}function o(e){var t=e.value,n=typeof t;"string"===n?this._stringLiteral(t):"number"===n?this.push(t+""):"boolean"===n?this.push(t?"true":"false"):e.regex?this.push("/"+e.regex.pattern+"/"+e.regex.flags):null===t&&this.push("null")}function u(e){e=JSON.stringify(e),e=e.replace(/[\u000A\u000D\u2028\u2029]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}),"single"===this.format.quotes&&(e=e.slice(1,-1),e=e.replace(/\\"/g,'"'),e=e.replace(/'/g,"\\'"),e="'"+e+"'"),this.push(e)}var p=function(e){return e&&e.__esModule?e["default"]:e};n.Identifier=r,n.RestElement=l,n.ObjectExpression=i,n.Property=s,n.ArrayExpression=a,n.Literal=o,n._stringLiteral=u,n.__esModule=!0;var c=p(e("lodash/collection/each"));n.SpreadElement=l,n.SpreadProperty=l,n.ObjectPattern=i,n.ArrayPattern=a},{"lodash/collection/each":316}],32:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("detect-indent")),s=r(e("./whitespace")),a=r(e("repeating")),o=r(e("./source-map")),u=r(e("./position")),p=n(e("../messages")),c=r(e("./buffer")),d=r(e("lodash/object/extend")),f=r(e("lodash/collection/each")),h=r(e("./node")),m=n(e("../types")),g=function(){function t(e,n,r){l(this,t),n||(n={}),this.comments=e.comments||[],this.tokens=e.tokens||[],this.format=t.normalizeOptions(r,n,this.tokens),this.opts=n,this.ast=e,this.whitespace=new s(this.tokens,this.comments,this.format),this.position=new u,this.map=new o(this.position,n,r),this.buffer=new c(this.position,this.format)}return t.normalizeOptions=function(e,n,r){var l=" ";if(e){var s=i(e).indent;s&&" "!==s&&(l=s)}var a={comments:null==n.comments||n.comments,compact:n.compact,quotes:t.findCommonStringDelimeter(e,r),indent:{adjustMultilineComment:!0,style:l,base:0}};return"auto"===a.compact&&(a.compact=e.length>1e5,a.compact&&console.error(p.get("codeGeneratorDeopt",n.filename,"100KB"))),a},t.findCommonStringDelimeter=function(e,t){for(var n={single:0,"double":0},r=0,l=0;l<t.length;l++){var i=t[l];if("string"===i.type.label&&!(r>=3)){var s=e.slice(i.start,i.end);"'"===s[0]?n.single++:n.double++,r++}}return n.single>n.double?"single":"double"},t.generators={templateLiterals:e("./generators/template-literals"),comprehensions:e("./generators/comprehensions"),expressions:e("./generators/expressions"),statements:e("./generators/statements"),classes:e("./generators/classes"),methods:e("./generators/methods"),modules:e("./generators/modules"),types:e("./generators/types"),flow:e("./generators/flow"),base:e("./generators/base"),jsx:e("./generators/jsx")},t.prototype.generate=function(){var e=this.ast;this.print(e);var t=[];return f(e.comments,function(e){e._displayed||t.push(e)}),this._printComments(t),{map:this.map.get(),code:this.buffer.get()}},t.prototype.buildPrint=function(e){var t=this,n=function(n,r){return t.print(n,e,r)};return n.sequence=function(e){var r=void 0===arguments[1]?{}:arguments[1];return r.statement=!0,t.printJoin(n,e,r)},n.join=function(e,r){return t.printJoin(n,e,r)},n.list=function(e){var t=void 0===arguments[1]?{}:arguments[1];null==t.separator&&(t.separator=", "),n.join(e,t)},n.block=function(e){return t.printBlock(n,e)},n.indentOnComments=function(e){return t.printAndIndentOnComments(n,e)},n},t.prototype.print=function(e,t){var n=this,r=void 0===arguments[2]?{}:arguments[2];if(e){t&&t._compact&&(e._compact=!0);var l=this.format.concise;e._compact&&(this.format.concise=!0);var i=function(l){if(r.statement||h.isUserWhitespacable(e,t)){var i=0;if(null==e.start||e._ignoreUserWhitespace){l||i++,r.addNewlines&&(i+=r.addNewlines(l,e)||0);var s=h.needsWhitespaceAfter;l&&(s=h.needsWhitespaceBefore),s(e,t)&&i++,n.buffer.buf||(i=0)}else i=l?n.whitespace.getNewlinesBefore(e):n.whitespace.getNewlinesAfter(e);n.newline(i)}};if(!this[e.type])throw new ReferenceError("unknown node of type "+JSON.stringify(e.type)+" with constructor "+JSON.stringify(e&&e.constructor.name));var s=h.needsParensNoLineTerminator(e,t),a=s||h.needsParens(e,t);a&&this.push("("),s&&this.indent(),this.printLeadingComments(e,t),i(!0),r.before&&r.before(),this.map.mark(e,"start"),this[e.type](e,this.buildPrint(e),t),s&&(this.newline(),this.dedent()),a&&this.push(")"),this.map.mark(e,"end"),r.after&&r.after(),i(!1),this.printTrailingComments(e,t),this.format.concise=l}},t.prototype.printJoin=function(e,t){var n=this,r=void 0===arguments[2]?{}:arguments[2];if(t&&t.length){var l=t.length;r.indent&&this.indent(),f(t,function(t,i){e(t,{statement:r.statement,addNewlines:r.addNewlines,after:function(){r.iterator&&r.iterator(t,i),r.separator&&l-1>i&&n.push(r.separator)}})}),r.indent&&this.dedent()}},t.prototype.printAndIndentOnComments=function(e,t){var n=!!t.leadingComments;n&&this.indent(),e(t),n&&this.dedent()},t.prototype.printBlock=function(e,t){m.isEmptyStatement(t)?this.semicolon():(this.push(" "),e(t))},t.prototype.generateComment=function(e){var t=e.value;return t="Line"===e.type?"//"+t:"/*"+t+"*/"},t.prototype.printTrailingComments=function(e,t){this._printComments(this.getComments("trailingComments",e,t))},t.prototype.printLeadingComments=function(e,t){this._printComments(this.getComments("leadingComments",e,t))},t.prototype.getComments=function(e,t,n){var r=this;if(m.isExpressionStatement(n))return[];var l=[],i=[t];return m.isExpressionStatement(t)&&i.push(t.argument),f(i,function(t){l=l.concat(r._getComments(e,t))}),l},t.prototype._getComments=function(e,t){return t&&t[e]||[]},t.prototype._printComments=function(e){var t=this;this.format.compact||this.format.comments&&e&&e.length&&f(e,function(e){var n=!1;if(f(t.ast.comments,function(t){return t.start===e.start?(t._displayed&&(n=!0),t._displayed=!0,!1):void 0}),!n){t.newline(t.whitespace.getNewlinesBefore(e));var r=t.position.column,l=t.generateComment(e);if(r&&!t.isLast(["\n"," ","[","{"])&&(t._push(" "),r++),"Block"===e.type&&t.format.indent.adjustMultilineComment){var i=e.loc.start.column;if(i){var s=new RegExp("\\n\\s{1,"+i+"}","g");l=l.replace(s,"\n")}var o=Math.max(t.indentSize(),r);l=l.replace(/\n/g,"\n"+a(" ",o))}0===r&&(l=t.getIndent()+l),t._push(l),t.newline(t.whitespace.getNewlinesAfter(e))}})},t}();f(c.prototype,function(e,t){g.prototype[t]=function(){return e.apply(this.buffer,arguments)}}),f(g.generators,function(e){d(g.prototype,e)}),t.exports=function(e,t,n){var r=new g(e,t,n);return r.generate()},t.exports.CodeGenerator=g},{"../messages":43,"../types":153,"./buffer":20,"./generators/base":21,"./generators/classes":22,"./generators/comprehensions":23,"./generators/expressions":24,"./generators/flow":25,"./generators/jsx":26,"./generators/methods":27,"./generators/modules":28,"./generators/statements":29,"./generators/template-literals":30,"./generators/types":31,"./node":33,"./position":36,"./source-map":37,"./whitespace":38,"detect-indent":295,"lodash/collection/each":316,"lodash/object/extend":404,repeating:435}],33:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("./whitespace")),s=n(e("./parentheses")),a=r(e("lodash/collection/each")),o=r(e("lodash/collection/some")),u=n(e("../../types")),p=function(e,t,n){if(e){for(var r,l=Object.keys(e),i=0;i<l.length;i++){var s=l[i];if(u.is(s,t)){var a=e[s];if(r=a(t,n),null!=r)break}}return r}},c=function(){function e(t,n){l(this,e),this.parent=n,this.node=t}return e.isUserWhitespacable=function(e){return u.isUserWhitespacable(e)},e.needsWhitespace=function(t,n,r){if(!t)return 0;u.isExpressionStatement(t)&&(t=t.expression);var l=p(i.nodes,t,n);if(!l){var s=p(i.list,t,n);if(s)for(var a=0;a<s.length&&!(l=e.needsWhitespace(s[a],t,r));a++);}return l&&l[r]||0},e.needsWhitespaceBefore=function(t,n){return e.needsWhitespace(t,n,"before")},e.needsWhitespaceAfter=function(t,n){return e.needsWhitespace(t,n,"after")},e.needsParens=function(e,t){if(!t)return!1;if(u.isNewExpression(t)&&t.callee===e){if(u.isCallExpression(e))return!0;var n=o(e,function(e){return u.isCallExpression(e)});if(n)return!0}return p(s,e,t)},e.needsParensNoLineTerminator=function(e,t){return t&&e.leadingComments&&e.leadingComments.length?u.isYieldExpression(t)||u.isAwaitExpression(t)?!0:u.isContinueStatement(t)||u.isBreakStatement(t)||u.isReturnStatement(t)||u.isThrowStatement(t)?!0:!1:!1},e}();t.exports=c,a(c,function(e,t){c.prototype[t]=function(){var e=new Array(arguments.length+2);e[0]=this.node,e[1]=this.parent;for(var n=0;n<e.length;n++)e[n+2]=arguments[n];return c[t].apply(null,e)}})},{"../../types":153,"./parentheses":34,"./whitespace":35,"lodash/collection/each":316,"lodash/collection/some":322}],34:[function(e,t,n){"use strict";function r(e,t){return y.isArrayTypeAnnotation(t)}function l(e,t){return y.isMemberExpression(t)&&t.object===e?!0:void 0}function i(e,t){return y.isExpressionStatement(t)?!0:y.isMemberExpression(t)&&t.object===e?!0:!1}function s(e,t){if((y.isCallExpression(t)||y.isNewExpression(t))&&t.callee===e)return!0;if(y.isUnaryLike(t))return!0;if(y.isMemberExpression(t)&&t.object===e)return!0;if(y.isBinary(t)){var n=t.operator,r=b[n],l=e.operator,i=b[l];if(r>i)return!0;if(r===i&&t.right===e)return!0}}function a(e,t){if("in"===e.operator){if(y.isVariableDeclarator(t))return!0;if(y.isFor(t))return!0}}function o(e,t){return y.isForStatement(t)?!1:y.isExpressionStatement(t)&&t.expression===e?!1:!0}function u(e,t){return y.isBinary(t)||y.isUnaryLike(t)||y.isCallExpression(t)||y.isMemberExpression(t)||y.isNewExpression(t)||y.isConditionalExpression(t)||y.isYieldExpression(t)}function p(e,t){return y.isExpressionStatement(t)}function c(e,t){return y.isMemberExpression(t)&&t.object===e}function d(e,t){return y.isExpressionStatement(t)?!0:y.isMemberExpression(t)&&t.object===e?!0:y.isCallExpression(t)&&t.callee===e?!0:void 0}function f(e,t){return y.isUnaryLike(t)?!0:y.isBinary(t)?!0:(y.isCallExpression(t)||y.isNewExpression(t))&&t.callee===e?!0:y.isConditionalExpression(t)&&t.test===e?!0:y.isMemberExpression(t)&&t.object===e?!0:!1}var h=function(e){return e&&e.__esModule?e:{"default":e}},m=function(e){return e&&e.__esModule?e["default"]:e};n.NullableTypeAnnotation=r,n.UpdateExpression=l,n.ObjectExpression=i,n.Binary=s,n.BinaryExpression=a,n.SequenceExpression=o,n.YieldExpression=u,n.ClassExpression=p,n.UnaryLike=c,n.FunctionExpression=d,n.ConditionalExpression=f,n.__esModule=!0;var g=m(e("lodash/collection/each")),y=h(e("../../types")),b={};g([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(e,t){g(e,function(e){b[e]=t})}),n.FunctionTypeAnnotation=r,n.AssignmentExpression=f},{"../../types":153,"lodash/collection/each":316}],35:[function(e,t,n){"use strict";function r(e){var t=void 0===arguments[1]?{}:arguments[1];if(c.isMemberExpression(e))r(e.object,t),e.computed&&r(e.property,t);else if(c.isBinary(e)||c.isAssignmentExpression(e))r(e.left,t),r(e.right,t);else if(c.isCallExpression(e))t.hasCall=!0,r(e.callee,t);else if(c.isFunction(e))t.hasFunction=!0;else if(c.isIdentifier(e)){var n=t;n.hasHelper||(n.hasHelper=l(e.callee))}return t}function l(e){return c.isMemberExpression(e)?l(e.object)||l(e.property):c.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:c.isCallExpression(e)?l(e.callee):c.isBinary(e)||c.isAssignmentExpression(e)?c.isIdentifier(e.left)&&l(e.left)||l(e.right):!1}function i(e){return c.isLiteral(e)||c.isObjectExpression(e)||c.isArrayExpression(e)||c.isIdentifier(e)||c.isMemberExpression(e)}var s=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e},o=a(e("lodash/lang/isBoolean")),u=a(e("lodash/collection/each")),p=a(e("lodash/collection/map")),c=s(e("../../types"));n.nodes={AssignmentExpression:function(e){var t=r(e.right);return t.hasCall&&t.hasHelper||t.hasFunction?{before:t.hasFunction,after:!0}:void 0},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){return c.isFunction(e.left)||c.isFunction(e.right)?{after:!0}:void 0},Literal:function(e){return"use strict"===e.value?{after:!0}:void 0},CallExpression:function(e){return c.isFunction(e.callee)||l(e)?{before:!0,after:!0}:void 0},VariableDeclaration:function(e){for(var t=0;t<e.declarations.length;t++){var n=e.declarations[t],s=l(n.id)&&!i(n.init);if(!s){var a=r(n.init);s=l(n.init)&&a.hasCall||a.hasFunction}if(s)return{before:!0,after:!0}}},IfStatement:function(e){return c.isBlockStatement(e.consequent)?{before:!0,after:!0}:void 0}},n.nodes.Property=n.nodes.SpreadProperty=function(e,t){return t.properties[0]===e?{before:!0}:void 0},n.list={VariableDeclaration:function(e){return p(e.declarations,"init")},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties}},u({Function:!0,Class:!0,Loop:!0,LabeledStatement:!0,SwitchStatement:!0,TryStatement:!0},function(e,t){o(e)&&(e={after:e,before:e}),u([t].concat(c.FLIPPED_ALIAS_KEYS[t]||[]),function(t){n.nodes[t]=function(){return e}})})},{"../../types":153,"lodash/collection/each":316,"lodash/collection/map":320,"lodash/lang/isBoolean":391}],36:[function(e,t){"use strict";var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(){n(this,e),this.line=1,this.column=0}return e.prototype.push=function(e){for(var t=0;t<e.length;t++)"\n"===e[t]?(this.line++,this.column=0):this.column++},e.prototype.unshift=function(e){for(var t=0;t<e.length;t++)"\n"===e[t]?this.line--:this.column--},e}();t.exports=r},{}],37:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("source-map")),s=n(e("../types")),a=function(){function e(t,n,r){l(this,e),this.position=t,this.opts=n,n.sourceMaps?(this.map=new i.SourceMapGenerator({file:n.sourceMapName,sourceRoot:n.sourceRoot}),this.map.setSourceContent(n.sourceFileName,r)):this.map=null}return e.prototype.get=function(){var e=this.map;return e?e.toJSON():e},e.prototype.mark=function(e,t){var n=e.loc;if(n){var r=this.map;if(r&&!s.isProgram(e)&&!s.isFile(e)){var l=this.position,i={line:l.line,column:l.column},a=n[t];r.addMapping({source:this.opts.sourceFileName,generated:i,original:a})}}},e}();t.exports=a},{"../types":153,"source-map":439}],38:[function(e,t){"use strict";function n(e,t,n){return e+=t,e>=n&&(e-=n),e}var r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("lodash/collection/sortBy")),s=function(){function e(t,n){l(this,e),this.tokens=i(t.concat(n),"start"),this.used={},this._lastFoundIndex=0}return e.prototype.getNewlinesBefore=function(e){for(var t,r,l,i=this.tokens,s=0;s<i.length;s++){var a=n(s,this._lastFoundIndex,this.tokens.length);if(l=i[a],e.start===l.start){t=i[a-1],r=l,this._lastFoundIndex=a;break}}return this.getNewlinesBetween(t,r)},e.prototype.getNewlinesAfter=function(e){for(var t,r,l,i=this.tokens,s=0;s<i.length;s++){var a=n(s,this._lastFoundIndex,this.tokens.length);if(l=i[a],e.end===l.end){t=l,r=i[a+1],this._lastFoundIndex=a;break}}if(r&&"eof"===r.type.label)return 1;var o=this.getNewlinesBetween(t,r);return"Line"!==e.type||o?o:1},e.prototype.getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var n=e?e.loc.end.line:1,r=t.loc.start.line,l=0,i=n;r>i;i++)"undefined"==typeof this.used[i]&&(this.used[i]=!0,l++);return l},e}();t.exports=s},{"lodash/collection/sortBy":323}],39:[function(e,t){"use strict";function n(e){var t=a.matchToToken(e);if("name"===t.type&&o.keyword.isReservedWordES6(t.value))return"keyword";if("punctuator"===t.type)switch(t.value){case"{":case"}":return"curly";case"(":case")":return"parens";case"[":case"]":return"square"}return t.type}function r(e){return e.replace(a,function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var l=n(t),i=p[l];return i?t[0].split(c).map(function(e){return i(e)}).join("\n"):t[0]})}var l=function(e){return e&&e.__esModule?e["default"]:e},i=l(e("line-numbers")),s=l(e("repeating")),a=l(e("js-tokens")),o=l(e("esutils")),u=l(e("chalk")),p={string:u.red,punctuator:u.bold,curly:u.green,parens:u.blue.bold,square:u.yellow,keyword:u.cyan,number:u.magenta,regex:u.magenta,comment:u.grey,invalid:u.inverse},c=/\r\n|[\n\r\u2028\u2029]/;t.exports=function(e,t,n){var l=void 0===arguments[3]?{}:arguments[3];n=Math.max(n,0),l.highlightCode&&u.supportsColor&&(e=r(e)),e=e.split(c);var a=Math.max(t-3,0),o=Math.min(e.length,t+3);return t||n||(a=0,o=e.length),i(e.slice(a,o),{start:a+1,before:" ",after:" | ",transform:function(e){e.number===t&&(n&&(e.line+="\n"+e.before+s(" ",e.width)+e.after+s(" ",n-1)+"^"),e.before=e.before.replace(/^./,">"))}}).join("\n")}},{chalk:200,esutils:300,"js-tokens":306,"line-numbers":308,repeating:435}],40:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../types"));t.exports=function(e,t,n){if(e&&"Program"===e.type)return r.file(e,t||[],n||[]);throw new Error("Not a valid ast?")}},{"../types":153}],41:[function(e,t){"use strict";t.exports=function(){return Object.create(null)}},{}],42:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=r(e("./normalize-ast")),i=r(e("estraverse")),s=r(e("./code-frame")),a=n(e("../../acorn"));t.exports=function(e,t,n){try{var r=[],o=[],u={allowImportExportEverywhere:e.looseModules,allowReturnOutsideFunction:e.looseModules,ecmaVersion:6,strictMode:e.strictMode,sourceType:e.sourceType,onComment:r,locations:!0,features:e.features||{},plugins:e.plugins||{},onToken:o,ranges:!0};e.nonStandard&&(u.plugins.jsx=!0,u.plugins.flow=!0);var p=a.parse(t,u);return i.attachComments(p,r,o),p=l(p,r,o),n?n(p):p}catch(c){if(!c._babel){c._babel=!0;var d=c.message=""+e.filename+": "+c.message,f=c.loc;if(f&&(c.codeFrame=s(t,f.line,f.column+1,e),d+="\n"+c.codeFrame),c.stack){var h=c.stack.replace(c.message,d);try{c.stack=h}catch(m){}}}throw c}}},{"../../acorn":5,"./code-frame":39,"./normalize-ast":40,estraverse:296}],43:[function(e,t,n){"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];var i=a[e];if(!i)throw new ReferenceError("Unknown message "+JSON.stringify(e));return n=l(n),i.replace(/\$(\d+)/g,function(e,t){return n[--t]})}function l(e){return e.map(function(e){if(null!=e&&e.inspect)return e.inspect();try{return JSON.stringify(e)||e+""}catch(t){return s.inspect(e)}})}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.get=r,n.parseArgs=l,n.__esModule=!0;var s=i(e("util")),a={tailCallReassignmentDeopt:"Function reference has been reassigned so it's probably be dereferenced so we can't optimise this with confidence",JSXNamespacedTags:"Namespace tags are not supported. ReactJSX is not XML.",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",classesIllegalConstructorKind:"Illegal kind for constructor method",scopeDuplicateDeclaration:"Duplicate declaration $1",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",settersInvalidParamLength:"Setters must have exactly one parameter",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemeberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",modulesIllegalExportName:"Illegal export $1",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",evalInStrictMode:"eval is not allowed in strict mode",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",unsupportedOutputType:"Unsupported output type $1",illegalMethodName:"Illegal method name $1"}; n.MESSAGES=a},{util:199}],44:[function(e){"use strict";var t=function(e){return e&&e.__esModule?e:{"default":e}},n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("estraverse")),l=n(e("lodash/object/extend")),i=n(e("ast-types")),s=t(e("./types"));l(r.VisitorKeys,s.VISITOR_KEYS);var a=i.Type.def,o=i.Type.or;a("File").bases("Node").build("program").field("program",a("Program")),a("AssignmentPattern").bases("Pattern").build("left","right").field("left",a("Pattern")).field("right",a("Expression")),a("RestElement").bases("Pattern").build("argument").field("argument",a("expression")),a("DoExpression").bases("Expression").build("body").field("body",[a("Statement")]),a("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",o(a("Declaration"),a("Expression"),null)),a("ExportNamedDeclaration").bases("Declaration").build("declaration").field("declaration",o(a("Declaration"),a("Expression"),null)).field("specifiers",[o(a("ExportSpecifier"))]).field("source",o(a("ModuleSpecifier"),null)),i.finalize()},{"./types":153,"ast-types":171,estraverse:296,"lodash/object/extend":404}],45:[function(e,t){"use strict";function n(e){if(!s.existsSync)return!1;var t=a[e];return null!=t?t:a[e]=s.existsSync(e)}var r=function(e){return e&&e.__esModule?e["default"]:e},l=r(e("lodash/object/merge")),i=r(e("path")),s=r(e("fs")),a={},o={};t.exports=function(e){function t(e,a){var u=i.join(e,a);if(n(u)){var p,c=s.readFileSync(u,"utf8");try{var d,f;d=o,f=c,!d[f]&&(d[f]=JSON.parse(c)),p=d[f]}catch(h){throw h.message=""+u+": "+h.message,h}if(p.breakConfig)return;l(r,p,function(e,t){return Array.isArray(e)?e.concat(t):void 0})}var m=i.dirname(e);m!==e&&t(m,a)}var r=void 0===arguments[1]?{}:arguments[1],a=".babelrc";return t(e,a),r}},{fs:172,"lodash/object/merge":408,path:182}],46:[function(e,t){"use strict";function n(e,t,n){w(e,function(e){e.shouldRun||e.ran||e.checkNode(t,n)})}var r=function(e){return e&&e.__esModule?e:{"default":e}},l=function(e){return e&&e.__esModule?e["default"]:e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){for(var n,r=[],l=e[Symbol.iterator]();!(n=l.next()).done&&(r.push(n.value),!t||r.length!==t););return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=l(e("convert-source-map")),o=r(e("./option-parsers")),u=l(e("shebang-regex")),p=l(e("../../traversal/path")),c=l(e("lodash/lang/isFunction")),d=l(e("path-is-absolute")),f=l(e("../../tools/resolve-rc")),h=l(e("source-map")),m=l(e("./../index")),g=l(e("../../generation")),y=l(e("lodash/object/defaults")),b=l(e("lodash/collection/includes")),v=(l(e("../../traversal")),l(e("lodash/object/assign"))),x=l(e("./logger")),E=l(e("../../helpers/parse")),_=(l(e("../../traversal/scope")),l(e("slash"))),S=r(e("../../util")),I=l(e("path")),w=l(e("lodash/collection/each")),k=r(e("../../types")),A={enter:function(e,t,r,l){n(l.stack,e,r)}},C=function(){function t(){var e=void 0===arguments[0]?{}:arguments[0];s(this,t),this.dynamicImportedNoDefault=[],this.dynamicImportIds={},this.dynamicImported=[],this.dynamicImports=[],this.usedHelpers={},this.dynamicData={},this.data={},this.lastStatements=[],this.log=new x(this,e.filename||"unknown"),this.opts=this.normalizeOptions(e),this.ast={},this.buildTransformers()}return t.helpers=["inherits","defaults","create-class","create-decorated-class","tagged-template-literal","tagged-template-literal-loose","interop-require","to-array","to-consumable-array","sliced-to-array","sliced-to-array-loose","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-require-wildcard","typeof","extends","get","set","class-call-check","object-destructuring-empty","temporal-undefined","temporal-assert-defined","self-global","default-props"],t.options=e("./options"),t.prototype.normalizeOptions=function(e){e=v({},e),e.filename&&d(e.filename)&&(e=f(e.filename,e));for(var n in e)if("_"!==n[0]){var r=t.options[n];r||this.log.error("Unknown option: "+n,ReferenceError)}for(var n in t.options){var r=t.options[n],l=e[n];if(l||!r.optional){if(l&&r.deprecated)throw new Error("Deprecated option "+n+": "+r.deprecated);null==l&&(l=r["default"]||l);var i=o[r.type];if(i&&(l=i(n,l)),r.alias){var s=e,a=r.alias;s[a]||(s[a]=l)}else e[n]=l}}return e.inputSourceMap&&(e.sourceMaps=!0),e.filename=_(e.filename),e.sourceRoot&&(e.sourceRoot=_(e.sourceRoot)),e.moduleId&&(e.moduleIds=!0),e.basename=I.basename(e.filename,I.extname(e.filename)),e.ignore=S.arrayify(e.ignore,S.regexify),e.only=S.arrayify(e.only,S.regexify),y(e,{moduleRoot:e.sourceRoot}),y(e,{sourceRoot:e.moduleRoot}),y(e,{filenameRelative:e.filename}),y(e,{sourceFileName:e.filenameRelative,sourceMapName:e.filenameRelative}),e.externalHelpers&&this.set("helpersNamespace",k.identifier("babelHelpers")),e},t.prototype.isLoose=function(e){return b(this.opts.loose,e)},t.prototype.buildTransformers=function(){var e=this,t=this.transformers={},n=[],r=[];w(m.transformers,function(l,i){var s=t[i]=l.buildPass(e);s.canTransform()&&(r.push(s),l.metadata.secondPass&&n.push(s),l.manipulateOptions&&l.manipulateOptions(e.opts,e))});for(var l=[],i=[],s=0;s<e.opts.plugins.length;s++)this.addPlugin(e.opts.plugins[s],l,i);r=l.concat(r,i),this.transformerStack=r.concat(n)},t.prototype.getModuleFormatter=function(t){var n=c(t)?t:m.moduleFormatters[t];if(!n){var r=S.resolveRelative(t);r&&(n=e(r))}if(!n)throw new ReferenceError("Unknown module formatter type "+JSON.stringify(t));return new n(this)},t.prototype.addPlugin=function(t,n,r){var l,s="before";if(!t)throw new TypeError("Ilegal kind "+typeof t+" for plugin name "+JSON.stringify(t));if("string"==typeof t){var a=t.split(":"),o=i(a,2);t=o[0];var u=o[1];s=void 0===u?"before":u;var p=S.resolveRelative(t)||S.resolveRelative("babel-plugin-"+t);if(!p)throw new ReferenceError("Unknown plugin "+JSON.stringify(t));l=e(p)}else l=t;if("before"!==s&&"after"!==s)throw new TypeError("Plugin "+JSON.stringify(t)+" has an illegal position of "+JSON.stringify(s));var c=l.key;if(this.transformers[c])throw new ReferenceError("The key for plugin "+JSON.stringify(t)+" of "+c+" collides with an existing plugin");if(!l.buildPass||"Transformer"!==l.constructor.name)throw new TypeError("Plugin "+JSON.stringify(t)+" didn't export default a Transformer instance");var d=this.transformers[c]=l.buildPass(this);if(d.canTransform()){var f=n;"after"===s&&(f=r),f.push(d)}},t.prototype.parseInputSourceMap=function(e){var t=this.opts;if(t.inputSourceMap!==!1){var n=a.fromSource(e);n&&(t.inputSourceMap=n.toObject(),e=a.removeComments(e))}return e},t.prototype.parseShebang=function(e){var t=u.exec(e);return t&&(this.shebang=t[0],e=e.replace(u,"")),e},t.prototype.set=function(e,t){return this.data[e]=t},t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(e){var t=this.data[e];if(t)return t;var n=this.dynamicData[e];return n?this.set(e,n()):void 0},t.prototype.resolveModuleSource=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e){var t=this.opts.resolveModuleSource;return t&&(e=t(e,this.opts.filename)),e}),t.prototype.addImport=function(e,t,n){t||(t=e);var r=this.dynamicImportIds[t];if(!r){e=this.resolveModuleSource(e),r=this.dynamicImportIds[t]=this.scope.generateUidIdentifier(t);var l=[k.importDefaultSpecifier(r)],i=k.importDeclaration(l,k.literal(e));i._blockHoist=3,this.dynamicImported.push(i),n&&this.dynamicImportedNoDefault.push(i),this.transformers["es6.modules"].canTransform()?(this.moduleFormatter.importSpecifier(l[0],i,this.dynamicImports),this.moduleFormatter.hasLocalImports=!0):this.dynamicImports.push(i)}return r},t.prototype.isConsequenceExpressionStatement=function(e){return k.isExpressionStatement(e)&&this.lastStatements.indexOf(e)>=0},t.prototype.attachAuxiliaryComment=function(e){var t=this.opts.auxiliaryComment;if(t){var n=e;n.leadingComments||(n.leadingComments=[]),e.leadingComments.push({type:"Line",value:" "+t})}return e},t.prototype.addHelper=function(e){if(!b(t.helpers,e))throw new ReferenceError("Unknown helper "+e);var n=this.ast.program,r=n._declarations&&n._declarations[e];if(r)return r.id;this.usedHelpers[e]=!0;var l=this.get("helperGenerator"),i=this.get("helpersNamespace");if(l)return l(e);if(i){var s=k.identifier(k.toIdentifier(e));return k.memberExpression(i,s)}var a=S.template("helper-"+e);a._compact=!0;var o=this.scope.generateUidIdentifier(e);return this.scope.push({key:e,id:o,init:a}),o},t.prototype.errorWithNode=function(e,t){var n=void 0===arguments[2]?SyntaxError:arguments[2],r=e.loc.start,l=new n("Line "+r.line+": "+t);return l.loc=r,l},t.prototype.addCode=function(e){return e=(e||"")+"",e=this.parseInputSourceMap(e),this.code=e,this.parseShebang(e)},t.prototype.shouldIgnore=function(){var e=this.opts,t=e.filename,n=e.ignore,r=e.only;if(r.length){for(var l=0;l<r.length;l++)if(r[l].test(t))return!1;return!0}if(n.length)for(var l=0;l<n.length;l++)if(n[l].test(t))return!0;return!1},t.prototype.parse=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e){var t=this;if(this.shouldIgnore())return{metadata:{},code:e,map:null,ast:null};e=this.addCode(e);var n=this.opts,r={highlightCode:n.highlightCode,nonStandard:n.nonStandard,filename:n.filename,plugins:{}},l=r.features={};for(var i in this.transformers){var s=this.transformers[i];l[i]=s.canTransform()}return r.looseModules=this.isLoose("es6.modules"),r.strictMode=l.strict,r.sourceType="module",E(r,e,function(e){return t.transform(e),t.generate()})}),t.prototype.setAst=function(e){this.path=p.get(null,null,e,e,"program",this),this.scope=this.path.scope,this.ast=e,this.path.traverse({enter:function(e,t,n){if(this.isScope())for(var r in n.bindings)n.bindings[r].setTypeAnnotation()}})},t.prototype.transform=function(e){this.log.debug(),this.setAst(e),this.lastStatements=k.getLastStatements(e.program);var t=this.moduleFormatter=this.getModuleFormatter(this.opts.modules);t.init&&this.transformers["es6.modules"].canTransform()&&t.init(),this.checkNode(e),this.call("pre"),w(this.transformerStack,function(e){e.transform()}),this.call("post")},t.prototype.call=function(e){for(var t=this.transformerStack,n=0;n<t.length;n++){var r=t[n].transformer,l=r[e];l&&l(this)}},t.prototype.checkNode=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.checkNode(e[r],t);else{var l=this.transformerStack;t||(t=this.scope),n(l,e,t),t.traverse(e,A,{stack:l})}}),t.prototype.mergeSourceMap=function(e){var t=this.opts,n=t.inputSourceMap;if(n){e.sources[0]=n.file;var r=new h.SourceMapConsumer(n),l=new h.SourceMapConsumer(e),i=h.SourceMapGenerator.fromSourceMap(l);i.applySourceMap(r);var s=i.toJSON();return s.sources=n.sources,s.file=n.file,s}return e},t.prototype.generate=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(){var e=this.opts,t=this.ast,n={metadata:{},code:"",map:null,ast:null};if(this.opts.metadataUsedHelpers&&(n.metadata.usedHelpers=Object.keys(this.usedHelpers)),e.ast&&(n.ast=t),!e.code)return n;var r=g(t,e,this.code);return n.code=r.code,n.map=r.map,this.shebang&&(n.code=""+this.shebang+"\n"+n.code),n.map&&(n.map=this.mergeSourceMap(n.map)),("inline"===e.sourceMaps||"both"===e.sourceMaps)&&(n.code+="\n"+a.fromObject(n.map).toComment()),"inline"===e.sourceMaps&&(n.map=null),n}),t}();t.exports=C},{"../../generation":32,"../../helpers/parse":42,"../../tools/resolve-rc":45,"../../traversal":144,"../../traversal/path":148,"../../traversal/scope":149,"../../types":153,"../../util":157,"./../index":63,"./logger":47,"./option-parsers":48,"./options":49,"convert-source-map":208,"lodash/collection/each":316,"lodash/collection/includes":319,"lodash/lang/isFunction":393,"lodash/object/assign":402,"lodash/object/defaults":403,path:182,"path-is-absolute":418,"shebang-regex":437,slash:438,"source-map":439}],47:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("../../util")),i=function(){function e(t,n){r(this,e),this.filename=n,this.file=t}return e.prototype._buildMessage=function(e){var t=this.filename;return e&&(t+=": "+e),t},e.prototype.error=function(e){var t=void 0===arguments[1]?Error:arguments[1];throw new t(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts.suppressDeprecationMessages||console.error(e)},e.prototype.debug=function(e){l.debug(this._buildMessage(e))},e.prototype.deopt=function(e,t){l.debug(this._buildMessage(t))},e}();t.exports=i},{"../../util":157}],48:[function(e,t,n){"use strict";function r(e,t){return t=c.arrayify(t),(t.indexOf("all")>=0||t.indexOf(!0)>=0)&&(t=Object.keys(p.transformers)),p._ensureTransformerNames(e,t)}function l(e,t){return+t}function i(e,t){return!!t}function s(e,t){return c.booleanify(t)}function a(e,t){return c.list(t)}var o=function(e){return e&&e.__esModule?e:{"default":e}},u=function(e){return e&&e.__esModule?e["default"]:e};n.transformerList=r,n.number=l,n.boolean=i,n.booleanString=s,n.list=a,n.__esModule=!0;var p=u(e("./../index")),c=o(e("../../util"))},{"../../util":157,"./../index":63}],49:[function(e,t){t.exports={filename:{type:"string",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc","default":"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},moduleId:{description:"specify a custom name for module ids",type:"string"},nonStandard:{type:"boolean","default":!0,description:"enable support for JSX and Flow"},experimental:{deprecated:"use `--stage 0`/`{ stage: 0 }` instead"},highlightCode:{description:"ANSI syntax highlight code frames",type:"boolean","default":!0},suppressDeprecationMessages:{type:"boolean","default":!1,hidden:!0},resolveModuleSource:{hidden:!0},stage:{description:"ECMAScript proposal stage version to allow [0-4]",shorthand:"e",type:"number","default":2},blacklist:{type:"transformerList",description:"blacklist of transformers to NOT use",shorthand:"b"},whitelist:{type:"transformerList",optional:!0,description:"whitelist of transformers to ONLY use",shorthand:"l"},optional:{type:"transformerList",description:"list of optional transformers to enable"},modules:{type:"string",description:"module formatter type to use [common]","default":"common",shorthand:"m"},moduleIds:{type:"boolean","default":!1,shorthand:"M",description:"insert an explicit id for modules"},loose:{type:"transformerList",description:"list of transformers to enable loose mode ON",shorthand:"L"},jsxPragma:{type:"string",description:"custom pragma to use with JSX (same functionality as @jsx comments)","default":"React.createElement",shorthand:"P"},plugins:{type:"list",description:""},ignore:{type:"list",description:"list of glob paths to **not** compile"},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,"default":!0,type:"boolean"},ast:{hidden:!0,"default":!0,type:"boolean"},comments:{type:"boolean","default":!0,description:"output comments in generated output"},compact:{type:"booleanString","default":"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},keepModuleIdExtensions:{type:"boolean",description:"keep extensions when generating module ids","default":!1,shorthand:"k"},auxiliaryComment:{type:"string","default":"",shorthand:"a",description:"attach a comment before all helper declarations and auxiliary code"},externalHelpers:{type:"string","default":!1,shorthand:"r",description:"uses a reference to `babelHelpers` instead of placing helpers at the top of your code."},metadataUsedHelpers:{type:"boolean","default":!1,hidden:!0},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]","default":!1,shorthand:"s"},sourceMapName:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"string",description:"the root from which all sources are relative"},moduleRoot:{type:"string",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"}}},{}],50:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=r(e("./explode-assignable-expression")),i=n(e("../../types"));t.exports=function(e,t){var n=function(e){return e.operator===t.operator+"="},r=function(e,t){return i.assignmentExpression("=",e,t)};e.ExpressionStatement=function(e,s,a,o){if(!o.isConsequenceExpressionStatement(e)){var u=e.expression;if(n(u)){var p=[],c=l(u.left,p,o,a,!0);return p.push(i.expressionStatement(r(c.ref,t.build(c.uid,u.right)))),p}}},e.AssignmentExpression=function(e,i,s,a){if(n(e)){var o=[],u=l(e.left,o,a,s);return o.push(r(u.ref,t.build(u.uid,e.right))),o}},e.BinaryExpression=function(e){return e.operator===t.operator?t.build(e.left,e.right):void 0}}},{"../../types":153,"./explode-assignable-expression":55}],51:[function(e,t){"use strict";function n(e,t){var r=e.blocks.shift();if(r){var i=n(e,t);return i||(i=t(),e.filter&&(i=l.ifStatement(e.filter,l.blockStatement([i])))),l.forOfStatement(l.variableDeclaration("let",[l.variableDeclarator(r.left)]),r.right,l.blockStatement([i]))}}var r=function(e){return e&&e.__esModule?e:{"default":e}};t.exports=n;var l=r(e("../../types"))},{"../../types":153}],52:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=r(e("lodash/lang/isString")),i=n(e("../../messages")),s=r(e("esutils")),a=n(e("./react")),o=n(e("../../types"));t.exports=function(e,t){e.check=function(e){return o.isJSX(e)?!0:a.isCreateClass(e)?!0:!1},e.JSXIdentifier=function(e,t){return"this"===e.name&&o.isReferenced(e,t)?o.thisExpression():s.keyword.isIdentifierName(e.name)?void(e.type="Identifier"):o.literal(e.name)},e.JSXNamespacedName=function(){throw this.errorWithNode(i.get("JSXNamespacedTags"))},e.JSXMemberExpression={exit:function(e){e.computed=o.isLiteral(e.property),e.type="MemberExpression"}},e.JSXExpressionContainer=function(e){return e.expression},e.JSXAttribute={enter:function(e){var t=e.value;o.isLiteral(t)&&l(t.value)&&(t.value=t.value.replace(/\n\s+/g," "))},exit:function(e){var t=e.value||o.literal(!0);return o.inherits(o.property("init",e.name,t),e)}},e.JSXOpeningElement={exit:function(e,r,l,i){var s,a=e.name,u=[];o.isIdentifier(a)?s=a.name:o.isLiteral(a)&&(s=a.value);var p={tagExpr:a,tagName:s,args:u};t.pre&&t.pre(p,i);var c=e.attributes;return c=c.length?n(c,i):o.literal(null),u.push(c),t.post&&t.post(p,i),p.call||o.callExpression(p.callee,u)}};var n=function(e,t){for(var n=[],r=[],l=function(){n.length&&(r.push(o.objectExpression(n)),n=[])};e.length;){var i=e.shift();o.isJSXSpreadAttribute(i)?(l(),r.push(i.argument)):n.push(i)}return l(),1===r.length?e=r[0]:(o.isObjectExpression(r[0])||r.unshift(o.objectExpression([])),e=o.callExpression(t.addHelper("extends"),r)),e};e.JSXElement={enter:function(e){e.children=a.buildChildren(e)},exit:function(e){var t=e.openingElement;return t.arguments=t.arguments.concat(e.children),t.arguments.length>=3&&(t._prettyCall=!0),o.inherits(t,e)}};var r=function(e,t){for(var n=t.arguments[0].properties,r=!0,l=0;l<n.length;l++){var i=n[l];if(o.isIdentifier(i.key,{name:"displayName"})){r=!1;break}}r&&n.unshift(o.property("init",o.identifier("displayName"),o.literal(e)))};e.ExportDefaultDeclaration=function(e,t,n,l){a.isCreateClass(e.declaration)&&r(l.opts.basename,e.declaration)},e.AssignmentExpression=e.Property=e.VariableDeclarator=function(e){var t,n;o.isAssignmentExpression(e)?(t=e.left,n=e.right):o.isProperty(e)?(t=e.key,n=e.value):o.isVariableDeclarator(e)&&(t=e.id,n=e.init),o.isMemberExpression(t)&&(t=t.property),o.isIdentifier(t)&&a.isCreateClass(n)&&r(t.name,n)}}},{"../../messages":43,"../../types":153,"./react":58,esutils:300,"lodash/lang/isString":399}],53:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../../types"));t.exports=function(e){var t=r.functionExpression(null,[],e.body,e.generator,e.async);t.shadow=!0;var n=r.callExpression(t,[]);return e.generator&&(n=r.yieldExpression(n,!0)),r.returnStatement(n)}},{"../../types":153}],54:[function(e,t,n){"use strict";function r(e,t,n,r,l){var i=d.toKeyAlias({computed:r},t),s={};c(e,i)&&(s=e[i]),e[i]=s,s._key=t,r&&(s._computed=!0),s[n]=l}function l(e){for(var t in e)if(e[t]._computed)return!0;return!1}function i(e){for(var t=d.arrayExpression([]),n=0;n<e.properties.length;n++){var r=e.properties[n],l=r.value;l.properties.unshift(d.property("init",d.identifier("key"),d.toComputedKey(r))),t.elements.push(l)}return t}function s(e){var t=d.objectExpression([]);return p(e,function(e){var n=d.objectExpression([]),r=d.property("init",e._key,n,e._computed);p(e,function(e,t){if("_"!==t[0]){var r=e;(d.isMethodDefinition(e)||d.isClassProperty(e))&&(e=e.value);var l=d.property("init",d.identifier(t),e);d.inheritsComments(l,r),d.removeComments(r),n.properties.push(l)}}),t.properties.push(r)}),t}function a(e){return p(e,function(e){e.value&&(e.writable=d.literal(!0)),e.configurable=d.literal(!0),e.enumerable=d.literal(!0)}),s(e)}var o=function(e){return e&&e.__esModule?e:{"default":e}},u=function(e){return e&&e.__esModule?e["default"]:e};n.push=r,n.hasComputed=l,n.toComputedObjectFromClass=i,n.toClassObject=s,n.toDefineObject=a,n.__esModule=!0;var p=(u(e("lodash/lang/cloneDeep")),u(e("../../traversal")),u(e("lodash/collection/each"))),c=u(e("lodash/object/has")),d=o(e("../../types"))},{"../../traversal":144,"../../types":153,"lodash/collection/each":316,"lodash/lang/cloneDeep":388,"lodash/object/has":405}],55:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../../types")),l=function(e,t,n,l){var i;if(r.isIdentifier(e)){if(l.hasBinding(e.name))return e;i=e}else{if(!r.isMemberExpression(e))throw new Error("We can't explode this node type "+e.type);if(i=e.object,r.isIdentifier(i)&&l.hasGlobal(i.name))return i}var s=l.generateUidBasedOnNode(i);return t.push(r.variableDeclaration("var",[r.variableDeclarator(s,i)])),s},i=function(e,t,n,l){var i=e.property,s=r.toComputedKey(e,i);if(r.isLiteral(s))return s;var a=l.generateUidBasedOnNode(i);return t.push(r.variableDeclaration("var",[r.variableDeclarator(a,i)])),a};t.exports=function(e,t,n,s,a){var o;o=r.isIdentifier(e)&&a?e:l(e,t,n,s);var u,p;if(r.isIdentifier(e))u=e,p=o;else{var c=i(e,t,n,s),d=e.computed||r.isLiteral(c);p=u=r.memberExpression(o,c,d)}return{uid:p,ref:u}}},{"../../types":153}],56:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../../types"));t.exports=function(e){for(var t=0,n=0;n<e.params.length;n++)r.isAssignmentPattern(e.params[n])||(t=n+1);return t}},{"../../types":153}],57:[function(e,t,n){"use strict";function r(e,t,n){var r=f(e,t.name,n);return d(r,e,t,n)}function l(e,t,n){var r=p.toComputedKey(e,e.key);if(!p.isLiteral(r))return e;var l=p.toIdentifier(r.value),i=p.identifier(l),s=e.value,a=f(s,l,n);e.value=d(a,s,i,n)}function i(e,t,n){if(e.id)return e;var r;if(!p.isProperty(t)||"init"!==t.kind||t.computed&&!p.isLiteral(t.key)){if(!p.isVariableDeclarator(t))return e;r=t.id}else r=t.key;var l;if(p.isLiteral(r))l=r.value;else{if(!p.isIdentifier(r))return;l=r.name}l=p.toIdentifier(l),r=p.identifier(l);var i=f(e,l,n);return d(i,e,r,n)}var s=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e};n.custom=r,n.property=l,n.bare=i,n.__esModule=!0;var o=a(e("./get-function-arity")),u=s(e("../../util")),p=s(e("../../types")),c={enter:function(e,t,n,r){if(this.isReferencedIdentifier({name:r.name})){var l=n.getBindingIdentifier(r.name);l===r.outerDeclar&&(r.selfReference=!0,this.stop())}}},d=function(e,t,n,r){if(e.selfReference){var l="property-method-assignment-wrapper";t.generator&&(l+="-generator");for(var i=u.template(l,{FUNCTION:t,FUNCTION_ID:n,FUNCTION_KEY:r.generateUidIdentifier(n.name)}),s=i.callee.body.body[0].params,a=0,p=o(t);p>a;a++)s.push(r.generateUidIdentifier("x"));return i}return t.id=n,t},f=function(e,t,n){var r={selfAssignment:!1,selfReference:!1,outerDeclar:n.getBindingIdentifier(t),references:[],name:t},l=n.getOwnBindingInfo(t);return l?"param"===l.kind&&(r.selfReference=!0):n.traverse(e,c,r),r}},{"../../types":153,"../../util":157,"./get-function-arity":56}],58:[function(e,t,n){"use strict";function r(e){if(!e||!u.isCallExpression(e))return!1;if(!p(e.callee))return!1;var t=e.arguments;if(1!==t.length)return!1;var n=t[0];return u.isObjectExpression(n)?!0:!1}function l(e){return e&&/^[a-z]|\-/.test(e)}function i(e,t){var n,r=e.value.split(/\r\n|\n|\r/),l=0;for(n=0;n<r.length;n++)r[n].match(/[^ \t]/)&&(l=n);var i="";for(n=0;n<r.length;n++){var s=r[n],a=0===n,o=n===r.length-1,p=n===l,c=s.replace(/\t/g," ");a||(c=c.replace(/^[ ]+/,"")),o||(c=c.replace(/[ ]+$/,"")),c&&(p||(c+=" "),i+=c)}i&&t.push(u.literal(i))}function s(e){for(var t=[],n=0;n<e.children.length;n++){var r=e.children[n];u.isLiteral(r)&&"string"==typeof r.value?i(r,t):(u.isJSXExpressionContainer(r)&&(r=r.expression),u.isJSXEmptyExpression(r)||t.push(r))}return t}var a=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e){return e&&e.__esModule?e["default"]:e};n.isCreateClass=r,n.isCompatTag=l,n.buildChildren=s,n.__esModule=!0;var u=(o(e("lodash/lang/isString")),a(e("../../types"))),p=u.buildMatchMemberExpression("React.createClass"),c=u.buildMatchMemberExpression("React.Component");n.isReactComponent=c},{"../../types":153,"lodash/lang/isString":399}],59:[function(e,t,n){"use strict";function r(e,t){return o.isLiteral(e)&&e.regex&&e.regex.flags.indexOf(t)>=0}function l(e,t){var n=e.regex.flags.split("");e.regex.flags.indexOf(t)<0||(a(n,t),e.regex.flags=n.join(""))}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};n.is=r,n.pullFlag=l,n.__esModule=!0;var a=s(e("lodash/array/pull")),o=i(e("../../types"))},{"../../types":153,"lodash/array/pull":313}],60:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../../types")),l={enter:function(e){r.isFunction(e)&&this.skip(),r.isAwaitExpression(e)&&(e.type="YieldExpression",e.all&&(e.all=!1,e.argument=r.callExpression(r.memberExpression(r.identifier("Promise"),r.identifier("all")),[e.argument])))}},i={enter:function(e,t,n,l){var i=l.id.name;if(r.isReferencedIdentifier(e,t,{name:i})&&n.bindingIdentifierEquals(i,l.id)){var s;return s=l,!s.ref&&(s.ref=n.generateUidIdentifier(i)),s.ref}}};t.exports=function(e,t,n){e.async=!1,e.generator=!0,n.traverse(e,l,u);var s=r.callExpression(t,[e]),a=e.id;if(e.id=null,r.isFunctionDeclaration(e)){var o=r.variableDeclaration("let",[r.variableDeclarator(a,s)]);return o._blockHoist=!0,o}if(a){var u={id:a};if(n.traverse(e,i,u),u.ref)return n.parent.push({id:u.ref}),r.assignmentExpression("=",u.ref,s)}return s}},{"../../types":153}],61:[function(e,t){"use strict";function n(e,t){return o.isSuper(e)?o.isMemberExpression(t,{computed:!1})?!1:o.isCallExpression(t,{callee:e})?!1:!0:!1}function r(e){return o.isMemberExpression(e)&&o.isSuper(e.object)}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=l(e("../../messages")),o=l(e("../../types")),u={enter:function(e,t,n,r){var l=r.topLevel,i=r.self;if(o.isFunction(e)&&!o.isArrowFunctionExpression(e))return i.traverseLevel(this,!1),this.skip();if(o.isProperty(e,{method:!0})||o.isMethodDefinition(e))return this.skip();var s=l?o.thisExpression:i.getThisReference.bind(i),a=i.specHandle;i.isLoose&&(a=i.looseHandle);var u=a.call(i,this,s);return u&&(this.hasSuper=!0),u!==!0?u:void 0}},p=function(){function e(t){var n=void 0===arguments[1]?!1:arguments[1];s(this,e),this.topLevelThisReference=t.topLevelThisReference,this.methodPath=t.methodPath,this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=n,this.isLoose=t.isLoose,this.scope=t.scope,this.file=t.file,this.opts=t}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,n,r){return o.callExpression(this.file.addHelper("set"),[o.callExpression(o.memberExpression(o.identifier("Object"),o.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():o.memberExpression(this.getObjectRef(),o.identifier("prototype"))]),n?e:o.literal(e.name),t,r])},e.prototype.getSuperProperty=function(e,t,n){return o.callExpression(this.file.addHelper("get"),[o.callExpression(o.memberExpression(o.identifier("Object"),o.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():o.memberExpression(this.getObjectRef(),o.identifier("prototype"))]),t?e:o.literal(e.name),n])},e.prototype.replace=function(){this.traverseLevel(this.methodPath.get("value"),!0)},e.prototype.traverseLevel=function(e,t){var n={self:this,topLevel:t};e.traverse(u,n)},e.prototype.getThisReference=function(){if(this.topLevelThisReference)return this.topLevelThisReference;var e=this.topLevelThisReference=this.scope.generateUidIdentifier("this");return this.methodNode.value.body.body.unshift(o.variableDeclaration("var",[o.variableDeclarator(this.topLevelThisReference,o.thisExpression())])),e},e.prototype.getLooseSuperProperty=function(e,t){var n=this.methodNode,r=n.key,l=this.superRef||o.identifier("Function");return t.property===e?void 0:o.isCallExpression(t,{callee:e})?(t.arguments.unshift(o.thisExpression()),"constructor"===r.name?o.memberExpression(l,o.identifier("call")):(e=l,n["static"]||(e=o.memberExpression(e,o.identifier("prototype"))),e=o.memberExpression(e,r,n.computed),o.memberExpression(e,o.identifier("call")))):o.isMemberExpression(t)&&!n["static"]?o.memberExpression(l,o.identifier("prototype")):l},e.prototype.looseHandle=function(e,t){var n=e.node;if(e.isSuper())return this.getLooseSuperProperty(n,e.parent);if(e.isCallExpression()){var r=n.callee;if(!o.isMemberExpression(r))return;if(!o.isSuper(r.object))return;return o.appendToMemberExpression(r,o.identifier("call")),n.arguments.unshift(t()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,n,r){return"="===n.operator?this.setSuperProperty(n.left.property,n.right,n.left.computed,r()):(e||(e=t.scope.generateUidIdentifier("ref")),[o.variableDeclaration("var",[o.variableDeclarator(e,n.left)]),o.expressionStatement(o.assignmentExpression("=",n.left,o.binaryExpression(n.operator[0],e,n.right)))])},e.prototype.specHandle=function(e,t){var l,s,u,p,c=this.methodNode,d=e.parent,f=e.node;if(n(f,d))throw e.errorWithNode(a.get("classesIllegalBareSuper"));if(o.isCallExpression(f)){var h=f.callee;if(o.isSuper(h)){if(l=c.key,s=c.computed,u=f.arguments,"constructor"!==c.key.name||!this.inClass){var m=c.key.name||"METHOD_NAME";throw this.file.errorWithNode(f,a.get("classesIllegalSuperCall",m))}}else r(h)&&(l=h.property,s=h.computed,u=f.arguments)}else if(o.isMemberExpression(f)&&o.isSuper(f.object))l=f.property,s=f.computed;else{if(o.isUpdateExpression(f)&&r(f.argument)){var g=o.binaryExpression(f.operator[0],f.argument,o.literal(1));if(f.prefix)return this.specHandleAssignmentExpression(null,e,g,t);var y=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(y,e,g,t).concat(o.expressionStatement(y))}if(o.isAssignmentExpression(f)&&r(f.left))return this.specHandleAssignmentExpression(null,e,f,t) }if(l){p=t();var b=this.getSuperProperty(l,s,p);return u?1===u.length&&o.isSpreadElement(u[0])?o.callExpression(o.memberExpression(b,o.identifier("apply")),[p,u[0].argument]):o.callExpression(o.memberExpression(b,o.identifier("call")),[p].concat(i(u))):b}},e}();t.exports=p},{"../../messages":43,"../../types":153}],62:[function(e,t,n){"use strict";function r(e){var t=e.body[0];return s.isExpressionStatement(t)&&s.isLiteral(t.expression,{value:"use strict"})}function l(e,t){var n;r(e)&&(n=e.body.shift()),t(),n&&e.body.unshift(n)}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.has=r,n.wrap=l,n.__esModule=!0;var s=i(e("../../types"))},{"../../types":153}],63:[function(e,t){"use strict";function n(e,t){var n=new a(t);return n.parse(e)}var r=function(e){return e&&e.__esModule?e["default"]:e};t.exports=n;var l=r(e("../helpers/normalize-ast")),i=r(e("./transformer")),s=r(e("../helpers/object")),a=r(e("./file")),o=r(e("lodash/collection/each"));n.fromAst=function(e,t,n){e=l(e);var r=new a(n);return r.addCode(t),r.transform(e),r.generate()},n._ensureTransformerNames=function(e,t){for(var r=[],l=0;l<t.length;l++){var i=t[l],s=n.deprecatedTransformerMap[i],a=n.aliasTransformerMap[i];if(a)r.push(a);else if(s)console.error("The transformer "+i+" has been renamed to "+s),t.push(s);else if(n.transformers[i])r.push(i);else{if(!n.namespaces[i])throw new ReferenceError("Unknown transformer "+i+" specified in "+e);r=r.concat(n.namespaces[i])}}return r},n.transformerNamespaces=s(),n.transformers=s(),n.namespaces=s(),n.deprecatedTransformerMap=e("./transformers/deprecated"),n.aliasTransformerMap=e("./transformers/aliases"),n.moduleFormatters=e("./modules");var u=r(e("./transformers"));o(u,function(e,t){var r=t.split(".")[0],l=n.namespaces,s=r;l[s]||(l[s]=[]),n.namespaces[r].push(t),n.transformerNamespaces[t]=r,n.transformers[t]=new i(t,e)})},{"../helpers/normalize-ast":40,"../helpers/object":41,"./file":46,"./modules":71,"./transformer":76,"./transformers":110,"./transformers/aliases":77,"./transformers/deprecated":78,"lodash/collection/each":316}],64:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(e){return e&&e.__esModule?e:{"default":e}},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("../../messages")),s=n(e("../../traversal")),a=n(e("lodash/object/extend")),o=n(e("../../helpers/object")),u=r(e("../../util")),p=r(e("../../types")),c={enter:function(e,t,n,r){var l=r.internalRemap[e.name];if(this.isReferencedIdentifier()&&l&&(!n.hasBinding(e.name)||n.bindingIdentifierEquals(e.name,r.localImports[e.name])))return l;if(p.isUpdateExpression(e)){var i=r.getExport(e.argument,n);if(i){this.skip();var s=p.assignmentExpression(e.operator[0]+"=",e.argument,p.literal(1)),a=r.remapExportAssignment(s,i);if(p.isExpressionStatement(t)||e.prefix)return a;var o=[];o.push(a);var u;return u="--"===e.operator?"+":"-",o.push(p.binaryExpression(u,e.argument,p.literal(1))),p.sequenceExpression(o)}}if(p.isAssignmentExpression(e)){var i=r.getExport(e.left,n);if(i)return this.skip(),r.remapExportAssignment(e,i)}}},d={ImportDeclaration:{enter:function(e,t,n,r){r.hasLocalImports=!0,a(r.localImports,this.getBindingIdentifiers()),r.bumpImportOccurences(e)}}},f=s.explode({ExportDeclaration:{enter:function(e,t,n,r){r.hasLocalImports=!0;var l=this.get("declaration");if(l.isStatement()){var i=l.getBindingIdentifiers();for(var s in i){var a=i[s];r._addExport(s,a)}}if(this.isExportNamedDeclaration()&&e.specifiers)for(var o=0;o<e.specifiers.length;o++){var u=e.specifiers[o],c=u.local;c&&r._addExport(c.name,u.exported)}if(!p.isExportDefaultDeclaration(e)){var d=e.specifiers&&1===e.specifiers.length&&p.isSpecifierDefault(e.specifiers[0]);d||(r.hasNonDefaultExports=!0)}e.source&&r.bumpImportOccurences(e)}}}),h=function(){function e(t){l(this,e),this.internalRemap={},this.defaultIds=o(),this.scope=t.scope,this.file=t,this.ids=o(),this.hasNonDefaultExports=!1,this.hasLocalExports=!1,this.hasLocalImports=!1,this.localImportOccurences=o(),this.localExports=o(),this.localImports=o(),this.getLocalExports(),this.getLocalImports()}return e.prototype.transform=function(){this.remapAssignments()},e.prototype.doDefaultExportInterop=function(e){return(p.isExportDefaultDeclaration(e)||p.isSpecifierDefault(e))&&!this.noInteropRequireExport&&!this.hasNonDefaultExports},e.prototype.bumpImportOccurences=function(e){var t=e.source.value,n=this.localImportOccurences,r=n,l=t;r[l]||(r[l]=0),e.specifiers&&(n[t]+=e.specifiers.length)},e.prototype.getLocalExports=function(){this.file.path.traverse(f,this)},e.prototype.getLocalImports=function(){this.file.path.traverse(d,this)},e.prototype.remapAssignments=function(){this.hasLocalImports&&this.file.path.traverse(c,this)},e.prototype.remapExportAssignment=function(e,t){for(var n=e,r=0;r<t.length;r++)n=p.assignmentExpression("=",p.memberExpression(p.identifier("exports"),t[r]),n);return n},e.prototype._addExport=function(e,t){var n,r,l=(n=this.localExports,r=e,!n[r]&&(n[r]={binding:this.scope.getBindingIdentifier(e),exported:[]}),n[r]);l.exported.push(t)},e.prototype.getExport=function(e,t){if(p.isIdentifier(e)){var n=this.localExports[e.name];return n&&n.binding===t.getBindingIdentifier(e.name)?n.exported:void 0}},e.prototype.getModuleName=function(){var e=this.file.opts;if(e.moduleId)return e.moduleId;var t=e.filenameRelative,n="";if(e.moduleRoot&&(n=e.moduleRoot+"/"),!e.filenameRelative)return n+e.filename.replace(/^\//,"");if(e.sourceRoot){var r=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(r,"")}return e.keepModuleIdExtensions||(t=t.replace(/\.(\w*?)$/,"")),n+=t,n=n.replace(/\\/g,"/")},e.prototype._pushStatement=function(e,t){return(p.isClass(e)||p.isFunction(e))&&e.id&&(t.push(p.toStatement(e)),e=e.id),e},e.prototype._hoistExport=function(e,t,n){return p.isFunctionDeclaration(e)&&(t._blockHoist=n||2),t},e.prototype.getExternalReference=function(e,t){var n=this.ids,r=e.source.value;return n[r]?n[r]:this.ids[r]=this._getExternalReference(e,t)},e.prototype.checkExportIdentifier=function(e){if(p.isIdentifier(e,{name:"__esModule"}))throw this.file.errorWithNode(e,i.get("modulesIllegalExportName",e.name))},e.prototype.exportAllDeclaration=function(e,t){var n=this.getExternalReference(e,t);t.push(this.buildExportsWildcard(n,e))},e.prototype.isLoose=function(){return this.file.isLoose("es6.modules")},e.prototype.exportSpecifier=function(e,t,n){if(t.source){var r=this.getExternalReference(t,n);if("default"!==e.local.name||this.noInteropRequireExport){if(r=p.memberExpression(r,e.local),!this.isLoose())return void n.push(this.buildExportsFromAssignment(e.exported,r,t))}else r=p.callExpression(this.file.addHelper("interop-require"),[r]);n.push(this.buildExportsAssignment(e.exported,r,t))}else n.push(this.buildExportsAssignment(e.exported,e.local,t))},e.prototype.buildExportsWildcard=function(e){return p.expressionStatement(p.callExpression(this.file.addHelper("defaults"),[p.identifier("exports"),p.callExpression(this.file.addHelper("interop-require-wildcard"),[e])]))},e.prototype.buildExportsFromAssignment=function(e,t){return this.checkExportIdentifier(e),u.template("exports-from-assign",{INIT:t,ID:p.literal(e.name)},!0)},e.prototype.buildExportsAssignment=function(e,t){return this.checkExportIdentifier(e),u.template("exports-assign",{VALUE:t,KEY:e},!0)},e.prototype.exportDeclaration=function(e,t){var n=e.declaration,r=n.id;p.isExportDefaultDeclaration(e)&&(r=p.identifier("default"));var l;if(p.isVariableDeclaration(n))for(var i=0;i<n.declarations.length;i++){var s=n.declarations[i];s.init=this.buildExportsAssignment(s.id,s.init,e).expression;var a=p.variableDeclaration(n.kind,[s]);0===i&&p.inherits(a,n),t.push(a)}else{var o=n;(p.isFunctionDeclaration(n)||p.isClassDeclaration(n))&&(o=n.id,t.push(n)),l=this.buildExportsAssignment(r,o,e),t.push(l),this._hoistExport(n,l)}},e}();t.exports=h},{"../../helpers/object":41,"../../messages":43,"../../traversal":144,"../../types":153,"../../util":157,"lodash/object/extend":404}],65:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=n(e("../../util"));t.exports=function(e){var t=function(){this.noInteropRequireImport=!0,this.noInteropRequireExport=!0,e.apply(this,arguments)};return r.inherits(t,e),t}},{"../../util":157}],66:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("./amd")),l=n(e("./_strict"));t.exports=l(r)},{"./_strict":65,"./amd":67}],67:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./_default")),a=r(e("./common")),o=r(e("lodash/collection/includes")),u=r(e("lodash/object/values")),p=(n(e("../../util")),n(e("../../types"))),c=function(e){function t(){this.init=a.prototype.init,i(this,t),null!=e&&e.apply(this,arguments)}return l(t,e),t.prototype.buildDependencyLiterals=function(){var e=[];for(var t in this.ids)e.push(p.literal(t));return e},t.prototype.transform=function(e){s.prototype.transform.apply(this,arguments);var t=e.body,n=[p.literal("exports")];this.passModuleArg&&n.push(p.literal("module")),n=n.concat(this.buildDependencyLiterals()),n=p.arrayExpression(n);var r=u(this.ids);this.passModuleArg&&r.unshift(p.identifier("module")),r.unshift(p.identifier("exports"));var l=p.functionExpression(null,r,p.blockStatement(t)),i=[n,l],a=this.getModuleName();a&&i.unshift(p.literal(a));var o=p.callExpression(p.identifier("define"),i);e.body=[p.expressionStatement(o)]},t.prototype.getModuleName=function(){return this.file.opts.moduleIds?s.prototype.getModuleName.apply(this,arguments):null},t.prototype._getExternalReference=function(e){return this.scope.generateUidIdentifier(e.source.value)},t.prototype.importDeclaration=function(e){this.getExternalReference(e)},t.prototype.importSpecifier=function(e,t,n){var r=t.source.value,l=this.getExternalReference(t);if((p.isImportNamespaceSpecifier(e)||p.isImportDefaultSpecifier(e))&&(this.defaultIds[r]=e.local),o(this.file.dynamicImportedNoDefault,t))this.ids[t.source.value]=l;else if(p.isImportNamespaceSpecifier(e));else if(o(this.file.dynamicImported,t)||!p.isSpecifierDefault(e)||this.noInteropRequireImport){var i=e.imported;p.isSpecifierDefault(e)&&(i=p.identifier("default")),l=p.memberExpression(l,i)}else{var s=this.scope.generateUidIdentifier(e.local.name);n.push(p.variableDeclaration("var",[p.variableDeclarator(s,p.callExpression(this.file.addHelper("interop-require"),[l]))])),l=s}this.internalRemap[e.local.name]=l},t.prototype.exportSpecifier=function(){a.prototype.exportSpecifier.apply(this,arguments)},t.prototype.exportDeclaration=function(e){this.doDefaultExportInterop(e)&&(this.passModuleArg=!0),a.prototype.exportDeclaration.apply(this,arguments)},t}(s);t.exports=c},{"../../types":153,"../../util":157,"./_default":64,"./common":69,"lodash/collection/includes":319,"lodash/object/values":409}],68:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("./common")),l=n(e("./_strict"));t.exports=l(r)},{"./_strict":65,"./common":69}],69:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./_default")),a=r(e("lodash/collection/includes")),o=n(e("../../util")),u=n(e("../../types")),p=function(e){function t(){i(this,t),null!=e&&e.apply(this,arguments)}return l(t,e),t.prototype.init=function(){var e=this.file,t=e.scope;if(t.rename("module"),t.rename("exports"),!this.noInteropRequireImport&&this.hasNonDefaultExports){var n="exports-module-declaration";this.file.isLoose("es6.modules")&&(n+="-loose");var r=o.template(n,!0);r._blockHoist=3,e.ast.program.body.unshift(r)}},t.prototype.importSpecifier=function(e,t,n){var r=e.local,l=this.getExternalReference(t,n);u.isSpecifierDefault(e)?a(this.file.dynamicImportedNoDefault,t)?this.internalRemap[r.name]=l:this.noInteropRequireImport?this.internalRemap[r.name]=u.memberExpression(l,u.identifier("default")):a(this.file.dynamicImported,t)||n.push(u.variableDeclaration("var",[u.variableDeclarator(r,u.callExpression(this.file.addHelper("interop-require"),[l]))])):u.isImportNamespaceSpecifier(e)?(this.noInteropRequireImport||(l=u.callExpression(this.file.addHelper("interop-require-wildcard"),[l])),n.push(u.variableDeclaration("var",[u.variableDeclarator(r,l)]))):this.internalRemap[r.name]=u.memberExpression(l,e.imported)},t.prototype.importDeclaration=function(e,t){t.push(o.template("require",{MODULE_NAME:e.source},!0))},t.prototype.exportSpecifier=function(e,t,n){return this.doDefaultExportInterop(e)?void n.push(o.template("exports-default-assign",{VALUE:e.local},!0)):void s.prototype.exportSpecifier.apply(this,arguments)},t.prototype.exportDeclaration=function(e,t){if(this.doDefaultExportInterop(e)){var n=e.declaration,r=o.template("exports-default-assign",{VALUE:this._pushStatement(n,t)},!0);return u.isFunctionDeclaration(n)&&(r._blockHoist=3),void t.push(r)}s.prototype.exportDeclaration.apply(this,arguments)},t.prototype._getExternalReference=function(e,t){var n,r=(e.source.value,u.callExpression(u.identifier("require"),[e.source]));a(this.file.dynamicImported,e)&&!a(this.file.dynamicImportedNoDefault,e)?(r=u.memberExpression(r,u.identifier("default")),n=e.specifiers[0].local):n=this.scope.generateUidBasedOnNode(e,"import");var l=u.variableDeclaration("var",[u.variableDeclarator(n,r)]);return t.push(l),n},t}(s);t.exports=p},{"../../types":153,"../../util":157,"./_default":64,"lodash/collection/includes":319}],70:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("../../types")),i=function(){function e(){r(this,e)}return e.prototype.exportDeclaration=function(e,t){var n=l.toStatement(e.declaration,!0);n&&t.push(l.inherits(n,e))},e.prototype.exportAllDeclaration=function(){},e.prototype.importDeclaration=function(){},e.prototype.importSpecifier=function(){},e.prototype.exportSpecifier=function(){},e}();t.exports=i},{"../../types":153}],71:[function(e,t){"use strict";t.exports={commonStrict:e("./common-strict"),amdStrict:e("./amd-strict"),umdStrict:e("./umd-strict"),common:e("./common"),system:e("./system"),ignore:e("./ignore"),amd:e("./amd"),umd:e("./umd")}},{"./amd":67,"./amd-strict":66,"./common":69,"./common-strict":68,"./ignore":70,"./system":72,"./umd":74,"./umd-strict":73}],72:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./_default")),a=r(e("./amd")),o=n(e("../../util")),u=r(e("lodash/array/last")),p=r(e("lodash/collection/each")),c=r(e("lodash/collection/map")),d=n(e("../../types")),f=function(e,t){return e._blockHoist&&!t.transformers.runtime.canTransform()},h={enter:function(e,t,n,r){if(d.isFunction(e))return this.skip();if(d.isVariableDeclaration(e)){if("var"!==e.kind&&!d.isProgram(t))return;if(f(e,n.file))return;for(var l=[],i=0;i<e.declarations.length;i++){var s=e.declarations[i];if(r.push(d.variableDeclarator(s.id)),s.init){var a=d.expressionStatement(d.assignmentExpression("=",s.id,s.init));l.push(a)}}if(d.isFor(t)){if(t.left===e)return e.declarations[0].id;if(t.init===e)return l}return l}}},m={enter:function(e,t,n,r){d.isFunction(e)&&this.skip(),(d.isFunctionDeclaration(e)||f(e,n.file))&&(r.push(e),this.remove())}},g={enter:function(e,t,n,r){e._importSource===r.source&&(d.isVariableDeclaration(e)?p(e.declarations,function(e){r.hoistDeclarators.push(d.variableDeclarator(e.id)),r.nodes.push(d.expressionStatement(d.assignmentExpression("=",e.id,e.init)))}):r.nodes.push(e),this.remove())}},y=function(e){function t(e){i(this,t),this.exportIdentifier=e.scope.generateUidIdentifier("export"),this.noInteropRequireExport=!0,this.noInteropRequireImport=!0,s.apply(this,arguments)}return l(t,e),t.prototype._addImportSource=function(e,t){return e&&(e._importSource=t.source&&t.source.value),e},t.prototype.buildExportsWildcard=function(e,t){var n=this.scope.generateUidIdentifier("key"),r=d.memberExpression(e,n,!0),l=d.variableDeclaration("var",[d.variableDeclarator(n)]),i=e,s=d.blockStatement([d.expressionStatement(this.buildExportCall(n,r))]);return this._addImportSource(d.forInStatement(l,i,s),t)},t.prototype.buildExportsAssignment=function(e,t,n){var r=this.buildExportCall(d.literal(e.name),t,!0);return this._addImportSource(r,n)},t.prototype.buildExportsFromAssignment=function(){return this.buildExportsAssignment.apply(this,arguments)},t.prototype.remapExportAssignment=function(e,t){for(var n=e,r=0;r<t.length;r++)n=this.buildExportCall(d.literal(t[r].name),n);return n},t.prototype.buildExportCall=function(e,t,n){var r=d.callExpression(this.exportIdentifier,[e,t]);return n?d.expressionStatement(r):r},t.prototype.importSpecifier=function(e,t,n){a.prototype.importSpecifier.apply(this,arguments);for(var r in this.internalRemap)n.push(d.variableDeclaration("var",[d.variableDeclarator(d.identifier(r),this.internalRemap[r])]));this.internalRemap={},this._addImportSource(u(n),t)},t.prototype.buildRunnerSetters=function(e,t){var n=this.file.scope;return d.arrayExpression(c(this.ids,function(r,l){var i={hoistDeclarators:t,source:l,nodes:[]};return n.traverse(e,g,i),d.functionExpression(null,[r],d.blockStatement(i.nodes))}))},t.prototype.transform=function(e){s.prototype.transform.apply(this,arguments);var t=[],n=this.getModuleName(),r=d.literal(n),l=d.blockStatement(e.body),i=o.template("system",{MODULE_DEPENDENCIES:d.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,MODULE_NAME:r,SETTERS:this.buildRunnerSetters(l,t),EXECUTE:d.functionExpression(null,[],l)},!0),a=i.expression.arguments[2].body.body;n||i.expression.arguments.shift();var u=a.pop();if(this.file.scope.traverse(l,h,t),t.length){var p=d.variableDeclaration("var",t);p._blockHoist=!0,a.unshift(p)}this.file.scope.traverse(l,m,a),a.push(u),e.body=[i]},t}(a);t.exports=y},{"../../types":153,"../../util":157,"./_default":64,"./amd":67,"lodash/array/last":312,"lodash/collection/each":316,"lodash/collection/map":320}],73:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("./umd")),l=n(e("./_strict"));t.exports=l(r)},{"./_strict":65,"./umd":74}],74:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./_default")),a=r(e("./amd")),o=r(e("lodash/object/values")),u=n(e("../../util")),p=n(e("../../types")),c=function(e){function t(){i(this,t),null!=e&&e.apply(this,arguments)}return l(t,e),t.prototype.transform=function(e){s.prototype.transform.apply(this,arguments);var t=e.body,n=[];for(var r in this.ids)n.push(p.literal(r));var l=o(this.ids),i=[p.identifier("exports")];this.passModuleArg&&i.push(p.identifier("module")),i=i.concat(l);var a=p.functionExpression(null,i,p.blockStatement(t)),c=[p.literal("exports")];this.passModuleArg&&c.push(p.literal("module")),c=c.concat(n),c=[p.arrayExpression(c)];var d=u.template("test-exports"),f=u.template("test-module"),h=this.passModuleArg?p.logicalExpression("&&",d,f):d,m=[p.identifier("exports")];this.passModuleArg&&m.push(p.identifier("module")),m=m.concat(n.map(function(e){return p.callExpression(p.identifier("require"),[e])}));var g=[p.memberExpression(p.identifier("module"),p.identifier("exports"))];this.passModuleArg&&g.push(p.identifier("module"));for(var y in this.ids){var b=this.defaultIds[y]||p.identifier(p.toIdentifier(y));g.push(p.memberExpression(p.identifier("global"),b))}var v=this.getModuleName();v&&c.unshift(p.literal(v));var x=u.template("umd-runner-body",{AMD_ARGUMENTS:c,COMMON_TEST:h,COMMON_ARGUMENTS:m,BROWSER_ARGUMENTS:g,GLOBAL_ARG:p.identifier(p.toIdentifier(this.file.opts.basename))});e.body=[p.expressionStatement(p.callExpression(x,[p.thisExpression(),a]))]},t}(a);t.exports=c},{"../../types":153,"../../util":157,"./_default":64,"./amd":67,"lodash/object/values":409}],75:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("lodash/collection/includes")),i=n(e("../traversal")),s=function(){function e(t,n){r(this,e),this.transformer=n,this.shouldRun=!n.check,this.handlers=n.handlers,this.file=t,this.ran=!1}return e.prototype.canTransform=function(){var e=this.transformer,t=this.file.opts,n=e.key;if("_"===n[0])return!0;var r=t.blacklist;if(r.length&&l(r,n))return!1;var i=t.whitelist;if(i)return l(i,n);var s=e.metadata.stage;return null!=s&&s>=t.stage?!0:e.metadata.optional&&!l(t.optional,n)?!1:!0},e.prototype.checkNode=function(e){var t=this.transformer.check;return t?this.shouldRun=t(e):!0},e.prototype.transform=function(){if(this.shouldRun){var e=this.file;e.log.debug("Running transformer "+this.transformer.key),i(e.ast,this.handlers,e.scope,e),this.ran=!0}},e}();t.exports=s},{"../traversal":144,"lodash/collection/includes":319}],76:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("./transformer-pass")),s=r(e("lodash/lang/isFunction")),a=r(e("../traversal")),o=r(e("lodash/lang/isObject")),u=r(e("lodash/object/assign")),p=(n(e("../../acorn")),r(e("./file"))),c=r(e("lodash/collection/each")),d=function(){function e(t,n){l(this,e),n=u({},n);var r=function(e){var t=n[e];return delete n[e],t};this.manipulateOptions=r("manipulateOptions"),this.metadata=r("metadata")||{},this.parser=r("parser"),this.check=r("check"),this.post=r("post"),this.pre=r("pre"),null!=this.metadata.stage&&(this.metadata.optional=!0),this.handlers=this.normalize(n);var i=this;i.opts||(i.opts={}),this.key=t}return e.prototype.normalize=function(e){var t=this;return s(e)&&(e={ast:e}),a.explode(e),c(e,function(n,r){return"_"===r[0]?void(t[r]=n):void("enter"!==r&&"exit"!==r&&(s(n)&&(n={enter:n}),o(n)&&(n.enter||(n.enter=function(){}),n.exit||(n.exit=function(){}),e[r]=n)))}),e},e.prototype.buildPass=function(e){if(!(e instanceof p))throw new TypeError("Transformer "+this.key+" is resolving to a different Babel version to what is doing the actual transformation...");return new i(e,this)},e}();t.exports=d},{"../../acorn":5,"../traversal":144,"./file":46,"./transformer-pass":75,"lodash/collection/each":316,"lodash/lang/isFunction":393,"lodash/lang/isObject":396,"lodash/object/assign":402}],77:[function(e,t){t.exports={useStrict:"strict","es5.runtime":"runtime","es6.runtime":"runtime"}},{}],78:[function(e,t){t.exports={selfContained:"runtime","unicode-regex":"regex.unicode","spec.typeofSymbol":"es6.spec.symbols","es6.symbols":"es6.spec.symbols","es6.blockScopingTDZ":"es6.spec.blockScoping","minification.deadCodeElimination":"utility.deadCodeElimination","minification.removeConsoleCalls":"utility.removeConsole","minification.removeDebugger":"utility.removeDebugger"}},{}],79:[function(e,t,n){"use strict";function r(e){var t=e.property;e.computed&&i.isLiteral(t)&&i.isValidIdentifier(t.value)?(e.property=i.identifier(t.value),e.computed=!1):e.computed||!i.isIdentifier(t)||i.isValidIdentifier(t.name)||(e.property=i.literal(t.name),e.computed=!0)}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.MemberExpression=r,n.__esModule=!0;var i=l(e("../../../types"))},{"../../../types":153}],80:[function(e,t,n){"use strict";function r(e){var t=e.key;i.isLiteral(t)&&i.isValidIdentifier(t.value)?(e.key=i.identifier(t.value),e.computed=!1):e.computed||!i.isIdentifier(t)||i.isValidIdentifier(t.name)||(e.key=i.literal(t.name))}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.Property=r,n.__esModule=!0;var i=l(e("../../../types"))},{"../../../types":153}],81:[function(e,t,n){"use strict";function r(e){return a.isProperty(e)&&("get"===e.kind||"set"===e.kind)}function l(e){var t={},n=!1;return e.properties=e.properties.filter(function(e){return"get"===e.kind||"set"===e.kind?(n=!0,s.push(t,e.key,e.kind,e.computed,e.value),!1):!0}),n?a.callExpression(a.memberExpression(a.identifier("Object"),a.identifier("defineProperties")),[e,s.toDefineObject(t)]):void 0}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.ObjectExpression=l,n.__esModule=!0;var s=i(e("../../helpers/define-map")),a=i(e("../../../types"))},{"../../../types":153,"../../helpers/define-map":54}],82:[function(e,t,n){"use strict";function r(e){return i.ensureBlock(e),e.expression=!1,e.type="FunctionExpression",e.shadow=!0,e}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.ArrowFunctionExpression=r,n.__esModule=!0;var i=l(e("../../../types")),s=i.isArrowFunctionExpression;n.check=s},{"../../../types":153}],83:[function(e,t,n){"use strict";function r(e,t){if(!v.isVariableDeclaration(e))return!1;if(e._let)return!0;if("let"!==e.kind)return!1;if(l(e,t))for(var n=0;n<e.declarations.length;n++){var r=e.declarations[n],i=r;i.init||(i.init=v.identifier("undefined"))}return e._let=!0,e.kind="var",!0}function l(e,t){return!v.isFor(t)||!v.isFor(t,{left:e})}function i(e,t){return v.isVariableDeclaration(e,{kind:"var"})&&!r(e,t)}function s(e){for(var t=0;t<e.length;t++)delete e[t]._let}function a(e){return v.isVariableDeclaration(e)&&("let"===e.kind||"const"===e.kind)}function o(e,t,n,i){if(r(e,t)&&l(e)&&i.transformers["es6.spec.blockScoping"].canTransform()){for(var s=[e],a=0;a<e.declarations.length;a++){var o=e.declarations[a];if(o.init){var u=v.assignmentExpression("=",o.id,o.init);u._ignoreBlockScopingTDZ=!0,s.push(v.expressionStatement(u))}o.init=i.addHelper("temporal-undefined")}return e._blockHoist=2,s}}function u(e,t,n,l){var i=e.left||e.init;r(i,e)&&(v.ensureBlock(e),e.body._letDeclarators=[i]);var s=new j(this,this.get("body"),t,n,l);return s.run()}function p(e,t,n,r){if(!v.isLoop(t)){var l=new j(null,this,t,n,r);l.run()}}function c(e,t,n,r){if(v.isReferencedIdentifier(e,t)){var l=r[e.name];if(l){var i=n.getBindingIdentifier(e.name);i===l.binding?e.name=l.uid:this&&this.skip()}}}function d(e,t,n,r){c(e,t,n,r),n.traverse(e,_,r)}var f=function(e){return e&&e.__esModule?e:{"default":e}},h=function(e){return e&&e.__esModule?e["default"]:e},m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.check=a,n.VariableDeclaration=o,n.Loop=u,n.BlockStatement=p,n.__esModule=!0;var g=h(e("../../../traversal")),y=h(e("../../../helpers/object")),b=f(e("../../../util")),v=f(e("../../../types")),x=h(e("lodash/object/values")),E=h(e("lodash/object/extend"));n.Program=p;var _={enter:c},S={enter:function(e,t,n,r){return this.isFunction()?(this.traverse(I,r),this.skip()):void 0}},I={enter:function(e,t,n,r){if(this.isReferencedIdentifier()){var l=r.letReferences[e.name];l&&n.getBindingIdentifier(e.name)===l&&(r.closurify=!0)}}},w={enter:function(e,t,n,r){if(this.isForStatement())i(e.init,e)&&(e.init=v.sequenceExpression(r.pushDeclar(e.init)));else if(this.isFor())i(e.left,e)&&(e.left=e.left.declarations[0].id);else{if(i(e,t))return r.pushDeclar(e).map(v.expressionStatement);if(this.isFunction())return this.skip()}}},k={enter:function(e,t,n,r){this.isLabeledStatement()&&r.innerLabels.push(e.label.name)}},A={enter:function(e,t,n,r){if(this.isAssignmentExpression()||this.isUpdateExpression()){var l=this.getBindingIdentifiers();for(var i in l)r.outsideReferences[i]===n.getBindingIdentifier(i)&&(r.reassignments[i]=!0)}}},C=function(e){return v.isBreakStatement(e)?"break":v.isContinueStatement(e)?"continue":void 0},T={enter:function(e,t,n,r){var l;if(this.isLoop()&&(r.ignoreLabeless=!0,this.traverse(T,r),r.ignoreLabeless=!1),this.isFunction()||this.isLoop())return this.skip();var i=C(e);if(i){if(e.label){if(r.innerLabels.indexOf(e.label.name)>=0)return;i=""+i+"|"+e.label.name}else{if(r.ignoreLabeless)return;if(v.isBreakStatement(e)&&v.isSwitchCase(t))return}r.hasBreakContinue=!0,r.map[i]=e,l=v.literal(i)}return this.isReturnStatement()&&(r.hasReturn=!0,l=v.objectExpression([v.property("init",v.identifier("v"),e.argument||v.identifier("undefined"))])),l?(l=v.returnStatement(l),v.inherits(l,e)):void 0}},j=function(){function e(t,n,r,l,i){m(this,e),this.parent=r,this.scope=l,this.file=i,this.blockPath=n,this.block=n.node,this.outsideLetReferences=y(),this.hasLetReferences=!1,this.letReferences=this.block._letReferences=y(),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=v.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(!v.isFunction(this.parent)&&!v.isProgram(this.block)&&this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.loopLabel&&!v.isLabeledStatement(this.loopParent)?v.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.remap=function(){var e=!1,t=this.letReferences,n=this.scope,r=y();for(var l in t){var i=t[l];if(n.parentHasBinding(l)||n.hasGlobal(l)){var s=n.generateUidIdentifier(i.name).name;i.name=s,e=!0,r[l]=r[s]={binding:i,uid:s}}}if(e){var a=this.loop;a&&(d(a.right,a,n,r),d(a.test,a,n,r),d(a.update,a,n,r)),this.blockPath.traverse(_,r)}},e.prototype.wrapClosure=function(){var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var n in t){var r=t[n];(this.scope.hasGlobal(r.name)||this.scope.parentHasBinding(r.name))&&(delete t[r.name],delete this.letReferences[r.name],this.scope.rename(r.name),this.letReferences[r.name]=r,t[r.name]=r)}this.has=this.checkLoop(),this.hoistVarDeclarations();var l=x(t),i=x(t),s=v.functionExpression(null,l,v.blockStatement(e.body));s.shadow=!0,this.addContinuations(s),e.body=this.body;var a=s;this.loop&&(a=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(v.variableDeclaration("var",[v.variableDeclarator(a,s)])));var o=v.callExpression(a,i),u=this.scope.generateUidIdentifier("ret"),p=g.hasType(s.body,this.scope,"YieldExpression",v.FUNCTION_TYPES);p&&(s.generator=!0,o=v.yieldExpression(o,!0));var c=g.hasType(s.body,this.scope,"AwaitExpression",v.FUNCTION_TYPES);c&&(s.async=!0,o=v.awaitExpression(o)),this.buildClosure(u,o)},e.prototype.buildClosure=function(e,t){var n=this.has;n.hasReturn||n.hasBreakContinue?this.buildHas(e,t):this.body.push(v.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,A,t);for(var n=0;n<e.params.length;n++){var r=e.params[n]; if(t.reassignments[r.name]){var l=this.scope.generateUidIdentifier(r.name);e.params[n]=l,this.scope.rename(r.name,l.name,e),e.body.body.push(v.expressionStatement(v.assignmentExpression("=",r,l)))}}},e.prototype.getLetReferences=function(){for(var e,t=this.block,n=t._letDeclarators||[],l=0;l<n.length;l++)e=n[l],E(this.outsideLetReferences,v.getBindingIdentifiers(e));if(t.body)for(l=0;l<t.body.length;l++)e=t.body[l],r(e,t)&&(n=n.concat(e.declarations));for(l=0;l<n.length;l++){e=n[l];var i=v.getBindingIdentifiers(e);E(this.letReferences,i),this.hasLetReferences=!0}if(this.hasLetReferences){s(n);var a={letReferences:this.letReferences,closurify:!1};return this.blockPath.traverse(S,a),a.closurify}},e.prototype.checkLoop=function(){var e={hasBreakContinue:!1,ignoreLabeless:!1,innerLabels:[],hasReturn:!1,isLoop:!!this.loop,map:{}};return this.blockPath.traverse(k,e),this.blockPath.traverse(T,e),e},e.prototype.hoistVarDeclarations=function(){this.blockPath.traverse(w,this)},e.prototype.pushDeclar=function(e){this.body.push(v.variableDeclaration(e.kind,e.declarations.map(function(e){return v.variableDeclarator(e.id)})));for(var t=[],n=0;n<e.declarations.length;n++){var r=e.declarations[n];if(r.init){var l=v.assignmentExpression("=",r.id,r.init);t.push(v.inherits(l,r))}}return t},e.prototype.buildHas=function(e,t){var n=this.body;n.push(v.variableDeclaration("var",[v.variableDeclarator(e,t)]));var r,l=(this.loop,this.has),i=[];if(l.hasReturn&&(r=b.template("let-scoping-return",{RETURN:e})),l.hasBreakContinue){for(var s in l.map)i.push(v.switchCase(v.literal(s),[l.map[s]]));if(l.hasReturn&&i.push(v.switchCase(null,[r])),1===i.length){var a=i[0];n.push(this.file.attachAuxiliaryComment(v.ifStatement(v.binaryExpression("===",e,a.test),a.consequent[0])))}else{for(var o=0;o<i.length;o++){var u=i[o].consequent[0];if(v.isBreakStatement(u)&&!u.label){var p;u.label=(p=this,!p.loopLabel&&(p.loopLabel=this.file.scope.generateUidIdentifier("loop")),p.loopLabel)}}n.push(this.file.attachAuxiliaryComment(v.switchStatement(e,i)))}}else l.hasReturn&&n.push(this.file.attachAuxiliaryComment(r))},e}()},{"../../../helpers/object":41,"../../../traversal":144,"../../../types":153,"../../../util":157,"lodash/object/extend":404,"lodash/object/values":409}],84:[function(e,t,n){"use strict";function r(e){return m.variableDeclaration("let",[m.variableDeclarator(e.id,m.toExpression(e))])}function l(e,t,n,r){return new x(this,r).run()}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e},a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.ClassDeclaration=r,n.ClassExpression=l,n.__esModule=!0;var o=s(e("../../helpers/replace-supers")),u=i(e("../../helpers/name-method")),p=i(e("../../helpers/define-map")),c=i(e("../../../messages")),d=i(e("../../../util")),f=s(e("../../../traversal")),h=(s(e("lodash/collection/each")),s(e("lodash/object/has"))),m=i(e("../../../types")),g="__initializeProperties",y=m.isClass;n.check=y;var b={Identifier:{enter:function(e,t,n,r){this.parentPath.isClassProperty({key:e})||this.isReferenced()&&n.getBinding(e.name)===r.scope.getBinding(e.name)&&(r.references[e.name]=!0)}}},v=f.explode({MethodDefinition:{enter:function(){this.skip()}},Property:{enter:function(e){e.method&&this.skip()}},CallExpression:{enter:function(e,t,n,r){if(this.get("callee").isSuper()&&(r.hasBareSuper=!0,r.bareSuper=this,!r.hasSuper))throw this.errorWithNode("super call is only allowed in derived constructor")}},ThisExpression:{enter:function(e,t,n,r){if(r.hasSuper&&!r.hasBareSuper)throw this.errorWithNode("'this' is not allowed before super()")}}}),x=function(){function e(t,n){a(this,e),this.parent=t.parent,this.scope=t.scope,this.node=t.node,this.path=t,this.file=n,this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={},this.instancePropBody=[],this.instancePropRefs={},this.staticPropBody=[],this.body=[],this.hasConstructor=!1,this.hasDecorators=!1,this.className=this.node.id,this.classRef=this.node.id||this.scope.generateUidIdentifier("class"),this.superName=this.node.superClass||m.identifier("Function"),this.hasSuper=!!this.node.superClass,this.isLoose=n.isLoose("es6.classes")}return e.prototype.run=function(){var e,t=this.superName,n=(this.className,this.node.body.body,this.classRef),r=this.file,l=this.body,i=this.constructorBody=m.blockStatement([]);this.className?(e=m.functionDeclaration(this.className,[],i),l.push(e)):e=m.functionExpression(null,[],i),this.constructor=e;var s=[],a=[];this.hasSuper&&(a.push(t),t=this.scope.generateUidBasedOnNode(t),s.push(t),this.superName=t,l.push(m.expressionStatement(m.callExpression(r.addHelper("inherits"),[n,t])))),this.buildBody(),i.body.unshift(m.expressionStatement(m.callExpression(r.addHelper("class-call-check"),[m.thisExpression(),n])));var o=this.node.decorators;if(o)for(var p=0;p<o.length;p++){var c=o[p];l.push(d.template("class-decorator",{DECORATOR:c.expression,CLASS_REF:n},!0))}if(this.className){if(1===l.length)return m.toExpression(l[0])}else e=u.bare(e,this.parent,this.scope),l.unshift(m.variableDeclaration("var",[m.variableDeclarator(n,e)])),m.inheritsComments(l[0],this.node);return l=l.concat(this.staticPropBody),l.push(m.returnStatement(n)),m.callExpression(m.functionExpression(null,s,m.blockStatement(l)),a)},e.prototype.pushToMap=function(e,t){var n,r=void 0===arguments[2]?"value":arguments[2];e["static"]?(this.hasStaticDescriptors=!0,n=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,n=this.instanceMutatorMap);var l=m.toKeyAlias(e),i={};h(n,l)&&(i=n[l]),n[l]=i;var s=i;if(s._inherits||(s._inherits=[]),i._inherits.push(e),i._key=e.key,t&&(i.enumerable=m.literal(!0)),e.computed&&(i._computed=!0),e.decorators){var a;this.hasDecorators=!0;var o=(a=i,!a.decorators&&(a.decorators=m.arrayExpression([])),a.decorators);o.elements=o.elements.concat(e.decorators.map(function(e){return e.expression}))}if(i.value||i.initializer)throw this.file.errorWithNode(e,"Key conflict with sibling node");"get"===e.kind&&(r="get"),"set"===e.kind&&(r="set"),m.inheritsComments(e.value,e),i[r]=e.value},e.prototype.buildBody=function(){for(var e=this.constructorBody,t=(this.constructor,this.className),n=(this.superName,this.node.body.body),r=this.body,l=this.path.get("body").get("body"),i=0;i<n.length;i++){var s=n[i],a=l[i];if(m.isMethodDefinition(s)){var u="constructor"===s.kind;u&&this.verifyConstructor(a);var c=new o({methodPath:a,methodNode:s,objectRef:this.classRef,superRef:this.superName,isStatic:s["static"],isLoose:this.isLoose,scope:this.scope,file:this.file},!0);c.replace(),u?this.pushConstructor(s,a):this.pushMethod(s)}else m.isClassProperty(s)&&this.pushProperty(s)}if(!this.hasConstructor&&this.hasSuper){var f="class-super-constructor-call";this.isLoose&&(f+="-loose"),e.body.push(d.template(f,{CLASS_NAME:t,SUPER_NAME:this.superName},!0))}this.placePropertyInitializers(),this.userConstructor&&(e.body=e.body.concat(this.userConstructor.body.body),m.inherits(this.constructor,this.userConstructor),m.inherits(this.constructorBody,this.userConstructor.body));var h,g,y="create-class";if(this.hasDecorators&&(y="create-decorated-class"),this.hasInstanceDescriptors&&(h=p.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(g=p.toClassObject(this.staticMutatorMap)),h||g){h&&(h=p.toComputedObjectFromClass(h)),g&&(g=p.toComputedObjectFromClass(g));var b=m.literal(null),v=[this.classRef,b,b,b,b];h&&(v[1]=h),g&&(v[2]=g),this.instanceInitializersId&&(v[3]=this.instanceInitializersId,r.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(v[4]=this.staticInitializersId,r.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var x=0,i=0;i<v.length;i++)v[i]!==b&&(x=i);v=v.slice(0,x+1),r.push(m.expressionStatement(m.callExpression(this.file.addHelper(y),v)))}},e.prototype.buildObjectAssignment=function(e){return m.variableDeclaration("var",[m.variableDeclarator(e,m.objectExpression([]))])},e.prototype.placePropertyInitializers=function(){var e=this.instancePropBody;if(e.length)if(this.hasPropertyCollision()){var t=m.expressionStatement(m.callExpression(m.memberExpression(m.thisExpression(),m.identifier(g)),[]));this.pushMethod(m.methodDefinition(m.identifier(g),m.functionExpression(null,[],m.blockStatement(e))),!0),this.hasSuper?this.bareSuper.insertAfter(t):this.constructorBody.body.unshift(t)}else this.hasSuper?this.hasConstructor?this.bareSuper.insertAfter(e):this.constructorBody.body=this.constructorBody.body.concat(e):this.constructorBody.body=e.concat(this.constructorBody.body)},e.prototype.hasPropertyCollision=function(){if(this.userConstructorPath)for(var e in this.instancePropRefs)if(this.userConstructorPath.scope.hasOwnBinding(e))return!0;return!1},e.prototype.verifyConstructor=function(e){var t={hasBareSuper:!1,bareSuper:null,hasSuper:this.hasSuper,file:this.file};if(e.traverse(v,t),this.bareSuper=t.bareSuper,!t.hasBareSuper&&this.hasSuper)throw e.errorWithNode("Derived constructor must call super()")},e.prototype.pushMethod=function(e,t){if(!t&&m.isLiteral(m.toComputedKey(e),{value:g}))throw this.file.errorWithNode(e,c.get("illegalMethodName",g));if("method"===e.kind&&(u.property(e,this.file,this.scope),this.isLoose)){var n=this.classRef;e["static"]||(n=m.memberExpression(n,m.identifier("prototype")));var r=m.memberExpression(n,e.key,e.computed),l=m.expressionStatement(m.assignmentExpression("=",r,e.value));return m.inheritsComments(l,e),void this.body.push(l)}this.pushToMap(e)},e.prototype.pushProperty=function(e){if(e.value||e.decorators){if(this.scope.traverse(e,b,{references:this.instancePropRefs,scope:this.scope}),e.decorators){var t=[];if(e.value&&t.push(m.returnStatement(e.value)),e.value=m.functionExpression(null,[],m.blockStatement(t)),this.pushToMap(e,!0,"initializer"),e["static"]){var n;this.staticPropBody.push(d.template("call-static-decorator",{INITIALIZERS:(n=this,!n.staticInitializersId&&(n.staticInitializersId=this.scope.generateUidIdentifier("staticInitializers")),n.staticInitializersId),CONSTRUCTOR:this.classRef,KEY:e.key},!0))}else{var r;this.instancePropBody.push(d.template("call-instance-decorator",{INITIALIZERS:(r=this,!r.instanceInitializersId&&(r.instanceInitializersId=this.scope.generateUidIdentifier("instanceInitializers")),r.instanceInitializersId),KEY:e.key},!0))}}else e["static"]?this.pushToMap(e,!0):this.instancePropBody.push(m.expressionStatement(m.assignmentExpression("=",m.memberExpression(m.thisExpression(),e.key),e.value)))}},e.prototype.pushConstructor=function(e,t){var n=t.get("value");n.scope.hasOwnBinding(this.classRef.name)&&n.scope.rename(this.classRef.name);var r=this.constructor,l=e.value;this.userConstructorPath=n,this.userConstructor=l,this.hasConstructor=!0,m.inheritsComments(r,e),r._ignoreUserWhitespace=!0,r.params=l.params,m.inherits(r.body,l.body)},e}()},{"../../../messages":43,"../../../traversal":144,"../../../types":153,"../../../util":157,"../../helpers/define-map":54,"../../helpers/name-method":57,"../../helpers/replace-supers":61,"lodash/collection/each":316,"lodash/object/has":405}],85:[function(e,t,n){"use strict";function r(e){return o.isVariableDeclaration(e,{kind:"const"})||o.isImportDeclaration(e)}function l(e,t,n,r){this.traverse(u,{constants:n.getAllBindingsOfKind("const","module"),file:r})}function i(e){"const"===e.kind&&(e.kind="let")}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.Scopable=l,n.VariableDeclaration=i,n.__esModule=!0;var a=s(e("../../../messages")),o=s(e("../../../types")),u={enter:function(e,t,n,r){if(this.isAssignmentExpression()||this.isUpdateExpression()){var l=this.getBindingIdentifiers();for(var i in l){var s=l[i],o=r.constants[i];if(o){var u=o.identifier;if(s!==u&&n.bindingIdentifierEquals(i,u))throw r.file.errorWithNode(s,a.get("readOnly",i))}}}else this.isScope()&&this.skip()}}},{"../../../messages":43,"../../../types":153}],86:[function(e,t,n){"use strict";function r(e,t,n,r){var l=e.left;if(f.isPattern(l)){var i=n.generateUidIdentifier("ref");return e.left=f.variableDeclaration("var",[f.variableDeclarator(i)]),f.ensureBlock(e),void e.body.body.unshift(f.variableDeclaration("var",[f.variableDeclarator(l,i)]))}if(f.isVariableDeclaration(l)){var s=l.declarations[0].id;if(f.isPattern(s)){var a=n.generateUidIdentifier("ref");e.left=f.variableDeclaration(l.kind,[f.variableDeclarator(a,null)]);var o=[],u=new g({kind:l.kind,file:r,scope:n,nodes:o});u.init(s,a),f.ensureBlock(e);var p=e.body;p.body=o.concat(p.body)}}}function l(e,t,n,r){var l=e.param;if(f.isPattern(l)){var i=n.generateUidIdentifier("ref");e.param=i;var s=[],a=new g({kind:"let",file:r,scope:n,nodes:s});return a.init(l,i),e.body.body=s.concat(e.body.body),e}}function i(e,t,n,r){var l=e.expression;if("AssignmentExpression"===l.type&&f.isPattern(l.left)&&!r.isConsequenceExpressionStatement(e)){var i=new g({operator:l.operator,scope:n,file:r});return i.init(l.left,l.right)}}function s(e,t,n,r){if(f.isPattern(e.left)){var l=n.generateUidIdentifier("temp");n.push({id:l});var i=[];i.push(f.expressionStatement(f.assignmentExpression("=",l,e.right)));var s=new g({operator:e.operator,file:r,scope:n,nodes:i});return s.init(e.left,l),i.push(f.expressionStatement(l)),i}}function a(e){for(var t=0;t<e.declarations.length;t++)if(f.isPattern(e.declarations[t].id))return!0;return!1}function o(e,t,n,r){if(!f.isForInStatement(t)&&!f.isForOfStatement(t)&&a(e)){for(var l,i=[],s=0;s<e.declarations.length;s++){l=e.declarations[s];var o=l.init,u=l.id,p=new g({nodes:i,scope:n,kind:e.kind,file:r});f.isPattern(u)&&o?(p.init(u,o),+s!==e.declarations.length-1&&f.inherits(i[i.length-1],l)):i.push(f.inherits(p.buildVariableAssignment(l.id,l.init),l))}if(!f.isProgram(t)&&!f.isBlockStatement(t)){for(l=null,s=0;s<i.length;s++){if(e=i[s],l||(l=f.variableDeclaration(e.kind,[])),!f.isVariableDeclaration(e)&&l.kind!==e.kind)throw r.errorWithNode(e,d.get("invalidParentForThisNode"));l.declarations=l.declarations.concat(e.declarations)}return l}return i}}function u(e){for(var t=0;t<e.elements.length;t++)if(f.isRestElement(e.elements[t]))return!0;return!1}var p=function(e){return e&&e.__esModule?e:{"default":e}},c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.ForOfStatement=r,n.CatchClause=l,n.ExpressionStatement=i,n.AssignmentExpression=s,n.VariableDeclaration=o,n.__esModule=!0;var d=p(e("../../../messages")),f=p(e("../../../types")),h=f.isPattern;n.check=h,n.ForInStatement=r,n.Function=function(e,t,n,r){var l=[],i=!1;if(e.params=e.params.map(function(t,s){if(!f.isPattern(t))return t;i=!0;var a=n.generateUidIdentifier("ref"),o=new g({blockHoist:e.params.length-s,nodes:l,scope:n,file:r,kind:"let"});return o.init(t,a),a}),i){r.checkNode(l),f.ensureBlock(e);var s=e.body;s.body=l.concat(s.body)}};var m={enter:function(e,t,n,r){this.isReferencedIdentifier()&&r.bindings[e.name]&&(r.deopt=!0,this.stop())}},g=function(){function e(t){c(this,e),this.blockHoist=t.blockHoist,this.operator=t.operator,this.arrays={},this.nodes=t.nodes||[],this.scope=t.scope,this.file=t.file,this.kind=t.kind}return e.prototype.buildVariableAssignment=function(e,t){var n=this.operator;f.isMemberExpression(e)&&(n="=");var r;return r=n?f.expressionStatement(f.assignmentExpression(n,e,t)):f.variableDeclaration(this.kind,[f.variableDeclarator(e,t)]),r._blockHoist=this.blockHoist,r},e.prototype.buildVariableDeclaration=function(e,t){var n=f.variableDeclaration("var",[f.variableDeclarator(e,t)]);return n._blockHoist=this.blockHoist,n},e.prototype.push=function(e,t){f.isObjectPattern(e)?this.pushObjectPattern(e,t):f.isArrayPattern(e)?this.pushArrayPattern(e,t):f.isAssignmentPattern(e)?this.pushAssignmentPattern(e,t):this.nodes.push(this.buildVariableAssignment(e,t))},e.prototype.toArray=function(e,t){return this.file.isLoose("es6.destructuring")||f.isIdentifier(e)&&this.arrays[e.name]?e:this.scope.toArray(e,t)},e.prototype.pushAssignmentPattern=function(e,t){var n=this.scope.generateUidBasedOnNode(t),r=f.variableDeclaration("var",[f.variableDeclarator(n,t)]);r._blockHoist=this.blockHoist,this.nodes.push(r);var l=f.conditionalExpression(f.binaryExpression("===",n,f.identifier("undefined")),e.right,n),i=e.left;f.isPattern(i)?(this.nodes.push(f.expressionStatement(f.assignmentExpression("=",n,l))),this.push(i,n)):this.nodes.push(this.buildVariableAssignment(i,l))},e.prototype.pushObjectSpread=function(e,t,n,r){for(var l=[],i=0;i<e.properties.length;i++){var s=e.properties[i];if(i>=r)break;if(!f.isSpreadProperty(s)){var a=s.key;f.isIdentifier(a)&&(a=f.literal(s.key.name)),l.push(a)}}l=f.arrayExpression(l);var o=f.callExpression(this.file.addHelper("object-without-properties"),[t,l]);this.nodes.push(this.buildVariableAssignment(n.argument,o))},e.prototype.pushObjectProperty=function(e,t){f.isLiteral(e.key)&&(e.computed=!0);var n=e.value,r=f.memberExpression(t,e.key,e.computed);f.isPattern(n)?this.push(n,r):this.nodes.push(this.buildVariableAssignment(n,r))},e.prototype.pushObjectPattern=function(e,t){if(e.properties.length||this.nodes.push(f.expressionStatement(f.callExpression(this.file.addHelper("object-destructuring-empty"),[t]))),e.properties.length>1&&f.isMemberExpression(t)){var n=this.scope.generateUidBasedOnNode(t,this.file);this.nodes.push(this.buildVariableDeclaration(n,t)),t=n}for(var r=0;r<e.properties.length;r++){var l=e.properties[r];f.isSpreadProperty(l)?this.pushObjectSpread(e,t,l,r):this.pushObjectProperty(l,t)}},e.prototype.canUnpackArrayPattern=function(e,t){if(!f.isArrayExpression(t))return!1;if(!(e.elements.length>t.elements.length)){if(e.elements.length<t.elements.length&&!u(e))return!1;for(var n=0;n<e.elements.length;n++)if(!e.elements[n])return!1;var r=f.getBindingIdentifiers(e),l={deopt:!1,bindings:r};return this.scope.traverse(t,m,l),!l.deopt}},e.prototype.pushUnpackedArrayPattern=function(e,t){for(var n=0;n<e.elements.length;n++){var r=e.elements[n];f.isRestElement(r)?this.push(r.argument,f.arrayExpression(t.elements.slice(n))):this.push(r,t.elements[n])}},e.prototype.pushArrayPattern=function(e,t){if(e.elements){if(this.canUnpackArrayPattern(e,t))return this.pushUnpackedArrayPattern(e,t);var n=!u(e)&&e.elements.length,r=this.toArray(t,n);f.isIdentifier(r)?t=r:(t=this.scope.generateUidBasedOnNode(t),this.arrays[t.name]=!0,this.nodes.push(this.buildVariableDeclaration(t,r)));for(var l=0;l<e.elements.length;l++){var i=e.elements[l];if(i){var s;f.isRestElement(i)?(s=this.toArray(t),l>0&&(s=f.callExpression(f.memberExpression(s,f.identifier("slice")),[f.literal(l)])),i=i.argument):s=f.memberExpression(t,f.literal(l),!0),this.push(i,s)}}}},e.prototype.init=function(e,t){if(!f.isArrayExpression(t)&&!f.isMemberExpression(t)){var n=this.scope.generateMemoisedReference(t,!0);n&&(this.nodes.push(this.buildVariableDeclaration(n,t)),t=n)}return this.push(e,t),this.nodes},e}()},{"../../../messages":43,"../../../types":153}],87:[function(e,t,n){"use strict";function r(e,t,n,r){if(this.get("right").isArrayExpression())return l.call(this,e,n,r);var i=c;r.isLoose("es6.forOf")&&(i=p);var s=i(e,t,n,r),a=s.declar,u=s.loop,d=u.body;o.inheritsComments(u,e),o.ensureBlock(e),a&&d.body.push(a),d.body=d.body.concat(e.body.body),o.inherits(u,e),s.replaceParent?(this.parentPath.replaceWithMultiple(s.node),this.remove()):this.replaceWithMultiple(s.node)}function l(e,t){var n=[],r=e.right;if(!o.isIdentifier(r)||!t.hasBinding(r.name)){var l=t.generateUidIdentifier("arr");n.push(o.variableDeclaration("var",[o.variableDeclarator(l,r)])),r=l}var i=t.generateUidIdentifier("i"),s=a.template("for-of-array",{BODY:e.body,KEY:i,ARR:r});o.inherits(s,e),o.ensureBlock(s);var u=o.memberExpression(r,i,!0),p=e.left;return o.isVariableDeclaration(p)?(p.declarations[0].init=u,s.body.body.unshift(p)):s.body.body.unshift(o.expressionStatement(o.assignmentExpression("=",p,u))),n.push(s),n}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.ForOfStatement=r,n._ForOfStatementArray=l,n.__esModule=!0;var s=i(e("../../../messages")),a=i(e("../../../util")),o=i(e("../../../types")),u=o.isForOfStatement;n.check=u;var p=function(e,t,n,r){var l,i,u=e.left;if(o.isIdentifier(u)||o.isPattern(u)||o.isMemberExpression(u))i=u;else{if(!o.isVariableDeclaration(u))throw r.errorWithNode(u,s.get("unknownForHead",u.type));i=n.generateUidIdentifier("ref"),l=o.variableDeclaration(u.kind,[o.variableDeclarator(u.declarations[0].id,i)])}var p=n.generateUidIdentifier("iterator"),c=n.generateUidIdentifier("isArray"),d=a.template("for-of-loose",{LOOP_OBJECT:p,IS_ARRAY:c,OBJECT:e.right,INDEX:n.generateUidIdentifier("i"),ID:i});return l||d.body.body.shift(),{declar:l,node:d,loop:d}},c=function(e,t,n,r){var l,i=e.left,u=n.generateUidIdentifier("step"),p=o.memberExpression(u,o.identifier("value"));if(o.isIdentifier(i)||o.isPattern(i)||o.isMemberExpression(i))l=o.expressionStatement(o.assignmentExpression("=",i,p));else{if(!o.isVariableDeclaration(i))throw r.errorWithNode(i,s.get("unknownForHead",i.type));l=o.variableDeclaration(i.kind,[o.variableDeclarator(i.declarations[0].id,p)])}var c=n.generateUidIdentifier("iterator"),d=a.template("for-of",{ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:c,STEP_KEY:u,OBJECT:e.right,BODY:null}),f=o.isLabeledStatement(t),h=d[3].block.body,m=h[0];return f&&(h[0]=o.labeledStatement(t.label,m)),{replaceParent:f,declar:l,loop:m,node:d}}},{"../../../messages":43,"../../../types":153,"../../../util":157}],88:[function(e,t,n){"use strict";function r(e,t){if(e._blockHoist)for(var n=0;n<t.length;n++)t[n]._blockHoist=e._blockHoist}function l(e,t,n,r){if(!e.isType){var l=[];if(e.specifiers.length)for(var i=0;i<e.specifiers.length;i++)r.moduleFormatter.importSpecifier(e.specifiers[i],e,l,t);else r.moduleFormatter.importDeclaration(e,l,t);return 1===l.length&&(l[0]._blockHoist=e._blockHoist),l}}function i(e,t,n,l){var i=[];return l.moduleFormatter.exportAllDeclaration(e,i,t),r(e,i),i}function s(e,t,n,l){var i=[];return l.moduleFormatter.exportDeclaration(e,i,t),r(e,i),i}function a(e,t,n,l){if(!this.get("declaration").isTypeAlias()){var i=[];if(e.declaration){if(u.isVariableDeclaration(e.declaration)){var s=e.declaration.declarations[0];s.init=s.init||u.identifier("undefined")}l.moduleFormatter.exportDeclaration(e,i,t)}else if(e.specifiers)for(var a=0;a<e.specifiers.length;a++)l.moduleFormatter.exportSpecifier(e.specifiers[a],e,i,t);return r(e,i),i}}var o=function(e){return e&&e.__esModule?e:{"default":e}};n.ImportDeclaration=l,n.ExportAllDeclaration=i,n.ExportDefaultDeclaration=s,n.ExportNamedDeclaration=a,n.__esModule=!0;var u=o(e("../../../types"));n.check=e("../internal/modules").check},{"../../../types":153,"../internal/modules":115}],89:[function(e,t,n){"use strict";function r(e,t,n,r,l){if(t.method){var i=t.value,s=n.generateUidIdentifier("this"),u=new a({topLevelThisReference:s,getObjectRef:r,methodNode:t,methodPath:e,isStatic:!0,scope:n,file:l});u.replace(),u.hasSuper&&i.body.body.unshift(o.variableDeclaration("var",[o.variableDeclarator(s,o.thisExpression())]))}}function l(e,t,n,l){for(var i,s=function(){return!i&&(i=n.generateUidIdentifier("obj")),i},a=this.get("properties"),u=0;u<e.properties.length;u++)r(a[u],e.properties[u],n,s,l);return i?(n.push({id:i}),o.assignmentExpression("=",i,e)):void 0}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};n.ObjectExpression=l,n.__esModule=!0;var a=s(e("../../helpers/replace-supers")),o=i(e("../../../types")),u=o.isSuper;n.check=u},{"../../../types":153,"../../helpers/replace-supers":61}],90:[function(e,t,n){"use strict";function r(e){return o.isFunction(e)&&u(e)}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e};n.check=r,n.__esModule=!0;var s=i(e("../../helpers/call-delegate")),a=l(e("../../../util")),o=l(e("../../../types")),u=function(e){for(var t=0;t<e.params.length;t++)if(!o.isIdentifier(e.params[t]))return!0;return!1},p={enter:function(e,t,n,r){this.isReferencedIdentifier()&&r.scope.hasOwnBinding(e.name)&&(r.scope.bindingIdentifierEquals(e.name,e)||(r.iife=!0,this.stop()))}};n.Function=function(e,t,n,r){if(u(e)){o.ensureBlock(e);var l=[],i=o.identifier("arguments");i._shadowedFunctionLiteral=!0;for(var c=0,d={iife:!1,scope:n},f=function(t,n,s){var u=a.template("default-parameter",{VARIABLE_NAME:t,DEFAULT_VALUE:n,ARGUMENT_KEY:o.literal(s),ARGUMENTS:i},!0);r.checkNode(u),u._blockHoist=e.params.length-s,l.push(u)},h=this.get("params"),m=0;m<h.length;m++){var g=h[m];if(g.isAssignmentPattern()){var y=g.get("left"),b=g.get("right"),v=n.generateUidIdentifier("x");v._isDefaultPlaceholder=!0,e.params[m]=v,d.iife||(b.isIdentifier()&&n.hasOwnBinding(b.node.name)?d.iife=!0:b.traverse(p,d)),f(y.node,b.node,m)}else g.isRestElement()||(c=m+1),g.isIdentifier()||g.traverse(p,d),r.transformers["es6.spec.blockScoping"].canTransform()&&g.isIdentifier()&&f(g.node,o.identifier("undefined"),m)}e.params=e.params.slice(0,c),d.iife?(l.push(s(e)),e.body=o.blockStatement(l)):e.body.body=l.concat(e.body.body)}}},{"../../../types":153,"../../../util":157,"../../helpers/call-delegate":53}],91:[function(e,t,n){"use strict";function r(e,t){var n,r=e.property;o.isLiteral(r)?(r.value+=t,r.raw=String(r.value)):(n=o.binaryExpression("+",r,o.literal(t)),e.property=n)}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e};n.__esModule=!0;var s=i(e("lodash/lang/isNumber")),a=l(e("../../../util")),o=l(e("../../../types")),u=o.isRestElement;n.check=u;var p={enter:function(e,t,n,r){if(this.isScope()&&!n.bindingIdentifierEquals(r.name,r.outerBinding))return this.skip();if(this.isFunctionDeclaration()||this.isFunctionExpression())return r.noOptimise=!0,this.traverse(p,r),r.noOptimise=!1,this.skip();if(this.isReferencedIdentifier({name:r.name})){if(!r.noOptimise&&o.isMemberExpression(t)&&t.computed){var l=t.property;if(s(l.value)||o.isUnaryExpression(l)||o.isBinaryExpression(l))return void r.candidates.push(this)}r.canOptimise=!1,this.stop()}}},c=function(e){return o.isRestElement(e.params[e.params.length-1])};n.Function=function(e,t,n,l){if(c(e)){var i=e.params.pop().argument,s=o.identifier("arguments");if(s._shadowedFunctionLiteral=!0,o.isPattern(i)){var u=i;i=n.generateUidIdentifier("ref");var d=o.variableDeclaration("let",u.elements.map(function(e,t){var n=o.memberExpression(i,o.literal(t),!0);return o.variableDeclarator(e,n)}));l.checkNode(d),e.body.body.unshift(d)}var f={outerBinding:n.getBindingIdentifier(i.name),canOptimise:!0,candidates:[],method:e,name:i.name};if(this.traverse(p,f),f.canOptimise&&f.candidates.length)for(var h=0;h<f.candidates.length;h++){var m=f.candidates[h];m.replaceWith(s),r(m.parent,e.params.length)}else{var g=o.literal(e.params.length),y=n.generateUidIdentifier("key"),b=n.generateUidIdentifier("len"),v=y,x=b;e.params.length&&(v=o.binaryExpression("-",y,g),x=o.conditionalExpression(o.binaryExpression(">",b,g),o.binaryExpression("-",b,g),o.literal(0)));var E=a.template("rest",{ARGUMENTS:s,ARRAY_KEY:v,ARRAY_LEN:x,START:g,ARRAY:i,KEY:y,LEN:b});E._blockHoist=e.params.length+1,e.body.body.unshift(E)}}}},{"../../../types":153,"../../../util":157,"lodash/lang/isNumber":395}],92:[function(e,t,n){"use strict";function r(e,t,n){for(var r=0;r<e.properties.length;r++){var l=e.properties[r];t.push(o.expressionStatement(o.assignmentExpression("=",o.memberExpression(n,l.key,l.computed||o.isLiteral(l.key)),l.value)))}}function l(e,t,n,r,l){for(var i,s,a=e.properties,u=0;u<a.length;u++)i=a[u],"init"===i.kind&&(s=i.key,!i.computed&&o.isIdentifier(s)&&(i.key=o.literal(s.name)));var p=!1;for(u=0;u<a.length;u++)i=a[u],i.computed&&(p=!0),("init"!==i.kind||!p||o.isLiteral(o.toComputedKey(i,i.key),{value:"__proto__"}))&&(r.push(i),a[u]=null);for(u=0;u<a.length;u++)if(i=a[u]){s=i.key;var c;c=i.computed&&o.isMemberExpression(s)&&o.isIdentifier(s.object,{name:"Symbol"})?o.assignmentExpression("=",o.memberExpression(n,s,!0),i.value):o.callExpression(l.addHelper("define-property"),[n,s,i.value]),t.push(o.expressionStatement(c))}if(1===t.length){var d=t[0].expression;if(o.isCallExpression(d))return d.arguments[0]=o.objectExpression(r),d}}function i(e){return o.isProperty(e)&&e.computed}function s(e,t,n,i){for(var s=!1,a=0;a<e.properties.length&&!(s=o.isProperty(e.properties[a],{computed:!0,kind:"init"}));a++);if(s){var u=[],p=n.generateUidBasedOnNode(t),c=[],d=l;i.isLoose("es6.properties.computed")&&(d=r);var f=d(e,c,p,u,i);return f?f:(c.unshift(o.variableDeclaration("var",[o.variableDeclarator(p,o.objectExpression(u))])),c.push(o.expressionStatement(p)),c)}}var a=function(e){return e&&e.__esModule?e:{"default":e}};n.check=i,n.ObjectExpression=s,n.__esModule=!0;var o=a(e("../../../types"))},{"../../../types":153}],93:[function(e,t,n){"use strict";function r(e){return s.isProperty(e)&&(e.method||e.shorthand)}function l(e){e.method&&(e.method=!1),e.shorthand&&(e.shorthand=!1,e.key=s.removeComments(s.clone(e.key)))}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.Property=l,n.__esModule=!0;var s=i(e("../../../types"))},{"../../../types":153}],94:[function(e,t,n){"use strict";function r(e){return s.is(e,"y")}function l(e){return s.is(e,"y")?a.newExpression(a.identifier("RegExp"),[a.literal(e.regex.pattern),a.literal(e.regex.flags)]):void 0}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.Literal=l,n.__esModule=!0;var s=i(e("../../helpers/regex")),a=i(e("../../../types"))},{"../../../types":153,"../../helpers/regex":59}],95:[function(e,t,n){"use strict";function r(e){return o.is(e,"u")}function l(e){o.is(e,"u")&&(e.regex.pattern=a(e.regex.pattern,e.regex.flags),o.pullFlag(e,"u"))}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};n.check=r,n.Literal=l,n.__esModule=!0;var a=s(e("regexpu/rewrite-pattern")),o=i(e("../../helpers/regex"))},{"../../helpers/regex":59,"regexpu/rewrite-pattern":434}],96:[function(e,t,n){"use strict";function r(e,t,n,r){var l=e._letReferences;l&&this.traverse(s,{letRefs:l,file:r})}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.BlockStatement=r,n.__esModule=!0;var i=l(e("../../../types")),s={enter:function(e,t,n,r){if(this.isReferencedIdentifier()&&(!i.isFor(t)||t.left!==e)){var l=r.letRefs[e.name];if(l&&n.getBindingIdentifier(e.name)===l){var s=i.callExpression(r.file.addHelper("temporal-assert-defined"),[e,i.literal(e.name),r.file.addHelper("temporal-undefined")]);return this.skip(),i.isAssignmentExpression(t)||i.isUpdateExpression(t)?void(t._ignoreBlockScopingTDZ||this.parentPath.replaceWith(i.sequenceExpression([s,t]))):i.logicalExpression("&&",s,e)}}}},a={optional:!0};n.metadata=a,n.Program=r,n.Loop=r},{"../../../types":153}],97:[function(e,t,n){"use strict";function r(e,t,n,r){if(this.skip(),"typeof"===e.operator){var l=i.callExpression(r.addHelper("typeof"),[e.argument]);if(this.get("argument").isIdentifier()){var s=i.literal("undefined");return i.conditionalExpression(i.binaryExpression("===",i.unaryExpression("typeof",e.argument),s),s,l)}return l}}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.UnaryExpression=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0};n.metadata=s},{"../../../types":153}],98:[function(e,t,n){"use strict";function r(e,t){if(!i.isTaggedTemplateExpression(t))for(var n=0;n<e.expressions.length;n++)e.expressions[n]=i.callExpression(i.identifier("String"),[e.expressions[n]])}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.TemplateLiteral=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0};n.metadata=s},{"../../../types":153}],99:[function(e,t,n){"use strict";function r(e,t){return t.file.isLoose("es6.spread")?e.argument:t.toArray(e.argument,!0)}function l(e){for(var t=0;t<e.length;t++)if(c.isSpreadElement(e[t]))return!0; return!1}function i(e,t){for(var n=[],l=[],i=function(){l.length&&(n.push(c.arrayExpression(l)),l=[])},s=0;s<e.length;s++){var a=e[s];c.isSpreadElement(a)?(i(),n.push(r(a,t))):l.push(a)}return i(),n}function s(e,t,n){var r=e.elements;if(l(r)){var s=i(r,n),a=s.shift();return c.isArrayExpression(a)||(s.unshift(a),a=c.arrayExpression([])),c.callExpression(c.memberExpression(a,c.identifier("concat")),s)}}function a(e,t,n){var r=e.arguments;if(l(r)){var s=c.identifier("undefined");e.arguments=[];var a;a=1===r.length&&"arguments"===r[0].argument.name?[r[0].argument]:i(r,n);var o=a.shift();e.arguments.push(a.length?c.callExpression(c.memberExpression(o,c.identifier("concat")),a):o);var u=e.callee;if(this.get("callee").isMemberExpression()){var p=n.generateMemoisedReference(u.object);p?(u.object=c.assignmentExpression("=",p,u.object),s=p):s=u.object,c.appendToMemberExpression(u,c.identifier("apply"))}else e.callee=c.memberExpression(e.callee,c.identifier("apply"));e.arguments.unshift(s)}}function o(e,t,n,r){var s=e.arguments;if(l(s)){var a=i(s,n),o=c.arrayExpression([c.literal(null)]);return s=c.callExpression(c.memberExpression(o,c.identifier("concat")),a),c.newExpression(c.callExpression(c.memberExpression(r.addHelper("bind"),c.identifier("apply")),[e.callee,s]),[])}}var u=function(e){return e&&e.__esModule?e:{"default":e}},p=function(e){return e&&e.__esModule?e["default"]:e};n.ArrayExpression=s,n.CallExpression=a,n.NewExpression=o,n.__esModule=!0;var c=(p(e("lodash/collection/includes")),u(e("../../../types"))),d=c.isSpreadElement;n.check=d},{"../../../types":153,"lodash/collection/includes":319}],100:[function(e,t,n){"use strict";function r(e){return d.blockStatement([d.returnStatement(e)])}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=i(e("lodash/collection/reduceRight")),o=l(e("../../../messages")),u=i(e("lodash/array/flatten")),p=l(e("../../../util")),c=i(e("lodash/collection/map")),d=l(e("../../../types"));n.Function=function(e,t,n,r){var l=new g(this,n,r);l.run()};var f={enter:function(e,t,n,r){if(this.isIfStatement())this.get("alternate").isReturnStatement()&&d.ensureBlock(e,"alternate"),this.get("consequent").isReturnStatement()&&d.ensureBlock(e,"consequent");else{if(this.isReturnStatement())return this.skip(),r.subTransform(e.argument);d.isTryStatement(t)?e===t.block?this.skip():t.finalizer&&e!==t.finalizer&&this.skip():this.isFunction()?this.skip():this.isVariableDeclaration()&&(this.skip(),r.vars.push(e))}}},h={enter:function(e,t,n,r){return this.isThisExpression()?(r.needsThis=!0,r.getThisId()):this.isReferencedIdentifier({name:"arguments"})?(r.needsArguments=!0,r.getArgumentsId()):this.isFunction()&&(this.skip(),this.isFunctionDeclaration())?(e=d.variableDeclaration("var",[d.variableDeclarator(e.id,d.toExpression(e))]),e._blockHoist=2,e):void 0}},m={enter:function(e,t,n,r){if(this.isExpressionStatement()){var l=e.expression;if(d.isAssignmentExpression(l))if(r.needsThis||l.left!==r.getThisId()){if(!r.needsArguments&&l.left===r.getArgumentsId()&&d.isArrayExpression(l.right))return c(l.right.elements,function(e){return d.expressionStatement(e)})}else this.remove()}}},g=function(){function e(t,n,r){s(this,e),this.hasTailRecursion=!1,this.needsArguments=!1,this.setsArguments=!1,this.needsThis=!1,this.ownerId=t.node.id,this.vars=[],this.scope=n,this.path=t,this.file=r,this.node=t.node}return e.prototype.getArgumentsId=function(){var e;return e=this,!e.argumentsId&&(e.argumentsId=this.scope.generateUidIdentifier("arguments")),e.argumentsId},e.prototype.getThisId=function(){var e;return e=this,!e.thisId&&(e.thisId=this.scope.generateUidIdentifier("this")),e.thisId},e.prototype.getLeftId=function(){var e;return e=this,!e.leftId&&(e.leftId=this.scope.generateUidIdentifier("left")),e.leftId},e.prototype.getFunctionId=function(){var e;return e=this,!e.functionId&&(e.functionId=this.scope.generateUidIdentifier("function")),e.functionId},e.prototype.getAgainId=function(){var e;return e=this,!e.againId&&(e.againId=this.scope.generateUidIdentifier("again")),e.againId},e.prototype.getParams=function(){var e=this.params;if(!e){e=this.node.params,this.paramDecls=[];for(var t=0;t<e.length;t++){var n=e[t];n._isDefaultPlaceholder||this.paramDecls.push(d.variableDeclarator(n,e[t]=this.scope.generateUidIdentifier("x")))}}return this.params=e},e.prototype.hasDeopt=function(){var e=this.scope.getBinding(this.ownerId.name);return e&&!e.constant},e.prototype.run=function(){var e=(this.scope,this.node),t=this.ownerId;if(t&&(this.path.traverse(f,this),this.hasTailRecursion)){if(this.hasDeopt())return void this.file.log.deopt(e,o.get("tailCallReassignmentDeopt"));this.path.traverse(h,this),this.needsThis&&this.needsArguments||this.path.traverse(m,this);var n=d.ensureBlock(e).body;if(this.vars.length>0){var r=u(c(this.vars,function(e){return e.declarations},this)),l=a(r,function(e,t){return d.assignmentExpression("=",t.id,e)},d.identifier("undefined")),i=d.expressionStatement(l);i._blockHoist=1/0,n.unshift(i)}var s=this.paramDecls;s.length>0&&n.unshift(d.variableDeclaration("var",s)),n.unshift(d.expressionStatement(d.assignmentExpression("=",this.getAgainId(),d.literal(!1)))),e.body=p.template("tail-call-body",{AGAIN_ID:this.getAgainId(),THIS_ID:this.thisId,ARGUMENTS_ID:this.argumentsId,FUNCTION_ID:this.getFunctionId(),BLOCK:e.body});var g=[];if(this.needsThis&&g.push(d.variableDeclarator(this.getThisId(),d.thisExpression())),this.needsArguments||this.setsArguments){var y=d.variableDeclarator(this.getArgumentsId());this.needsArguments&&(y.init=d.identifier("arguments")),g.push(y)}var b=this.leftId;b&&g.push(d.variableDeclarator(b)),g.length>0&&e.body.body.unshift(d.variableDeclaration("var",g))}},e.prototype.subTransform=function(e){if(e){var t=this["subTransform"+e.type];return t?t.call(this,e):void 0}},e.prototype.subTransformConditionalExpression=function(e){var t=this.subTransform(e.consequent),n=this.subTransform(e.alternate);return t||n?(e.type="IfStatement",e.consequent=t?d.toBlock(t):r(e.consequent),e.alternate=n?d.isIfStatement(n)?n:d.toBlock(n):r(e.alternate),[e]):void 0},e.prototype.subTransformLogicalExpression=function(e){var t=this.subTransform(e.right);if(t){var n=this.getLeftId(),l=d.assignmentExpression("=",n,e.left);return"&&"===e.operator&&(l=d.unaryExpression("!",l)),[d.ifStatement(l,r(n))].concat(t)}},e.prototype.subTransformSequenceExpression=function(e){var t=e.expressions,n=this.subTransform(t[t.length-1]);return n?(1===--t.length&&(e=t[0]),[d.expressionStatement(e)].concat(n)):void 0},e.prototype.subTransformCallExpression=function(e){var t,n,r=e.callee;if(d.isMemberExpression(r,{computed:!1})&&d.isIdentifier(r.property)){switch(r.property.name){case"call":n=d.arrayExpression(e.arguments.slice(1));break;case"apply":n=e.arguments[1]||d.identifier("undefined");break;default:return}t=e.arguments[0],r=r.object}if(d.isIdentifier(r)&&this.scope.bindingIdentifierEquals(r.name,this.ownerId)&&(this.hasTailRecursion=!0,!this.hasDeopt())){var l=[];d.isThisExpression(t)||l.push(d.expressionStatement(d.assignmentExpression("=",this.getThisId(),t||d.identifier("undefined")))),n||(n=d.arrayExpression(e.arguments));var i=this.getArgumentsId(),s=this.getParams();l.push(d.expressionStatement(d.assignmentExpression("=",i,n)));var a,o;if(d.isArrayExpression(n)){var u=n.elements;for(a=0;a<u.length&&a<s.length;a++){o=s[a];var p=u[a]||(u[a]=d.identifier("undefined"));o._isDefaultPlaceholder||(u[a]=d.assignmentExpression("=",o,p))}}else for(this.setsArguments=!0,a=0;a<s.length;a++)o=s[a],o._isDefaultPlaceholder||l.push(d.expressionStatement(d.assignmentExpression("=",o,d.memberExpression(i,d.literal(a),!0))));return l.push(d.expressionStatement(d.assignmentExpression("=",this.getAgainId(),d.literal(!0)))),l.push(d.continueStatement(this.getFunctionId())),l}},e}()},{"../../../messages":43,"../../../types":153,"../../../util":157,"lodash/array/flatten":311,"lodash/collection/map":320,"lodash/collection/reduceRight":321}],101:[function(e,t,n){"use strict";function r(e){return a.isTemplateLiteral(e)||a.isTaggedTemplateExpression(e)}function l(e,t,n,r){for(var l=e.quasi,i=[],s=[],o=[],u=0;u<l.quasis.length;u++){var p=l.quasis[u];s.push(a.literal(p.value.cooked)),o.push(a.literal(p.value.raw))}s=a.arrayExpression(s),o=a.arrayExpression(o);var c="tagged-template-literal";return r.isLoose("es6.templateLiterals")&&(c+="-loose"),i.push(a.callExpression(r.addHelper(c),[s,o])),i=i.concat(l.expressions),a.callExpression(e.tag,i)}function i(e){var t,n=[];for(t=0;t<e.quasis.length;t++){var r=e.quasis[t];n.push(a.literal(r.value.cooked));var l=e.expressions.shift();l&&n.push(l)}if(n.length>1){var i=n[n.length-1];a.isLiteral(i,{value:""})&&n.pop();var s=o(n.shift(),n.shift());for(t=0;t<n.length;t++)s=o(s,n[t]);return s}return n[0]}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.TaggedTemplateExpression=l,n.TemplateLiteral=i,n.__esModule=!0;var a=s(e("../../../types")),o=function(e,t){return a.binaryExpression("+",e,t)}},{"../../../types":153}],102:[function(e,t,n){"use strict";function r(){return!1}n.check=r,n.__esModule=!0;var l={stage:1};n.metadata=l},{}],103:[function(e,t,n){"use strict";function r(){return!1}n.check=r,n.__esModule=!0;var l={stage:0};n.metadata=l},{}],104:[function(e,t,n){"use strict";function r(e,t,n,r){var s=i;return e.generator&&(s=l),s(e,t,n,r)}function l(e){var t=[],n=c.functionExpression(null,[],c.blockStatement(t),!0);return n.shadow=!0,t.push(o(e,function(){return c.expressionStatement(c.yieldExpression(e.body))})),c.callExpression(n,[])}function i(e,t,n){var r=n.generateUidBasedOnNode(t),l=p.template("array-comprehension-container",{KEY:r});l.callee.shadow=!0;var i=l.callee.body,s=i.body;u.hasType(e,n,"YieldExpression",c.FUNCTION_TYPES)&&(l.callee.generator=!0,l=c.yieldExpression(l,!0));var a=s.pop();return s.push(o(e,function(){return p.template("array-push",{STATEMENT:e.body,KEY:r},!0)})),s.push(a),l}var s=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e};n.ComprehensionExpression=r,n.__esModule=!0;var o=a(e("../../helpers/build-comprehension")),u=a(e("../../../traversal")),p=s(e("../../../util")),c=s(e("../../../types")),d={stage:0};n.metadata=d},{"../../../traversal":144,"../../../types":153,"../../../util":157,"../../helpers/build-comprehension":51}],105:[function(e,t,n){"use strict";n.__esModule=!0;var r={optional:!0,stage:1};n.metadata=r},{}],106:[function(e,t,n){"use strict";function r(e){var t=e.body.body;return t.length?t:i.identifier("undefined")}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.DoExpression=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0,stage:0};n.metadata=s;var a=i.isDoExpression;n.check=a},{"../../../types":153}],107:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},l=function(e){return e&&e.__esModule?e["default"]:e};n.__esModule=!0;var i=l(e("../../helpers/build-binary-assignment-operator-transformer")),s=r(e("../../../types")),a={stage:2};n.metadata=a;var o=s.memberExpression(s.identifier("Math"),s.identifier("pow"));i(n,{operator:"**",build:function(e,t){return s.callExpression(o,[e,t])}})},{"../../../types":153,"../../helpers/build-binary-assignment-operator-transformer":50}],108:[function(e,t,n){"use strict";function r(e){return a.isExportDefaultSpecifier(e)||a.isExportNamespaceSpecifier(e)}function l(e,t,n){var r=e.specifiers[0];if(a.isExportNamespaceSpecifier(r)||a.isExportDefaultSpecifier(r)){var i,s=e.specifiers.shift(),o=n.generateUidIdentifier(s.exported.name);i=a.isExportNamespaceSpecifier(s)?a.importNamespaceSpecifier(o):a.importDefaultSpecifier(o),t.push(a.importDeclaration([i],e.source)),t.push(a.exportNamedDeclaration(null,[a.exportSpecifier(o,s.exported)])),l(e,t,n)}}function i(e,t,n){var r=[];return l(e,r,n),r.length?(e.specifiers.length>=1&&r.push(e),r):void 0}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.ExportNamedDeclaration=i,n.__esModule=!0;var a=s(e("../../../types")),o={stage:1};n.metadata=o},{"../../../types":153}],109:[function(e,t,n){"use strict";function r(e){e.whitelist&&e.whitelist.push("es6.destructuring")}function l(e,t,n,r){if(o(e)){for(var l=[],i=[],a=function(){i.length&&(l.push(s.objectExpression(i)),i=[])},u=0;u<e.properties.length;u++){var p=e.properties[u];s.isSpreadProperty(p)?(a(),l.push(p.argument)):i.push(p)}return a(),s.isObjectExpression(l[0])||l.unshift(s.objectExpression([])),s.callExpression(r.addHelper("extends"),l)}}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.manipulateOptions=r,n.ObjectExpression=l,n.__esModule=!0;var s=i(e("../../../types")),a={stage:1};n.metadata=a;var o=function(e){for(var t=0;t<e.properties.length;t++)if(s.isSpreadProperty(e.properties[t]))return!0;return!1}},{"../../../types":153}],110:[function(e,t){"use strict";t.exports={"es7.classProperties":e("./es7/class-properties"),"es7.asyncFunctions":e("./es7/async-functions"),"es7.decorators":e("./es7/decorators"),strict:e("./other/strict"),_validation:e("./internal/validation"),"validation.undeclaredVariableCheck":e("./validation/undeclared-variable-check"),"validation.react":e("./validation/react"),"spec.functionName":e("./spec/function-name"),"es6.arrowFunctions":e("./es6/arrow-functions"),"spec.blockScopedFunctions":e("./spec/block-scoped-functions"),"optimisation.react.constantElements":e("./optimisation/react.constant-elements"),"optimisation.react.inlineElements":e("./optimisation/react.inline-elements"),reactCompat:e("./other/react-compat"),react:e("./other/react"),_modules:e("./internal/modules"),"es7.comprehensions":e("./es7/comprehensions"),"es6.classes":e("./es6/classes"),asyncToGenerator:e("./other/async-to-generator"),bluebirdCoroutines:e("./other/bluebird-coroutines"),"es6.objectSuper":e("./es6/object-super"),"es7.objectRestSpread":e("./es7/object-rest-spread"),"es7.exponentiationOperator":e("./es7/exponentiation-operator"),"es6.spec.templateLiterals":e("./es6/spec.template-literals"),"es6.templateLiterals":e("./es6/template-literals"),"es5.properties.mutators":e("./es5/properties.mutators"),"es6.properties.shorthand":e("./es6/properties.shorthand"),"es6.properties.computed":e("./es6/properties.computed"),"optimisation.flow.forOf":e("./optimisation/flow.for-of"),"es6.forOf":e("./es6/for-of"),"es6.regex.sticky":e("./es6/regex.sticky"),"es6.regex.unicode":e("./es6/regex.unicode"),"es6.constants":e("./es6/constants"),"es6.parameters.rest":e("./es6/parameters.rest"),"es6.spread":e("./es6/spread"),"es6.parameters.default":e("./es6/parameters.default"),"es6.destructuring":e("./es6/destructuring"),"es6.blockScoping":e("./es6/block-scoping"),"es6.spec.blockScoping":e("./es6/spec.block-scoping"),"es6.tailCall":e("./es6/tail-call"),regenerator:e("./other/regenerator"),runtime:e("./other/runtime"),"es7.exportExtensions":e("./es7/export-extensions"),"es6.modules":e("./es6/modules"),_blockHoist:e("./internal/block-hoist"),"spec.protoToAssign":e("./spec/proto-to-assign"),_declarations:e("./internal/declarations"),_shadowFunctions:e("./internal/shadow-functions"),"es7.doExpressions":e("./es7/do-expressions"),"es6.spec.symbols":e("./es6/spec.symbols"),ludicrous:e("./other/ludicrous"),"spec.undefinedToVoid":e("./spec/undefined-to-void"),_strict:e("./internal/strict"),_moduleFormatter:e("./internal/module-formatter"),"es3.propertyLiterals":e("./es3/property-literals"),"es3.memberExpressionLiterals":e("./es3/member-expression-literals"),"utility.removeDebugger":e("./utility/remove-debugger"),"utility.removeConsole":e("./utility/remove-console"),"utility.inlineEnvironmentVariables":e("./utility/inline-environment-variables"),"utility.inlineExpressions":e("./utility/inline-expressions"),"utility.deadCodeElimination":e("./utility/dead-code-elimination"),flow:e("./other/flow"),_cleanUp:e("./internal/cleanup")}},{"./es3/member-expression-literals":79,"./es3/property-literals":80,"./es5/properties.mutators":81,"./es6/arrow-functions":82,"./es6/block-scoping":83,"./es6/classes":84,"./es6/constants":85,"./es6/destructuring":86,"./es6/for-of":87,"./es6/modules":88,"./es6/object-super":89,"./es6/parameters.default":90,"./es6/parameters.rest":91,"./es6/properties.computed":92,"./es6/properties.shorthand":93,"./es6/regex.sticky":94,"./es6/regex.unicode":95,"./es6/spec.block-scoping":96,"./es6/spec.symbols":97,"./es6/spec.template-literals":98,"./es6/spread":99,"./es6/tail-call":100,"./es6/template-literals":101,"./es7/async-functions":102,"./es7/class-properties":103,"./es7/comprehensions":104,"./es7/decorators":105,"./es7/do-expressions":106,"./es7/exponentiation-operator":107,"./es7/export-extensions":108,"./es7/object-rest-spread":109,"./internal/block-hoist":111,"./internal/cleanup":112,"./internal/declarations":113,"./internal/module-formatter":114,"./internal/modules":115,"./internal/shadow-functions":116,"./internal/strict":117,"./internal/validation":118,"./optimisation/flow.for-of":119,"./optimisation/react.constant-elements":120,"./optimisation/react.inline-elements":121,"./other/async-to-generator":122,"./other/bluebird-coroutines":123,"./other/flow":124,"./other/ludicrous":125,"./other/react":127,"./other/react-compat":126,"./other/regenerator":128,"./other/runtime":129,"./other/strict":130,"./spec/block-scoped-functions":131,"./spec/function-name":132,"./spec/proto-to-assign":133,"./spec/undefined-to-void":134,"./utility/dead-code-elimination":135,"./utility/inline-environment-variables":136,"./utility/inline-expressions":137,"./utility/remove-console":138,"./utility/remove-debugger":139,"./validation/react":140,"./validation/undeclared-variable-check":141}],111:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e};n.__esModule=!0;var l=r(e("lodash/collection/groupBy")),i=r(e("lodash/array/flatten")),s=r(e("lodash/object/values")),a={exit:function(e){for(var t=!1,n=0;n<e.body.length;n++){var r=e.body[n];r&&null!=r._blockHoist&&(t=!0)}if(t){var a=l(e.body,function(e){var t=e&&e._blockHoist;return null==t&&(t=1),t===!0&&(t=2),t});e.body=i(s(a).reverse())}}};n.BlockStatement=a,n.Program=a},{"lodash/array/flatten":311,"lodash/collection/groupBy":318,"lodash/object/values":409}],112:[function(e,t,n){"use strict";n.__esModule=!0;var r={exit:function(e){return 1===e.expressions.length?e.expressions[0]:void(e.expressions.length||this.remove())}};n.SequenceExpression=r;var l={exit:function(e){e.expression||this.remove()}};n.ExpressionStatement=l;var i={exit:function(e){var t=e.right,n=e.left;if(n||t){if(!n)return t;if(!t)return n}else this.remove()}};n.Binary=i},{}],113:[function(e,t,n){"use strict";function r(e,t,n,r){e._declarations&&i.wrap(e,function(){var t,n={};for(var l in e._declarations){var i=e._declarations[l];t=i.kind||"var";var a=s.variableDeclarator(i.id,i.init);if(i.init)e.body.unshift(r.attachAuxiliaryComment(s.variableDeclaration(t,[a])));else{var o=n,u=t;o[u]||(o[u]=[]),n[t].push(a)}}for(t in n)e.body.unshift(r.attachAuxiliaryComment(s.variableDeclaration(t,n[t])));e._declarations=null})}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.BlockStatement=r,n.__esModule=!0;var i=l(e("../../helpers/strict")),s=l(e("../../../types")),a={secondPass:!0};n.metadata=a,n.Program=r},{"../../../types":153,"../../helpers/strict":62}],114:[function(e,t,n){"use strict";function r(e,t,n,r){i.wrap(e,function(){e.body=r.dynamicImports.concat(e.body)}),r.transformers["es6.modules"].canTransform()&&r.moduleFormatter.transform&&r.moduleFormatter.transform(e)}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.Program=r,n.__esModule=!0;var i=l(e("../../helpers/strict"))},{"../../helpers/strict":62}],115:[function(e,t,n){"use strict";function r(e){return u.isImportDeclaration(e)||u.isExportDeclaration(e)}function l(e,t,n,r){e.source&&(e.source.value=r.resolveModuleSource(e.source.value))}function i(e,t,n){l.apply(this,arguments);var r=e.declaration,i=function(){return r._ignoreUserWhitespace=!0,r};if(u.isClassDeclaration(r))return e.declaration=r.id,[i(),e];if(u.isClassExpression(r)){var s=n.generateUidIdentifier("default");return r=u.variableDeclaration("var",[u.variableDeclarator(s,r)]),e.declaration=s,[i(),e]}return u.isFunctionDeclaration(r)?(e._blockHoist=2,e.declaration=r.id,[i(),e]):void 0}function s(e){l.apply(this,arguments);var t=e.declaration,n=function(){return t._ignoreUserWhitespace=!0,t};if(u.isClassDeclaration(t))return e.specifiers=[u.exportSpecifier(t.id,t.id)],e.declaration=null,[n(),e];if(u.isFunctionDeclaration(t))return e.specifiers=[u.exportSpecifier(t.id,t.id)],e.declaration=null,e._blockHoist=2,[n(),e];if(u.isVariableDeclaration(t)){var r=[],i=this.get("declaration").getBindingIdentifiers();for(var s in i){var a=i[s];r.push(u.exportSpecifier(a,a))}return[t,u.exportNamedDeclaration(null,r)]}}function a(e){for(var t=[],n=[],r=0;r<e.body.length;r++){var l=e.body[r];u.isImportDeclaration(l)?t.push(l):n.push(l)}e.body=t.concat(n)}var o=function(e){return e&&e.__esModule?e:{"default":e}};n.check=r,n.ImportDeclaration=l,n.ExportDefaultDeclaration=i,n.ExportNamedDeclaration=s,n.Program=a,n.__esModule=!0;var u=o(e("../../../types"))},{"../../../types":153}],116:[function(e,t,n){"use strict";function r(e,t,n){var r,l,i={getArgumentsId:function(){return!r&&(r=n.generateUidIdentifier("arguments")),r},getThisId:function(){return!l&&(l=n.generateUidIdentifier("this")),l}};t.traverse(u,i);var s,o=function(t,n){s||(s=e()),s.unshift(a.variableDeclaration("var",[a.variableDeclarator(t,n)]))};r&&o(r,a.identifier("arguments")),l&&o(l,a.thisExpression())}function l(e,t,n){r(function(){return e.body},this,n)}function i(e,t,n){r(function(){return a.ensureBlock(e),e.body.body},this,n)}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.Program=l,n.FunctionDeclaration=i,n.__esModule=!0;var a=s(e("../../../types")),o={enter:function(e,t,n,r){if(this.isClass(e))return this.skip();if(this.isFunction()&&!e.shadow)return this.skip();if(e._shadowedFunctionLiteral)return this.skip();var l;if(this.isIdentifier()&&"arguments"===e.name)l=r.getArgumentsId;else{if(!this.isThisExpression())return;l=r.getThisId}return this.isReferenced()?l():void 0}},u={enter:function(e,t,n,r){return e.shadow?(this.traverse(o,r),e.shadow=!1,this.skip()):this.isFunction()?this.skip():void 0}};n.FunctionExpression=i},{"../../../types":153}],117:[function(e,t,n){"use strict";function r(e,t,n,r){if(r.transformers.strict.canTransform()){var l=r.get("existingStrictDirective");if(!l){l=i.expressionStatement(i.literal("use strict"));var s=e.body[0];s&&(l.leadingComments=s.leadingComments,s.leadingComments=[])}e.body.unshift(l)}}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.Program=r,n.__esModule=!0;var i=l(e("../../../types"))},{"../../../types":153}],118:[function(e,t,n){"use strict";function r(e,t,n,r){var l=e.left;if(u.isVariableDeclaration(l)){var i=l.declarations[0];if(i.init)throw r.errorWithNode(i,o.get("noAssignmentsInForHead"))}}function l(e){if("constructor"!==e.kind){var t=!e.computed&&u.isIdentifier(e.key,{name:"constructor"});if(t||(t=u.isLiteral(e.key,{value:"constructor"})),t)throw this.errorWithNode(o.get("classesIllegalConstructorKind"))}i.apply(this,arguments)}function i(e,t,n,r){if("set"===e.kind){if(1!==e.value.params.length)throw r.errorWithNode(e.value,o.get("settersInvalidParamLength"));var l=e.value.params[0];if(u.isRestElement(l))throw r.errorWithNode(l,o.get("settersNoRest"))}}function s(e){for(var t=0;t<e.body.length;t++){var n=e.body[t];if(!u.isExpressionStatement(n)||!u.isLiteral(n.expression))return;n._blockHoist=1/0}}var a=function(e){return e&&e.__esModule?e:{"default":e}};n.ForOfStatement=r,n.MethodDefinition=l,n.Property=i,n.BlockStatement=s,n.__esModule=!0;var o=a(e("../../../messages")),u=a(e("../../../types")),p={readOnly:!0};n.metadata=p,n.ForInStatement=r,n.Program=s},{"../../../messages":43,"../../../types":153}],119:[function(e,t,n){"use strict";function r(e,t,n,r){return this.get("right").isTypeGeneric("Array")?i.call(this,e,n,r):void 0}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.ForOfStatement=r,n.__esModule=!0;var i=e("../es6/for-of")._ForOfStatementArray,s=l(e("../../../types")),a=s.isForOfStatement;n.check=a;var o=!0;n.optional=o},{"../../../types":153,"../es6/for-of":87}],120:[function(e,t,n){"use strict";function r(e){if(!e._ignoreConstant){var t={isImmutable:!0};this.traverse(s,t),this.skip(),t.isImmutable&&(this.hoist(),e._ignoreConstant=!0)}}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.JSXElement=r,n.__esModule=!0;var i=(l(e("../../helpers/react")),{optional:!0});n.metadata=i;var s={enter:function(e,t,n,r){var l=this,i=function(){r.isImmutable=!1,l.stop()};return this.isJSXClosingElement()?void this.skip():this.isJSXIdentifier({name:"ref"})&&this.parentPath.isJSXAttribute({name:e})?i():void(this.isJSXIdentifier()||this.isIdentifier()||this.isJSXMemberExpression()||this.isImmutable()||i())}}},{"../../helpers/react":58}],121:[function(e,t,n){"use strict";function r(e){for(var t=0;t<e.length;t++){var n=e[t];if(o.isJSXSpreadAttribute(n))return!0;if(l(n,"ref"))return!0}return!1}function l(e,t){return o.isJSXAttribute(e)&&o.isJSXIdentifier(e.name,{name:t})}function i(e,t,n,i){function s(e,t){u(f.properties,o.identifier(e),t)}function u(e,t,n){e.push(o.property("init",t,n))}var p=e.openingElement;if(!r(p.attributes)){var c=!0,d=o.objectExpression([]),f=o.objectExpression([]),h=o.literal(null),m=p.name;o.isJSXIdentifier(m)&&a.isCompatTag(m.name)&&(m=o.literal(m.name),c=!1),s("type",m),s("ref",o.literal(null)),e.children.length&&u(d.properties,o.identifier("children"),o.arrayExpression(a.buildChildren(e)));for(var g=0;g<p.attributes.length;g++){var y=p.attributes[g];l(y,"key")?h=y.value:u(d.properties,y.name,y.value)}return c&&(d=o.callExpression(i.addHelper("default-props"),[o.memberExpression(m,o.identifier("defaultProps")),d])),s("props",d),s("key",h),f}}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.JSXElement=i,n.__esModule=!0;var a=s(e("../../helpers/react")),o=s(e("../../../types")),u={optional:!0};n.metadata=u},{"../../../types":153,"../../helpers/react":58}],122:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e};n.__esModule=!0;var l=r(e("../../helpers/remap-async-to-generator"));n.manipulateOptions=e("./bluebird-coroutines").manipulateOptions;var i={optional:!0};n.metadata=i,n.Function=function(e,t,n,r){return e.async&&!e.generator?l(e,r.addHelper("async-to-generator"),n):void 0}},{"../../helpers/remap-async-to-generator":60,"./bluebird-coroutines":123}],123:[function(e,t,n){"use strict";function r(e){e.optional.push("es7.asyncFunctions"),e.blacklist.push("regenerator")}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e};n.manipulateOptions=r,n.__esModule=!0;var s=i(e("../../helpers/remap-async-to-generator")),a=l(e("../../../types")),o={optional:!0};n.metadata=o,n.Function=function(e,t,n,r){return e.async&&!e.generator?s(e,a.memberExpression(r.addImport("bluebird",null,!0),a.identifier("coroutine")),n):void 0}},{"../../../types":153,"../../helpers/remap-async-to-generator":60}],124:[function(e,t,n){"use strict";function r(){this.remove()}function l(e){e.typeAnnotation=null,e.value||this.remove()}function i(e){e["implements"]=null}function s(e){return e.expression}function a(e){e.isType&&this.remove()}function o(){this.get("declaration").isTypeAlias()&&this.remove()}var u=function(e){return e&&e.__esModule?e:{"default":e}};n.Flow=r,n.ClassProperty=l,n.Class=i,n.TypeCastExpression=s,n.ImportDeclaration=a,n.ExportDeclaration=o,n.__esModule=!0;u(e("../../../types"));n.Function=function(e){for(var t=0;t<e.params.length;t++){var n=e.params[t];n.optional=!1}}},{"../../../types":153}],125:[function(e,t,n){"use strict";function r(e){return"in"===e.operator?o.template("ludicrous-in",{LEFT:e.left,RIGHT:e.right}):void 0}function l(e){var t=e.key;a.isLiteral(t)&&"number"==typeof t.value&&(t.value=""+t.value)}function i(e){e.regex&&(e.regex.pattern="foobar",e.regex.flags="")}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.BinaryExpression=r,n.Property=l,n.Literal=i,n.__esModule=!0;var a=s(e("../../../types")),o=s(e("../../../util")),u={optional:!0};n.metadata=u},{"../../../types":153,"../../../util":157}],126:[function(e,t,n){"use strict";function r(e){e.blacklist.push("react")}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.manipulateOptions=r,n.__esModule=!0;var i=l(e("../../helpers/react")),s=l(e("../../../types")),a={optional:!0};n.metadata=a,e("../../helpers/build-react-transformer")(n,{pre:function(e){e.callee=e.tagExpr},post:function(e){i.isCompatTag(e.tagName)&&(e.call=s.callExpression(s.memberExpression(s.memberExpression(s.identifier("React"),s.identifier("DOM")),e.tagExpr,s.isLiteral(e.tagExpr)),e.args))}})},{"../../../types":153,"../../helpers/build-react-transformer":52,"../../helpers/react":58}],127:[function(e,t,n){"use strict";function r(e,t,n,r){for(var l=r.opts.jsxPragma,i=0;i<r.ast.comments.length;i++){var o=r.ast.comments[i],u=a.exec(o.value);if(u){if(l=u[1],"React.DOM"===l)throw r.errorWithNode(o,"The @jsx React.DOM pragma has been deprecated as of React 0.12");break}}r.set("jsxIdentifier",l.split(".").map(s.identifier).reduce(function(e,t){return s.memberExpression(e,t)}))}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.Program=r,n.__esModule=!0;var i=l(e("../../helpers/react")),s=l(e("../../../types")),a=/^\*\s*@jsx\s+([^\s]+)/;e("../../helpers/build-react-transformer")(n,{pre:function(e){var t=e.tagName,n=e.args;n.push(i.isCompatTag(t)?s.literal(t):e.tagExpr)},post:function(e,t){e.callee=t.get("jsxIdentifier")}})},{"../../../types":153,"../../helpers/build-react-transformer":52,"../../helpers/react":58}],128:[function(e,t,n){"use strict";function r(e){return a.isFunction(e)&&(e.async||e.generator)}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e};n.check=r,n.__esModule=!0;var s=i(e("regenerator-babel")),a=l(e("../../../types")),o={enter:function(e){s.transform(e),this.stop()}};n.Program=o},{"../../../types":153,"regenerator-babel":426}],129:[function(e,t,n){"use strict";function r(e){return"_"!==e.name&&u(s,e.name)}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e},s=i(e("core-js/library")),a=i(e("lodash/collection/includes")),o=l(e("../../../util")),u=i(e("lodash/object/has")),p=l(e("../../../types")),c=p.buildMatchMemberExpression("Symbol.iterator"),d=["Symbol","Promise","Map","WeakMap","Set","WeakSet"],f={enter:function(e,t,n,l){var i;if(this.isMemberExpression()&&this.isReferenced()){var f=e.object;if(i=e.property,!p.isReferenced(f,e))return;if(!e.computed&&r(f)&&u(s[f.name],i.name)&&!n.getBindingIdentifier(f.name))return this.skip(),p.prependToMemberExpression(e,l.get("coreIdentifier"))}else{if(this.isReferencedIdentifier()&&!p.isMemberExpression(t)&&a(d,e.name)&&!n.getBindingIdentifier(e.name))return p.memberExpression(l.get("coreIdentifier"),e);if(this.isCallExpression()){var h=e.callee;return e.arguments.length?!1:p.isMemberExpression(h)&&h.computed?(i=h.property,c(i)?o.template("corejs-iterator",{CORE_ID:l.get("coreIdentifier"),VALUE:h.object}):!1):!1}if(this.isBinaryExpression()){if("in"!==e.operator)return;var m=e.left;if(!c(m))return;return o.template("corejs-is-iterator",{CORE_ID:l.get("coreIdentifier"),VALUE:e.right})}}}};n.metadata={optional:!0},n.Program=function(e,t,n,r){this.traverse(f,r)},n.pre=function(e){e.set("helperGenerator",function(t){return e.addImport("babel-runtime/helpers/"+t,t)}),e.setDynamic("coreIdentifier",function(){return e.addImport("babel-runtime/core-js","core")}),e.setDynamic("regeneratorIdentifier",function(){return e.addImport("babel-runtime/regenerator","regeneratorRuntime")})},n.Identifier=function(e,t,n,r){return this.isReferencedIdentifier({name:"regeneratorRuntime"})?r.get("regeneratorIdentifier"):void 0 }},{"../../../types":153,"../../../util":157,"core-js/library":209,"lodash/collection/includes":319,"lodash/object/has":405}],130:[function(e,t,n){"use strict";function r(e,t,n,r){var l=e.body[0];u.isExpressionStatement(l)&&u.isLiteral(l.expression,{value:"use strict"})&&r.set("existingStrictDirective",e.body.shift())}function l(){this.skip()}function i(){return u.identifier("undefined")}function s(e,t,n,r){if(u.isIdentifier(e.callee,{name:"eval"}))throw r.errorWithNode(e,o.get("evalInStrictMode"))}var a=function(e){return e&&e.__esModule?e:{"default":e}};n.Program=r,n.FunctionExpression=l,n.ThisExpression=i,n.CallExpression=s,n.__esModule=!0;var o=a(e("../../../messages")),u=a(e("../../../types"));n.FunctionDeclaration=l,n.Class=l},{"../../../messages":43,"../../../types":153}],131:[function(e,t,n){"use strict";function r(e,t,n){for(var r=0;r<t[e].length;r++){var l=t[e][r];if(a.isFunctionDeclaration(l)){var i=a.variableDeclaration("let",[a.variableDeclarator(l.id,a.toExpression(l))]);i._blockHoist=2,l.id=null,t[e][r]=i,n.checkNode(i)}}}function l(e,t,n,l){a.isFunction(t)&&t.body===e||a.isExportDeclaration(t)||r("body",e,l)}function i(e,t,n,l){r("consequent",e,l)}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.BlockStatement=l,n.SwitchCase=i,n.__esModule=!0;var a=s(e("../../../types"))},{"../../../types":153}],132:[function(e,t,n){"use strict";n.__esModule=!0;var r=e("../../helpers/name-method");n.FunctionExpression=r.bare,n.ArrowFunctionExpression=r.bare},{"../../helpers/name-method":57}],133:[function(e,t,n){"use strict";function r(e){return c.isLiteral(c.toComputedKey(e,e.key),{value:"__proto__"})}function l(e){var t=e.left;return c.isMemberExpression(t)&&c.isLiteral(c.toComputedKey(t,t.property),{value:"__proto__"})}function i(e,t,n){return c.expressionStatement(c.callExpression(n.addHelper("defaults"),[t,e.right]))}function s(e,t,n,r){if(l(e)){var s=[],a=e.left.object,o=n.generateMemoisedReference(a);return s.push(c.expressionStatement(c.assignmentExpression("=",o,a))),s.push(i(e,o,r)),o&&s.push(o),s}}function a(e,t,n,r){var s=e.expression;if(c.isAssignmentExpression(s,{operator:"="}))return l(s)?i(s,s.left.object,r):void 0}function o(e,t,n,l){for(var i,s=0;s<e.properties.length;s++){var a=e.properties[s];r(a)&&(i=a.value,d(e.properties,a))}if(i){var o=[c.objectExpression([]),i];return e.properties.length&&o.push(e),c.callExpression(l.addHelper("extends"),o)}}var u=function(e){return e&&e.__esModule?e["default"]:e},p=function(e){return e&&e.__esModule?e:{"default":e}};n.AssignmentExpression=s,n.ExpressionStatement=a,n.ObjectExpression=o,n.__esModule=!0;var c=p(e("../../../types")),d=u(e("lodash/array/pull")),f={secondPass:!0,optional:!0};n.metadata=f},{"../../../types":153,"lodash/array/pull":313}],134:[function(e,t,n){"use strict";function r(e){return"undefined"===e.name&&this.isReferenced()?i.unaryExpression("void",i.literal(0),!0):void 0}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.Identifier=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0,react:!0};n.metadata=s},{"../../../types":153}],135:[function(e,t,n){"use strict";function r(e){if(s.isBlockStatement(e)){for(var t=!1,n=0;n<e.body.length;n++){var r=e.body[n];s.isBlockScoped(r)&&(t=!0)}if(!t)return e.body}return e}function l(e){var t=this.get("test").evaluateTruthy();return t===!0?e.consequent:t===!1?e.alternate:void 0}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.ConditionalExpression=l,n.__esModule=!0;var s=i(e("../../../types")),a={optional:!0};n.metadata=a;var o={exit:function(e){var t=e.consequent,n=e.alternate,l=this.get("test").evaluateTruthy();return l===!0?r(t):l===!1?n?r(n):this.remove():(s.isBlockStatement(n)&&!n.body.length&&(n=e.alternate=null),void(s.isBlockStatement(t)&&!t.body.length&&s.isBlockStatement(n)&&n.body.length&&(e.consequent=e.alternate,e.alternate=null,e.test=s.unaryExpression("!",test,!0))))}};n.IfStatement=o},{"../../../types":153}],136:[function(e,t,n){(function(t){"use strict";function r(e){if(a(e.object)){var n=this.toComputedKey();if(i.isLiteral(n))return i.valueToNode(t.env[n.value])}}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.MemberExpression=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0};n.metadata=s;var a=i.buildMatchMemberExpression("process.env")}).call(this,e("_process"))},{"../../../types":153,_process:183}],137:[function(e,t,n){"use strict";function r(){var e=this.evaluate();return e.confident?s.valueToNode(e.value):void 0}function l(){}var i=function(e){return e&&e.__esModule?e:{"default":e}};n.Expression=r,n.Identifier=l,n.__esModule=!0;var s=i(e("../../../types")),a={optional:!0};n.metadata=a},{"../../../types":153}],138:[function(e,t,n){"use strict";function r(e,t){this.get("callee").matchesPattern("console",!0)&&(i.isExpressionStatement(t)?this.parentPath.remove():this.remove())}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.CallExpression=r,n.__esModule=!0;var i=l(e("../../../types")),s={optional:!0};n.metadata=s},{"../../../types":153}],139:[function(e,t,n){"use strict";function r(){this.get("expression").isIdentifier({name:"debugger"})&&this.remove()}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.ExpressionStatement=r,n.__esModule=!0;var i=(l(e("../../../types")),{optional:!0});n.metadata=i},{"../../../types":153}],140:[function(e,t,n){"use strict";function r(e,t){if(o.isLiteral(e)){var n=e.value,r=n.toLowerCase();if("react"===r&&n!==r)throw t.errorWithNode(e,a.get("didYouMean","react"))}}function l(e,t,n,l){this.get("callee").isIdentifier({name:"require"})&&1===e.arguments.length&&r(e.arguments[0],l)}function i(e,t,n,l){r(e.source,l)}var s=function(e){return e&&e.__esModule?e:{"default":e}};n.CallExpression=l,n.ModuleDeclaration=i,n.__esModule=!0;var a=s(e("../../../messages")),o=s(e("../../../types"))},{"../../../messages":43,"../../../types":153}],141:[function(e,t,n){"use strict";function r(e,t,n,r){if(this.isReferenced()&&!n.hasBinding(e.name)){var l,i=n.getAllBindings(),o=-1;for(var u in i){var p=s(e.name,u);0>=p||p>3||o>=p||(l=u,o=p)}var c;throw c=l?a.get("undeclaredVariableSuggestion",e.name,l):a.get("undeclaredVariable",e.name),r.errorWithNode(e,c,ReferenceError)}}var l=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e){return e&&e.__esModule?e["default"]:e};n.Identifier=r,n.__esModule=!0;var s=i(e("leven")),a=l(e("../../../messages")),o={optional:!0};n.metadata=o},{"../../../messages":43,leven:307}],142:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("../types")),i=function(){function e(t){var n=t.identifier,l=t.scope,i=t.path,s=t.kind;r(this,e),this.identifier=n,this.constant=!0,this.scope=l,this.path=i,this.kind=s}return e.prototype.setTypeAnnotation=function(){var e=this.path.getTypeAnnotation();this.typeAnnotationInferred=e.inferred,this.typeAnnotation=e.annotation},e.prototype.isTypeGeneric=function(){var e;return(e=this.path).isTypeGeneric.apply(e,arguments)},e.prototype.assignTypeGeneric=function(e,t){var n=null;t&&(t=l.typeParameterInstantiation(t)),this.assignType(l.genericTypeAnnotation(l.identifier(e),n))},e.prototype.assignType=function(e){this.typeAnnotation=e},e.prototype.reassign=function(){this.constant=!1,this.typeAnnotationInferred&&(this.typeAnnotation=null)},e.prototype.isCompatibleWithType=function(){return!1},e}();t.exports=i},{"../types":153}],143:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("./path")),s=(r(e("lodash/array/compact")),n(e("../types")),function(){function e(t,n,r,i){l(this,e),this.parentPath=i,this.scope=t,this.state=r,this.opts=n}return e.prototype.create=function(e,t,n){return i.get(this.parentPath,this,e,t,n)},e.prototype.visitMultiple=function(e,t){if(0===e.length)return!1;for(var n=[],r=this.queue=[],l=!1,i=0;i<e.length;i++)e[i]&&r.push(this.create(t,e,i));for(var i=0;i<r.length;i++){var s=r[i];if(!(n.indexOf(s.node)>=0)&&(n.push(s.node),s.visit())){l=!0;break}}for(var i=0;i<r.length;i++);return l},e.prototype.visitSingle=function(e,t){return this.create(e,e,t).visit()},e.prototype.visit=function(e,t){var n=e[t];if(n)return Array.isArray(n)?this.visitMultiple(n,e,t):this.visitSingle(e,t)},e}());t.exports=s},{"../types":153,"./path":148,"lodash/array/compact":310}],144:[function(e,t){"use strict";function n(e,t,r,l,i){if(e){if(!t.noScope&&!r&&"Program"!==e.type&&"File"!==e.type)throw new Error("Must pass a scope and parentPath unless traversing a Program/File got a "+e.type+" node");if(t||(t={}),t.enter||(t.enter=function(){}),t.exit||(t.exit=function(){}),Array.isArray(e))for(var s=0;s<e.length;s++)n.node(e[s],t,r,l,i);else n.node(e,t,r,l,i)}}function r(e){for(var t=0;t<p.length;t++){var n=p[t];null!=e[n]&&(e[n]=null)}for(var n in e){var r=e[n];Array.isArray(r)&&delete r._paths}}function l(e,t,n,r){e.type===r.type&&(r.has=!0,this.skip())}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};t.exports=n;var a=s(e("./context")),o=s(e("lodash/collection/includes")),u=i(e("../types"));n.node=function(e,t,n,r,l){var i=u.VISITOR_KEYS[e.type];if(i)for(var s=new a(n,t,r,l),o=0;o<i.length;o++)if(s.visit(e,i[o]))return};var p=["trailingComments","leadingComments","extendedRange","_declarations","_scopeInfo","_paths","tokens","range","start","end","loc","raw"],c={noScope:!0,exit:r};n.removeProperties=function(e){return n(e,c),r(e),e},n.explode=function(e){for(var t in e){var n=e[t],r=u.FLIPPED_ALIAS_KEYS[t];if(r)for(var l=0;l<r.length;l++){var i=e,s=r[l];i[s]||(i[s]=n)}}return e},n.hasType=function(e,t,r,i){if(o(i,e.type))return!1;if(e.type===r)return!0;var s={has:!1,type:r};return n(e,{blacklist:i,enter:l},t,s),s.has}},{"../types":153,"./context":143,"lodash/collection/includes":319}],145:[function(e,t,n){"use strict";function r(){var e,t=this.node;if(this.isMemberExpression())e=t.property;else{if(!this.isProperty())throw new ReferenceError("todo");e=t.key}return t.computed||i.isIdentifier(e)&&(e=i.literal(e.name)),e}var l=function(e){return e&&e.__esModule?e:{"default":e}};n.toComputedKey=r,n.__esModule=!0;var i=l(e("../../types"))},{"../../types":153}],146:[function(e,t,n){"use strict";function r(){var e=this.evaluate();return e.confident?!!e.value:void 0}function l(){function e(n){if(t){var r=n.node;if(n.isSequenceExpression()){var l=n.get("expressions");return e(l[l.length-1])}if(n.isLiteral()&&(!r.regex||null!==r.value))return r.value;if(n.isConditionalExpression())return e(e(n.get("test"))?n.get("consequent"):n.get("alternate"));if(n.isIdentifier({name:"undefined"}))return void 0;if(n.isIdentifier()||n.isMemberExpression())return n=n.resolve(),n?e(n):t=!1;if(n.isUnaryExpression({prefix:!0})){var i=e(n.get("argument"));switch(r.operator){case"void":return void 0;case"!":return!i;case"+":return+i;case"-":return-i}}if(n.isArrayExpression()||n.isObjectExpression(),n.isLogicalExpression()){var s=e(n.get("left")),a=e(n.get("right"));switch(r.operator){case"||":return s||a;case"&&":return s&&a}}if(n.isBinaryExpression()){var s=e(n.get("left")),a=e(n.get("right"));switch(r.operator){case"-":return s-a;case"+":return s+a;case"/":return s/a;case"*":return s*a;case"%":return s%a;case"<":return a>s;case">":return s>a;case"<=":return a>=s;case">=":return s>=a;case"==":return s==a;case"!=":return s!=a;case"===":return s===a;case"!==":return s!==a}}t=!1}}var t=!0,n=e(this);return t||(n=void 0),{confident:t,value:n}}n.evaluateTruthy=r,n.evaluate=l,n.__esModule=!0},{}],147:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("../../transformation/helpers/react")),i=n(e("../../types")),s={enter:function(e,t,n,r){if((!this.isJSXIdentifier()||!l.isCompatTag(e.name))&&(this.isJSXIdentifier()||this.isIdentifier())&&this.isReferenced()){var i=n.getBinding(e.name);if(i!==r.scope.getBinding(e.name))return;i&&i.constant?r.bindings[e.name]=i:(n.dump(),r.foundIncompatible=!0,this.stop())}}},a=function(){function e(t,n){r(this,e),this.foundIncompatible=!1,this.bindings={},this.scope=n,this.scopes=[],this.path=t}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var n=this.bindings[t];if(!e.bindingIdentifierEquals(t,n.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;this.scopes.push(e)}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this.scopes,t=e.pop();return t.path.isFunction()?this.hasNonParamBindings()?this.getNextScopeStatementParent():t.path.get("body").get("body")[0]:t.path.isProgram()?this.getNextScopeStatementParent():void 0},e.prototype.getNextScopeStatementParent=function(){var e=this.scopes.pop();return e?e.path.getStatementParent():void 0},e.prototype.hasNonParamBindings=function(){for(var e in this.bindings){var t=this.bindings[e];if("param"!==t.kind)return!0}return!1},e.prototype.run=function(){if(this.path.traverse(s,this),!this.foundIncompatible){this.getCompatibleScopes();var e=this.getAttachmentPath();if(e){var t=e.scope.generateUidIdentifier("ref");e.insertBefore([i.variableDeclaration("var",[i.variableDeclarator(t,this.path.node)])]),this.path.replaceWith(t)}}},e}();t.exports=a},{"../../transformation/helpers/react":58,"../../types":153}],148:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./hoister")),a=r(e("lodash/lang/isBoolean")),o=r(e("lodash/lang/isNumber")),u=(r(e("lodash/lang/isRegExp")),r(e("lodash/lang/isString"))),p=r(e("../index")),c=r(e("lodash/collection/includes")),d=r(e("lodash/object/assign")),f=(r(e("lodash/object/extend")),r(e("../scope"))),h=n(e("../../types")),m={enter:function(e,t,n){if(this.isFunction())return this.skip();if(this.isVariableDeclaration()&&"var"===e.kind){var r=this.getBindingIdentifiers();for(var l in r)n.push({id:r[l]});for(var i=[],s=0;s<e.declarations.length;s++){var a=e.declarations[s];a.init&&i.push(h.expressionStatement(h.assignmentExpression("=",a.id,a.init)))}return i}}},g=function(){function e(t,n){i(this,e),this.container=n,this.parent=t,this.data={}}return e.get=function(t,n,r,l,i,s){for(var a,o,u=l[i],p=(a=l,!a._paths&&(a._paths=[]),a._paths),c=0;c<p.length;c++){var d=p[c];if(d.node===u){o=d;break}}return o||(o=new e(r,l),p.push(o)),o.setContext(t,n,i,s),o},e.getScope=function(e,t,n){var r=t;return e.isScope()&&(r=new f(e,t,n)),r},e.prototype.queueNode=function(e){this.context&&this.context.queue.push(e)},e.prototype.insertBefore=function(e){if(e=this._verifyNodeList(e),this.checkNodes(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isPreviousType("Statement"))if(this._maybePopFromStatements(e),Array.isArray(this.container))this._containerInsertBefore(e);else{if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this.container[this.key]=h.blockStatement(e)}else{if(!this.isPreviousType("Expression"))throw new Error("No clue what to do with this node type.");this.node&&e.push(this.node),this.replaceExpressionWithStatements(e)}},e.prototype._containerInsert=function(e,t){this.updateSiblingKeys(e,t.length);for(var n=0;n<t.length;n++){var r=e+n;this.container.splice(r,0,t[n]),this.context&&this.queueNode(this.context.create(this.parent,this.container,r))}},e.prototype._containerInsertBefore=function(e){this._containerInsert(this.key,e)},e.prototype._containerInsertAfter=function(e){this._containerInsert(this.key+1,e)},e.prototype._maybePopFromStatements=function(e){var t=e[e.length-1];h.isExpressionStatement(t)&&h.isIdentifier(t.expression)&&e.pop()},e.prototype.isStatementOrBlock=function(){return h.isLabeledStatement(this.parent)||h.isBlockStatement(this.container)?!1:c(h.STATEMENT_OR_BLOCK_KEYS,this.key)},e.prototype.insertAfter=function(e){if(e=this._verifyNodeList(e),this.checkNodes(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isPreviousType("Statement"))if(this._maybePopFromStatements(e),Array.isArray(this.container))this._containerInsertAfter(e);else{if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.unshift(this.node),this.container[this.key]=h.blockStatement(e)}else{if(!this.isPreviousType("Expression"))throw new Error("No clue what to do with this node type.");if(this.node){var t=this.scope.generateTemp();e.unshift(h.expressionStatement(h.assignmentExpression("=",t,this.node))),e.push(h.expressionStatement(t))}this.replaceExpressionWithStatements(e)}},e.prototype.updateSiblingKeys=function(e,t){for(var n=this.container._paths,r=0;r<n.length;r++){var l=n[r];l.key>=e&&(l.key+=t)}},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e,t){var n=this.data[e];return!n&&t&&(n=this.data[e]=t),n},e.prototype.setScope=function(t){this.scope=e.getScope(this,this.context&&this.context.scope,t)},e.prototype.clearContext=function(){this.context=null},e.prototype.setContext=function(e,t,n,r){this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.parentPath=e||this.parentPath,this.key=n,t&&(this.context=t,this.state=t.state,this.opts=t.opts),this.type=this.node&&this.node.type,this.setScope(r)},e.prototype._remove=function(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this.container[this.key]=null},e.prototype.remove=function(){var e=!1;return this.parentPath&&(e||(e=this.parentPath.isExpressionStatement()),e||(e=this.parentPath.isSequenceExpression()&&1===this.parent.expressions.length),e)?this.parentPath.remove():(this._remove(),void(this.removed=!0))},e.prototype.skip=function(){this.shouldSkip=!0},e.prototype.stop=function(){this.shouldStop=!0,this.shouldSkip=!0},e.prototype.errorWithNode=function(e){var t=void 0===arguments[1]?SyntaxError:arguments[1],n=this.node.loc.start,r=new t("Line "+n.line+": "+e);return r.loc=n,r},e.prototype.replaceInline=function(e){return Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)},e.prototype._verifyNodeList=function(e){e.constructor!==Array&&(e=[e]);for(var t=0;t<e.length;t++){var n=e[t];if(!n)throw new Error("Node list has falsy node with the index of "+t);if("object"!=typeof n)throw new Error("Node list contains a non-object node with the index of "+t);if(!n.type)throw new Error("Node list contains a node without a type with the index of "+t)}return e},e.prototype.replaceWithMultiple=function(e){e=this._verifyNodeList(e),h.inheritsComments(e[0],this.node),this.container[this.key]=null,this.insertAfter(e),this.node||this.remove()},e.prototype.replaceWith=function(e,t){if(this.removed)throw new Error("You can't replace this node, we've already removed it");if(!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(Array.isArray(e)){if(t)return this.replaceWithMultiple(e);throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`")}if(this.isPreviousType("Expression")&&h.isStatement(e))return this.replaceExpressionWithStatements([e]);var n=this.node;n&&h.inheritsComments(e,n),this.container[this.key]=e,this.type=e.type,this.setScope(),this.checkNodes([e])},e.prototype.checkNodes=function(e){var t=this.scope,n=t&&t.file;if(n)for(var r=0;r<e.length;r++)n.checkNode(e[r],t)},e.prototype.getStatementParent=function(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e},e.prototype.getLastStatements=function(){var e=[],t=function(t){t&&(e=e.concat(t.getLastStatements()))};return this.isIfStatement()?(t(this.get("consequent")),t(this.get("alternate"))):this.isDoExpression()?t(this.get("body")):this.isProgram()||this.isBlockStatement()?t(this.get("body").pop()):e.push(this),e},e.prototype.replaceExpressionWithStatements=function(e){var t=h.toSequenceExpression(e,this.scope);if(t)return this.replaceWith(t);var n=h.functionExpression(null,[],h.blockStatement(e));n.shadow=!0;for(var r=this.getLastStatements(),l=0;l<r.length;l++){var i=r[l];i.isExpressionStatement()&&i.replaceWith(h.returnStatement(i.node.expression))}return this.replaceWith(h.callExpression(n,[])),this.traverse(m),this.node},e.prototype.call=function(e){var t=this.node;if(t){var n=this.opts,r=n[e]||n;n[t.type]&&(r=n[t.type][e]||r);var l=r.call(this,t,this.parent,this.scope,this.state);l&&this.replaceWith(l,!0)}},e.prototype.isBlacklisted=function(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1},e.prototype.visit=function(){if(this.isBlacklisted())return!1;if(this.call("enter"),this.shouldSkip)return this.shouldStop;var e=this.node,t=this.opts;if(e)if(Array.isArray(e))for(var n=0;n<e.length;n++)p.node(e[n],t,this.scope,this.state,this);else p.node(e,t,this.scope,this.state,this),this.call("exit");return this.shouldStop},e.prototype.getSibling=function(t){return e.get(this.parentPath,null,this.parent,this.container,t,this.file)},e.prototype.get=function(t){var n=this,r=t.split(".");if(1===r.length){var l=this.node,i=l[t];return Array.isArray(i)?i.map(function(t,r){return e.get(n,null,l,i,r)}):e.get(this,null,l,l,t)}for(var s=this,a=0;a>r.length;a++){var o=r[a];s="."===o?s.parentPath:s.get(r[a])}return s},e.prototype.has=function(e){return!!this.node[e]},e.prototype.is=function(e){return this.has(e)},e.prototype.isnt=function(e){return!this.has(e)},e.prototype.getTypeAnnotation=function(){if(this.typeInfo)return this.typeInfo;var e=this.typeInfo={inferred:!1,annotation:null},t=this.node.typeAnnotation;return t||(e.inferred=!0,t=this.inferType(this)),t&&(h.isTypeAnnotation(t)&&(t=t.typeAnnotation),e.annotation=t),e},e.prototype.resolve=function(){if(this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve()}else{if(this.isIdentifier()){var e=this.scope.getBinding(this.node.name);if(!e||!e.constant)return;return e.path===this?this:e.path.resolve()}if(!this.isMemberExpression())return this;var t=this.toComputedKey();if(!h.isLiteral(t))return;var n=t.value,r=this.get("object").resolve();if(!r||!r.isObjectExpression())return;for(var l=r.get("properties"),i=0;i<l.length;i++){var s=l[i];if(s.isProperty()){var a=s.get("key"),o=s.isnt("computed")&&a.isIdentifier({name:n});if(o||(o=a.isLiteral({value:n})),o)return s.get("value")}}}},e.prototype.inferType=function(e){if(e=e.resolve()){if(e.isRestElement()||e.parentPath.isRestElement()||e.isArrayExpression())return h.genericTypeAnnotation(h.identifier("Array"));if(e.parentPath.isTypeCastExpression())return e.parentPath.node.typeAnnotation;if(e.isTypeCastExpression())return e.node.typeAnnotation;if(e.isObjectExpression())return h.genericTypeAnnotation(h.identifier("Object"));if(e.isFunction())return h.identifier("Function");if(e.isLiteral()){var t=e.node.value;if(u(t))return h.stringTypeAnnotation();if(o(t))return h.numberTypeAnnotation();if(a(t))return h.booleanTypeAnnotation()}if(e.isCallExpression()){var n=e.get("callee").resolve();if(n&&n.isFunction())return n.node.returnType}}},e.prototype.isScope=function(){return h.isScope(this.node,this.parent)},e.prototype.isReferencedIdentifier=function(e){return h.isReferencedIdentifier(this.node,this.parent,e)},e.prototype.isReferenced=function(){return h.isReferenced(this.node,this.parent)},e.prototype.isBlockScoped=function(){return h.isBlockScoped(this.node)},e.prototype.isVar=function(){return h.isVar(this.node)},e.prototype.isPreviousType=function(e){return h.isType(this.type,e)},e.prototype.isTypeGeneric=function(e){var t=void 0===arguments[1]?{}:arguments[1],n=this.getTypeAnnotation(),r=n.annotation;return r?r.inferred&&t.inference===!1?!1:h.isGenericTypeAnnotation(r)&&h.isIdentifier(r.id,{name:e})?t.requireTypeParameters&&!r.typeParameters?!1:!0:!1:!1},e.prototype.getBindingIdentifiers=function(){return h.getBindingIdentifiers(this.node)},e.prototype.traverse=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e,t){p(this.node,e,this.scope,t,this)}),e.prototype.hoist=function(){var e=void 0===arguments[0]?this.scope:arguments[0],t=new s(this,e);return t.run()},e.prototype.matchesPattern=function(e,t){var n=e.split(".");if(!this.isMemberExpression())return!1;for(var r=[this.node],l=0;r.length;){var i=r.shift();if(t&&l===n.length)return!0;if(h.isIdentifier(i)){if(n[l]!==i.name)return!1}else{if(!h.isLiteral(i)){if(h.isMemberExpression(i)){if(i.computed&&!h.isLiteral(i.property))return!1;r.push(i.object),r.push(i.property);continue}return!1}if(n[l]!==i.value)return!1}if(++l>n.length)return!1}return!0},l(e,{node:{get:function(){return this.removed?null:this.container[this.key]},set:function(){throw new Error("Don't use `path.node = newNode;`, use `path.replaceWith(newNode)` or `path.replaceWithMultiple([newNode])`")}}}),e}();t.exports=g,d(g.prototype,e("./evaluation")),d(g.prototype,e("./conversion"));for(var y=0;y<h.TYPES.length;y++)!function(){var e=h.TYPES[y],t="is"+e;g.prototype[t]=function(e){return h[t](this.node,e)}}()},{"../../types":153,"../index":144,"../scope":149,"./conversion":145,"./evaluation":146,"./hoister":147,"lodash/collection/includes":319,"lodash/lang/isBoolean":391,"lodash/lang/isNumber":395,"lodash/lang/isRegExp":398,"lodash/lang/isString":399,"lodash/object/assign":402,"lodash/object/extend":404}],149:[function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=r(e("lodash/collection/includes")),s=r(e("./index")),a=r(e("lodash/object/defaults")),o=n(e("../messages")),u=r(e("./binding")),p=r(e("globals")),c=r(e("lodash/array/flatten")),d=r(e("lodash/object/extend")),f=r(e("../helpers/object")),h=r(e("lodash/collection/each")),m=n(e("../types")),g={enter:function(e,t,n,r){var l=this;return m.isFor(e)&&h(m.FOR_INIT_KEYS,function(e){var t=l.get(e);t.isVar()&&r.scope.registerBinding("var",t)}),this.isFunction()?this.skip():void(r.blockId&&e===r.blockId||this.isBlockScoped()||this.isExportDeclaration()&&m.isDeclaration(e.declaration)||this.isDeclaration()&&r.scope.registerDeclaration(this))}},y={enter:function(e,t,n,r){m.isReferencedIdentifier(e,t)&&!n.hasBinding(e.name)?r.addGlobal(e):m.isLabeledStatement(e)?r.addGlobal(e):m.isAssignmentExpression(e)?n.registerConstantViolation(this.get("left"),this.get("right")):m.isUpdateExpression(e)?n.registerConstantViolation(this.get("argument"),null):m.isUnaryExpression(e)&&"delete"===e.operator&&n.registerConstantViolation(this.get("left"),null)}},b={enter:function(e,t,n,r){(this.isFunctionDeclaration()||this.isBlockScoped())&&r.registerDeclaration(this),this.isScope()&&this.skip()}},v=function(){function e(t,n,r){if(l(this,e),n&&n.block===t.node)return n;var i=t.getData("scope");return i&&i.parent===n?i:(t.setData("scope",this),this.parent=n,this.file=n?n.file:r,this.parentBlock=t.parent,this.block=t.node,this.path=t,void this.crawl())}return e.globals=c([p.builtin,p.browser,p.node].map(Object.keys)),e.contextVariables=["this","arguments","super"],e.prototype.traverse=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e,t,n){s(e,t,this,n,this.path)}),e.prototype.generateTemp=function(){var e=void 0===arguments[0]?"temp":arguments[0],t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(e){return m.identifier(this.generateUid(e))},e.prototype.generateUid=function(e){e=m.toIdentifier(e).replace(/^_+/,"");var t,n=0;do t=this._generateUid(e,n),n++;while(this.hasBinding(t)||this.hasGlobal(t)||this.hasUid(t));return this.getFunctionParent().uids[t]=!0,t},e.prototype._generateUid=function(e,t){var n=e;return t>1&&(n+=t),"_"+n},e.prototype.hasUid=function(e){var t=this;do{if(t.uids[e])return!0;t=t.parent}while(t);return!1},e.prototype.generateUidBasedOnNode=function(e,t){var n=e;m.isAssignmentExpression(e)?n=e.left:m.isVariableDeclarator(e)?n=e.id:m.isProperty(n)&&(n=n.key);var r=[],l=function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e){if(m.isModuleDeclaration(e))if(e.specifiers&&e.specifiers.length)for(var t=0;t<e.specifiers.length;t++)l(e.specifiers[t]);else l(e.source);else if(m.isModuleSpecifier(e))l(e.local);else if(m.isMemberExpression(e))l(e.object),l(e.property);else if(m.isIdentifier(e))r.push(e.name);else if(m.isLiteral(e))r.push(e.value);else if(m.isCallExpression(e))l(e.callee);else if(m.isObjectExpression(e)||m.isObjectPattern(e))for(var t=0;t<e.properties.length;t++){var n=e.properties[t];l(n.key||n.argument)}});l(n);var i=r.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(i)},e.prototype.generateMemoisedReference=function(e,t){if(m.isThisExpression(e)||m.isSuper(e))return null;if(m.isIdentifier(e)&&this.hasBinding(e.name))return null;var n=this.generateUidBasedOnNode(e);return t||this.push({id:n}),n},e.prototype.checkBlockScopedCollisions=function(e,t,n){var r=this.getOwnBindingInfo(t);if(r&&"param"!==e&&!("hoisted"===e&&"let"===r.kind||"let"!==r.kind&&"const"!==r.kind&&"module"!==r.kind&&"param"!==r.kind))throw this.file.errorWithNode(n,o.get("scopeDuplicateDeclaration",t),TypeError)},e.prototype.rename=function(e,t,n){t||(t=this.generateUidIdentifier(e).name);var r=this.getBinding(e);if(r){var l=r.identifier,i=r.scope;i.traverse(n||i.block,{enter:function(n,r,i){if(m.isReferencedIdentifier(n,r)&&n.name===e)n.name=t;else if(m.isDeclaration(n)){var s=this.getBindingIdentifiers();for(var a in s)a===e&&(s[a].name=t)}else this.isScope()&&(i.bindingIdentifierEquals(e,l)||this.skip())}}),n||(i.removeOwnBinding(e),i.bindings[t]=r,l.name=t)}},e.prototype.dump=function(){var e=this;do console.log(e.block.type,"Bindings:",Object.keys(e.bindings));while(e=e.parent);console.log("-------------")},e.prototype.toArray=function(e,t){var n=this.file;if(m.isIdentifier(e)){var r=this.getBinding(e.name);if(r&&r.isTypeGeneric("Array",{inference:!1}))return e}if(m.isArrayExpression(e))return e;if(m.isIdentifier(e,{name:"arguments"}))return m.callExpression(m.memberExpression(n.addHelper("slice"),m.identifier("call")),[e]);var l="to-array",i=[e];return t===!0?l="to-consumable-array":t&&(i.push(m.literal(t)),l="sliced-to-array",this.file.isLoose("es6.forOf")&&(l+="-loose")),m.callExpression(n.addHelper(l),i)},e.prototype.registerDeclaration=function(e){var t=e.node;if(m.isFunctionDeclaration(t))this.registerBinding("hoisted",e);else if(m.isVariableDeclaration(t))for(var n=e.get("declarations"),r=0;r<n.length;r++)this.registerBinding(t.kind,n[r]);else m.isClassDeclaration(t)?this.registerBinding("let",e):m.isImportDeclaration(t)||m.isExportDeclaration(t)?this.registerBinding("module",e):this.registerBinding("unknown",e)},e.prototype.registerConstantViolation=function(e,t){var n=e.getBindingIdentifiers(); for(var r in n){var l=this.getBinding(r);if(l){if(t){var i=t.typeAnnotation;if(i&&l.isCompatibleWithType(i))continue}l.reassign()}}},e.prototype.registerBinding=function(e,t){if(!e)throw new ReferenceError("no `kind`");var n=t.getBindingIdentifiers();for(var r in n){var l=n[r];this.checkBlockScopedCollisions(e,r,l),this.bindings[r]=new u({identifier:l,scope:this,path:t,kind:e})}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasGlobal=function(e){var t=this;do if(t.globals[e])return!0;while(t=t.parent);return!1},e.prototype.recrawl=function(){this.path.setData("scopeInfo",null),this.crawl()},e.prototype.crawl=function(){var e=this.path,t=this.block._scopeInfo;if(t)return d(this,t);if(t=this.block._scopeInfo={bindings:f(),globals:f(),uids:f()},d(this,t),e.isLoop())for(var n=0;n<m.FOR_INIT_KEYS.length;n++){var r=e.get(m.FOR_INIT_KEYS[n]);r.isBlockScoped()&&this.registerBinding("let",r)}if(e.isFunctionExpression()&&e.has("id")&&(m.isProperty(e.parent,{method:!0})||this.registerBinding("var",e.get("id"))),e.isClass()&&e.has("id")&&this.registerBinding("var",e.get("id")),e.isFunction()){for(var l=e.get("params"),n=0;n<l.length;n++)this.registerBinding("param",l[n]);this.traverse(e.get("body").node,b,this)}(e.isBlockStatement()||e.isProgram())&&this.traverse(e.node,b,this),e.isCatchClause()&&this.registerBinding("let",e.get("param")),e.isComprehensionExpression()&&this.registerBinding("let",e),(e.isProgram()||e.isFunction())&&this.traverse(e.node,g,{blockId:e.get("id").node,scope:this}),e.isProgram()&&this.traverse(e.node,y,this)},e.prototype.push=function(e){var t=this.block;(m.isLoop(t)||m.isCatchClause(t)||m.isFunction(t))&&(m.ensureBlock(t),t=t.body),m.isBlockStatement(t)||m.isProgram(t)||(t=this.getBlockParent().block);var n=t;n._declarations||(n._declarations={}),t._declarations[e.key||e.id.name]={kind:e.kind||"var",id:e.id,init:e.init}},e.prototype.getFunctionParent=function(){for(var e=this;e.parent&&!m.isFunction(e.block);)e=e.parent;return e},e.prototype.getBlockParent=function(){for(var e=this;e.parent&&!m.isFunction(e.block)&&!m.isLoop(e.block)&&!m.isFunction(e.block);)e=e.parent;return e},e.prototype.getAllBindings=function(){var e=f(),t=this;do a(e,t.bindings),t=t.parent;while(t);return e},e.prototype.getAllBindingsOfKind=function(){for(var e=f(),t=0;t<arguments.length;t++){var n=arguments[t],r=this;do{for(var l in r.bindings){var i=r.bindings[l];i.kind===n&&(e[l]=i)}r=r.parent}while(r)}return e},e.prototype.bindingIdentifierEquals=function(e,t){return this.getBindingIdentifier(e)===t},e.prototype.getBinding=function(e){var t=this;do{var n=t.getOwnBindingInfo(e);if(n)return n}while(t=t.parent)},e.prototype.getOwnBindingInfo=function(e){return this.bindings[e]},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBindingInfo(e)},e.prototype.hasBinding=function(t){return t?this.hasOwnBinding(t)?!0:this.parentHasBinding(t)?!0:this.uids[t]?!0:i(e.globals,t)?!0:i(e.contextVariables,t)?!0:!1:!1},e.prototype.parentHasBinding=function(e){return this.parent&&this.parent.hasBinding(e)},e.prototype.removeOwnBinding=function(e){this.bindings[e]=null},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e)},e}();t.exports=v},{"../helpers/object":41,"../messages":43,"../types":153,"./binding":142,"./index":144,globals:302,"lodash/array/flatten":311,"lodash/collection/each":316,"lodash/collection/includes":319,"lodash/object/defaults":403,"lodash/object/extend":404}],150:[function(e,t){t.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While","Scopable"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While","Scopable"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ImportSpecifier:["ModuleSpecifier"],ExportSpecifier:["ModuleSpecifier"],ImportDefaultSpecifier:["ModuleSpecifier"],ExportDefaultSpecifier:["ModuleSpecifier"],ExportNamespaceSpecifier:["ModuleSpecifier"],ExportDefaultFromSpecifier:["ModuleSpecifier"],ExportAllDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ExportDefaultDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ExportNamedDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ImportDeclaration:["Statement","Declaration","ModuleDeclaration"],ArrowFunctionExpression:["Scopable","Function","Expression"],FunctionDeclaration:["Scopable","Function","Statement","Declaration"],FunctionExpression:["Scopable","Function","Expression"],BlockStatement:["Scopable","Statement"],Program:["Scopable"],CatchClause:["Scopable"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Scopable","Class","Statement","Declaration"],ClassExpression:["Scopable","Class","Expression"],ForOfStatement:["Scopable","Statement","For","Loop"],ForInStatement:["Scopable","Statement","For","Loop"],ForStatement:["Scopable","Statement","For","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],AssignmentPattern:["Pattern"],Property:["UserWhitespacable"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],AwaitExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression","Scopable"],ConditionalExpression:["Expression"],DoExpression:["Expression"],Identifier:["Expression"],Literal:["Expression"],MemberExpression:["Expression"],MetaProperty:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],Super:["Expression"],UpdateExpression:["Expression"],JSXEmptyExpression:["Expression"],JSXMemberExpression:["Expression"],YieldExpression:["Expression"],AnyTypeAnnotation:["Flow"],ArrayTypeAnnotation:["Flow"],BooleanTypeAnnotation:["Flow"],ClassImplements:["Flow"],DeclareClass:["Flow"],DeclareFunction:["Flow"],DeclareModule:["Flow"],DeclareVariable:["Flow"],FunctionTypeAnnotation:["Flow"],FunctionTypeParam:["Flow"],GenericTypeAnnotation:["Flow"],InterfaceExtends:["Flow"],InterfaceDeclaration:["Flow"],IntersectionTypeAnnotation:["Flow"],NullableTypeAnnotation:["Flow"],NumberTypeAnnotation:["Flow"],StringLiteralTypeAnnotation:["Flow"],StringTypeAnnotation:["Flow"],TupleTypeAnnotation:["Flow"],TypeofTypeAnnotation:["Flow"],TypeAlias:["Flow"],TypeAnnotation:["Flow"],TypeCastExpression:["Flow"],TypeParameterDeclaration:["Flow"],TypeParameterInstantiation:["Flow"],ObjectTypeAnnotation:["Flow"],ObjectTypeCallProperty:["Flow","UserWhitespacable"],ObjectTypeIndexer:["Flow","UserWhitespacable"],ObjectTypeProperty:["Flow","UserWhitespacable"],QualifiedTypeIdentifier:["Flow"],UnionTypeAnnotation:["Flow"],VoidTypeAnnotation:["Flow"],JSXAttribute:["JSX","Immutable"],JSXClosingElement:["JSX","Immutable"],JSXElement:["JSX","Immutable","Expression"],JSXEmptyExpression:["JSX","Immutable"],JSXExpressionContainer:["JSX","Immutable"],JSXIdentifier:["JSX"],JSXMemberExpression:["JSX"],JSXNamespacedName:["JSX"],JSXOpeningElement:["JSX","Immutable"],JSXSpreadAttribute:["JSX"]}},{}],151:[function(e,t){t.exports={ArrayExpression:{elements:null},ArrowFunctionExpression:{params:null,body:null},AssignmentExpression:{operator:null,left:null,right:null},BinaryExpression:{operator:null,left:null,right:null},BlockStatement:{body:null},CallExpression:{callee:null,arguments:null},ConditionalExpression:{test:null,consequent:null,alternate:null},ExpressionStatement:{expression:null},File:{program:null,comments:null,tokens:null},FunctionExpression:{id:null,params:null,body:null,generator:!1,async:!1},FunctionDeclaration:{id:null,params:null,body:null,generator:!1},GenericTypeAnnotation:{id:null,typeParameters:null},Identifier:{name:null},IfStatement:{test:null,consequent:null,alternate:null},ImportDeclaration:{specifiers:null,source:null},ImportSpecifier:{local:null,imported:null},LabeledStatement:{label:null,body:null},Literal:{value:null},LogicalExpression:{operator:null,left:null,right:null},MemberExpression:{object:null,property:null,computed:!1},MethodDefinition:{key:null,value:null,kind:"method",computed:!1,"static":!1},NewExpression:{callee:null,arguments:null},ObjectExpression:{properties:null},Program:{body:null},Property:{kind:null,key:null,value:null,computed:!1},ReturnStatement:{argument:null},SequenceExpression:{expressions:null},TemplateLiteral:{quasis:null,expressions:null},ThrowExpression:{argument:null},UnaryExpression:{operator:null,argument:null,prefix:null},VariableDeclaration:{kind:null,declarations:null},VariableDeclarator:{id:null,init:null},WithStatement:{object:null,body:null},YieldExpression:{argument:null,delegate:null}}},{}],152:[function(e,t,n){"use strict";function r(e){var t=void 0===arguments[1]?e.key||e.property:arguments[1];return function(){return e.computed||v.isIdentifier(t)&&(t=v.literal(t.name)),t}()}function l(e,t){function n(e){for(var t=!1,i=[],s=0;s<e.length;s++){var a=e[s];if(v.isExpression(a))i.push(a);else if(v.isExpressionStatement(a))i.push(a.expression);else{if(v.isVariableDeclaration(a)){if("var"!==a.kind)return l=!0;b(a.declarations,function(e){var t=v.getBindingIdentifiers(e);for(var n in t)r.push({kind:a.kind,id:t[n]});e.init&&i.push(v.assignmentExpression("=",e.id,e.init))}),t=!0;continue}if(v.isIfStatement(a)){var o=a.consequent?n([a.consequent]):v.identifier("undefined"),u=a.alternate?n([a.alternate]):v.identifier("undefined");if(!o||!u)return l=!0;i.push(v.conditionalExpression(a.test,o,u))}else{if(!v.isBlockStatement(a))return l=!0;i.push(n(a.body))}}t=!1}return t&&i.push(v.identifier("undefined")),1===i.length?i[0]:v.sequenceExpression(i)}var r=[],l=!1,i=n(e);if(!l){for(var s=0;s<r.length;s++)t.push(r[s]);return i}}function i(e){var t=void 0===arguments[1]?e.key:arguments[1];return function(){var n;return n=v.isIdentifier(t)?t.name:JSON.stringify(v.isLiteral(t)?t.value:y.removeProperties(v.cloneDeep(t))),e.computed&&(n="["+n+"]"),n}()}function s(e){return v.isIdentifier(e)?e.name:(e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),v.isValidIdentifier(e)||(e="_"+e),e||"_")}function a(e,t){if(v.isStatement(e))return e;var n,r=!1;if(v.isClass(e))r=!0,n="ClassDeclaration";else if(v.isFunction(e))r=!0,n="FunctionDeclaration";else if(v.isAssignmentExpression(e))return v.expressionStatement(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=n,e}function o(e){if(v.isExpressionStatement(e)&&(e=e.expression),v.isClass(e)?e.type="ClassExpression":v.isFunction(e)&&(e.type="FunctionExpression"),v.isExpression(e))return e;throw new Error("cannot turn "+e.type+" to an expression")}function u(e,t){return v.isBlockStatement(e)?e:(v.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(v.isStatement(e)||(e=v.isFunction(t)?v.returnStatement(e):v.expressionStatement(e)),e=[e]),v.blockStatement(e))}function p(e){if(void 0===e)return v.identifier("undefined");if(e===!0||e===!1||null===e||g(e)||h(e)||m(e))return v.literal(e);if(Array.isArray(e))return v.arrayExpression(e.map(v.valueToNode));if(f(e)){var t=[];for(var n in e){var r;r=v.isValidIdentifier(n)?v.identifier(n):v.literal(n),t.push(v.property("init",r,v.valueToNode(e[n])))}return v.objectExpression(t)}throw new Error("don't know how to turn this value into a node")}var c=function(e){return e&&e.__esModule?e:{"default":e}},d=function(e){return e&&e.__esModule?e["default"]:e};n.toComputedKey=r,n.toSequenceExpression=l,n.toKeyAlias=i,n.toIdentifier=s,n.toStatement=a,n.toExpression=o,n.toBlock=u,n.valueToNode=p,n.__esModule=!0;var f=d(e("lodash/lang/isPlainObject")),h=d(e("lodash/lang/isNumber")),m=d(e("lodash/lang/isRegExp")),g=d(e("lodash/lang/isString")),y=d(e("../traversal")),b=d(e("lodash/collection/each")),v=c(e("./index"))},{"../traversal":144,"./index":153,"lodash/collection/each":316,"lodash/lang/isNumber":395,"lodash/lang/isPlainObject":397,"lodash/lang/isRegExp":398,"lodash/lang/isString":399}],153:[function(e,t,n){"use strict";function r(e,t){var n=_["is"+e]=function(n,r){return _.is(e,n,r,t)};_["assert"+e]=function(t,r){if(r||(r={}),!n(t,r))throw new Error("Expected type "+JSON.stringify(e)+" with option "+JSON.stringify(r))}}function l(e,t,n){if(!t)return!1;var r=i(t.type,e);return r?"undefined"==typeof n?!0:_.shallowEqual(t,n):!1}function i(e,t){if(e===t)return!0;var n=_.FLIPPED_ALIAS_KEYS[t];return n?n.indexOf(e)>-1:!1}function s(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var l=n[r];if(e[l]!==t[l])return!1}return!0}function a(e,t,n){return e.object=_.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!n,e}function o(e,t){return e.object=_.memberExpression(t,e.object),e}function u(e){var t=void 0===arguments[1]?"body":arguments[1];return e[t]=_.toBlock(e[t],e)}function p(e){var t={};for(var n in e)"_"!==n[0]&&(t[n]=e[n]);return t}function c(e){var t={};for(var n in e)if("_"!==n[0]){var r=e[n];r&&(r.type?r=_.cloneDeep(r):Array.isArray(r)&&(r=r.map(_.cloneDeep))),t[n]=r}return t}function d(e,t){var n=e.split(".");return function(e){if(!_.isMemberExpression(e))return!1;for(var r=[e],l=0;r.length;){var i=r.shift();if(t&&l===n.length)return!0;if(_.isIdentifier(i)){if(n[l]!==i.name)return!1}else{if(!_.isLiteral(i)){if(_.isMemberExpression(i)){if(i.computed&&!_.isLiteral(i.property))return!1;r.push(i.object),r.push(i.property);continue}return!1}if(n[l]!==i.value)return!1}if(++l>n.length)return!1}return!0}}function f(e){return x(A,function(t){delete e[t]}),e}function h(e,t){return e&&t&&x(A,function(n){e[n]=E(b([].concat(e[n],t[n])))}),e}function m(e,t){return e&&t?(e._declarations=t._declarations,e._scopeInfo=t._scopeInfo,e.range=t.range,e.start=t.start,e.loc=t.loc,e.end=t.end,e.typeAnnotation=t.typeAnnotation,e.returnType=t.returnType,_.inheritsComments(e,t),e):e}var g=function(e){return e&&e.__esModule?e["default"]:e};n.is=l,n.isType=i,n.shallowEqual=s,n.appendToMemberExpression=a,n.prependToMemberExpression=o,n.ensureBlock=u,n.clone=p,n.cloneDeep=c,n.buildMatchMemberExpression=d,n.removeComments=f,n.inheritsComments=h,n.inherits=m,n.__esModule=!0;var y=g(e("to-fast-properties")),b=g(e("lodash/array/compact")),v=g(e("lodash/object/assign")),x=g(e("lodash/collection/each")),E=g(e("lodash/array/uniq")),_=n,S=["consequent","body","alternate"];n.STATEMENT_OR_BLOCK_KEYS=S;var I=["Array","Object","Number","Boolean","Date","Array","String","Promise","Set","Map","WeakMap","WeakSet","Uint16Array","ArrayBuffer","DataView","Int8Array","Uint8Array","Uint8ClampedArray","Uint32Array","Int32Array","Float32Array","Int16Array","Float64Array"];n.NATIVE_TYPE_NAMES=I;var w=["body","expressions"];n.FLATTENABLE_KEYS=w;var k=["left","init"];n.FOR_INIT_KEYS=k;var A=["leadingComments","trailingComments"];n.COMMENT_KEYS=A;var C=e("./visitor-keys");n.VISITOR_KEYS=C;var T=e("./builder-keys");n.BUILDER_KEYS=T;var j=e("./alias-keys");n.ALIAS_KEYS=j,_.FLIPPED_ALIAS_KEYS={},x(_.VISITOR_KEYS,function(e,t){r(t,!0)}),x(_.ALIAS_KEYS,function(e,t){x(e,function(e){var n,r,l=(n=_.FLIPPED_ALIAS_KEYS,r=e,!n[r]&&(n[r]=[]),n[r]);l.push(t)})}),x(_.FLIPPED_ALIAS_KEYS,function(e,t){_[t.toUpperCase()+"_TYPES"]=e,r(t,!1)});var M=Object.keys(_.VISITOR_KEYS).concat(Object.keys(_.FLIPPED_ALIAS_KEYS));n.TYPES=M,x(_.VISITOR_KEYS,function(e,t){if(!_.BUILDER_KEYS[t]){var n={};x(e,function(e){n[e]=null}),_.BUILDER_KEYS[t]=n}}),x(_.BUILDER_KEYS,function(e,t){_[t[0].toLowerCase()+t.slice(1)]=function(){var n={};n.start=null,n.type=t;var r=0;for(var l in e){var i=arguments[r++];void 0===i&&(i=e[l]),n[l]=i}return n}}),y(_),y(_.VISITOR_KEYS),n.__esModule=!0,v(_,e("./retrievers")),v(_,e("./validators")),v(_,e("./converters"))},{"./alias-keys":150,"./builder-keys":151,"./converters":152,"./retrievers":154,"./validators":155,"./visitor-keys":156,"lodash/array/compact":310,"lodash/array/uniq":314,"lodash/collection/each":316,"lodash/object/assign":402,"to-fast-properties":450}],154:[function(e,t,n){"use strict";function r(e){for(var t=[].concat(e),n=a();t.length;){var r=t.shift();if(r){var l=o.getBindingIdentifiers.keys[r.type];if(o.isIdentifier(r))n[r.name]=r;else if(o.isExportDeclaration(r))o.isDeclaration(e.declaration)&&t.push(e.declaration);else if(l)for(var i=0;i<l.length;i++){var s=l[i];t=t.concat(r[s]||[])}}}return n}function l(e){var t=[],n=function(e){t=t.concat(l(e))};return o.isIfStatement(e)?(n(e.consequent),n(e.alternate)):o.isFor(e)||o.isWhile(e)?n(e.body):o.isProgram(e)||o.isBlockStatement(e)?n(e.body[e.body.length-1]):o.isLoop()||e&&t.push(e),t}var i=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};n.getBindingIdentifiers=r,n.getLastStatements=l,n.__esModule=!0;var a=s(e("../helpers/object")),o=i(e("./index"));r.keys={UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],VariableDeclarator:["id"],FunctionDeclaration:["id"],FunctionExpression:["id"],ClassDeclaration:["id"],ClassExpression:["id"],SpreadElement:["argument"],RestElement:["argument"],UpdateExpression:["argument"],SpreadProperty:["argument"],Property:["value"],ComprehensionBlock:["left"],AssignmentPattern:["left"],ComprehensionExpression:["blocks"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]}},{"../helpers/object":41,"./index":153}],155:[function(e,t,n){"use strict";function r(e,t){switch(t.type){case"MemberExpression":return t.property===e&&t.computed?!0:t.object===e?!0:!1;case"MetaProperty":return!1;case"Property":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":for(var n=0;n<t.params.length;n++){var r=t.params[n];if(r===e)return!1}return t.id!==e;case"ExportSpecifier":return t.exported!==e;case"ImportSpecifier":return t.imported!==e;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"MethodDefinition":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1;case"ImportSpecifier":return!1;case"ImportNamespaceSpecifier":return!1}return!0}function l(e,t,n){return(g.isIdentifier(e,n)||g.isJSXIdentifier(e,n))&&g.isReferenced(e,t)}function i(e){return h(e)&&m.keyword.isIdentifierName(e)&&!m.keyword.isReservedWordES6(e,!0)}function s(e){return g.isVariableDeclaration(e)&&("var"!==e.kind||e._let)}function a(e){return g.isFunctionDeclaration(e)||g.isClassDeclaration(e)||g.isLet(e)}function o(e){return g.isVariableDeclaration(e,{kind:"var"})&&!e._let}function u(e){return g.isImportDefaultSpecifier(e)||g.isExportDefaultSpecifier(e)||g.isIdentifier(e.imported||e.exported,{name:"default"})}function p(e,t){return g.isBlockStatement(e)&&g.isFunction(t,{body:e})?!1:g.isScopable(e)}function c(e){return g.isType(e.type,"Immutable")?!0:g.isLiteral(e)?e.regex?!1:!0:g.isIdentifier(e)&&"undefined"===e.name?!0:!1}var d=function(e){return e&&e.__esModule?e:{"default":e}},f=function(e){return e&&e.__esModule?e["default"]:e};n.isReferenced=r,n.isReferencedIdentifier=l,n.isValidIdentifier=i,n.isLet=s,n.isBlockScoped=a,n.isVar=o,n.isSpecifierDefault=u,n.isScope=p,n.isImmutable=c,n.__esModule=!0;var h=f(e("lodash/lang/isString")),m=f(e("esutils")),g=d(e("./index"))},{"./index":153,esutils:300,"lodash/lang/isString":399}],156:[function(e,t){t.exports={ArrayExpression:["elements"],ArrayPattern:["elements","typeAnnotation"],ArrowFunctionExpression:["params","body","returnType"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass","typeParameters","superTypeParameters","implements"],ClassExpression:["id","body","superClass","typeParameters","superTypeParameters","implements"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],Decorator:["expression"],DebuggerStatement:[],DoWhileStatement:["body","test"],DoExpression:["body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation"],IfStatement:["test","consequent","alternate"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["imported","local"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties","typeAnnotation"],Program:["body"],Property:["key","value"],RestElement:["argument","typeAnnotation"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"],ExportAllDeclaration:["source","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportDefaultSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportSpecifier:["local","exported"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],ClassImplements:["id","typeParameters"],ClassProperty:["key","value","typeAnnotation"],DeclareClass:["id","typeParameters","extends","body"],DeclareFunction:["id"],DeclareModule:["id","body"],DeclareVariable:["id"],FunctionTypeAnnotation:["typeParameters","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],IntersectionTypeAnnotation:["types"],NullableTypeAnnotation:["typeAnnotation"],NumberTypeAnnotation:[],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],ObjectTypeAnnotation:["properties","indexers","callProperties"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value"],ObjectTypeProperty:["key","value"],QualifiedTypeIdentifier:["id","qualification"],UnionTypeAnnotation:["types"],VoidTypeAnnotation:[],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","closingElement","children"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXSpreadAttribute:["argument"]}},{}],157:[function(e,t,n){(function(t,r){"use strict";function l(e,t){var n=t||l.EXTENSIONS,r=T.extname(e);return _(n,r)}function i(t){try{return e.resolve(t)}catch(n){return null}}function s(e){R||(R=new k,R.paths=k._nodeModulePaths(t.cwd()));try{return k._resolveFilename(e,R)}catch(n){return null}}function a(e){return e?e.split(","):[]}function o(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(g).join("|"),"i")),I(e))return E.makeRe(e,{nocase:!0});if(w(e))return e;throw new TypeError("illegal type for regexify")}function u(e,t){if(!e)return[];if(v(e))return u([e],t);if(I(e))return u(a(e),t);if(Array.isArray(e))return t&&(e=e.map(t)),e;throw new TypeError("illegal type for arrayify")}function p(e){return"true"===e?!0:"false"===e?!1:e}function c(e,t,r){var l=n.templates[e];if(!l)throw new ReferenceError("unknown template "+e);if(t===!0&&(r=!0,t=null),l=b(l),A(t)||S(l,N,null,t),l.body.length>1)return l.body;var i=l.body[0];return!r&&L.isExpressionStatement(i)?i.expression:i}function d(e,t){var n=C({filename:e,looseModules:!0},t).program;return n=S.removeProperties(n)}function f(){var e={},t=T.join(r,"transformation/templates");if(!P.existsSync(t))throw new ReferenceError(x.get("missingTemplatesDirectory"));return j(P.readdirSync(t),function(n){if("."!==n[0]){var r=T.basename(n,T.extname(n)),l=T.join(t,n),i=P.readFileSync(l,"utf8");e[r]=d(l,i)}}),e}var h=function(e){return e&&e.__esModule?e:{"default":e}},m=function(e){return e&&e.__esModule?e["default"]:e};n.canCompile=l,n.resolve=i,n.resolveRelative=s,n.list=a,n.regexify=o,n.arrayify=u,n.booleanify=p,n.template=c,n.parseTemplate=d,n.__esModule=!0,e("./patch");var g=m(e("lodash/string/escapeRegExp")),y=m(e("debug/node")),b=m(e("lodash/lang/cloneDeep")),v=m(e("lodash/lang/isBoolean")),x=h(e("./messages")),E=m(e("minimatch")),_=m(e("lodash/collection/contains")),S=m(e("./traversal")),I=m(e("lodash/lang/isString")),w=m(e("lodash/lang/isRegExp")),k=m(e("module")),A=m(e("lodash/lang/isEmpty")),C=m(e("./helpers/parse")),T=m(e("path")),j=m(e("lodash/collection/each")),M=m(e("lodash/object/has")),P=m(e("fs")),L=h(e("./types")),O=e("util");n.inherits=O.inherits,n.inspect=O.inspect;var D=y("babel");n.debug=D,l.EXTENSIONS=[".js",".jsx",".es6",".es"];var R,N={enter:function(e,t,n,r){L.isExpressionStatement(e)&&(e=e.expression),L.isIdentifier(e)&&M(r,e.name)&&(this.skip(),this.replaceInline(r[e.name]))}};try{n.templates=e("../../templates.json")}catch(F){if("MODULE_NOT_FOUND"!==F.code)throw F;n.templates=f()}}).call(this,e("_process"),"/lib/babel")},{"../../templates.json":453,"./helpers/parse":42,"./messages":43,"./patch":44,"./traversal":144,"./types":153,_process:183,"debug/node":293,fs:172,"lodash/collection/contains":315,"lodash/collection/each":316,"lodash/lang/cloneDeep":388,"lodash/lang/isBoolean":391,"lodash/lang/isEmpty":392,"lodash/lang/isRegExp":398,"lodash/lang/isString":399,"lodash/object/has":405,"lodash/string/escapeRegExp":410,minimatch:414,module:172,path:182,util:199}],158:[function(e){var t=e("../lib/types"),n=t.Type,r=n.def,l=n.or,i=t.builtInTypes,s=i.string,a=i.number,o=i.boolean,u=i.RegExp,p=e("../lib/shared"),c=p.defaults,d=p.geq;r("Printable").field("loc",l(r("SourceLocation"),null),c["null"],!0),r("Node").bases("Printable").field("type",s).field("comments",l([r("Comment")],null),c["null"],!0),r("SourceLocation").build("start","end","source").field("start",r("Position")).field("end",r("Position")).field("source",l(s,null),c["null"]),r("Position").build("line","column").field("line",d(1)).field("column",d(0)),r("Program").bases("Node").build("body").field("body",[r("Statement")]),r("Function").bases("Node").field("id",l(r("Identifier"),null),c["null"]).field("params",[r("Pattern")]).field("body",l(r("BlockStatement"),r("Expression"))),r("Statement").bases("Node"),r("EmptyStatement").bases("Statement").build(),r("BlockStatement").bases("Statement").build("body").field("body",[r("Statement")]),r("ExpressionStatement").bases("Statement").build("expression").field("expression",r("Expression")),r("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",r("Expression")).field("consequent",r("Statement")).field("alternate",l(r("Statement"),null),c["null"]),r("LabeledStatement").bases("Statement").build("label","body").field("label",r("Identifier")).field("body",r("Statement")),r("BreakStatement").bases("Statement").build("label").field("label",l(r("Identifier"),null),c["null"]),r("ContinueStatement").bases("Statement").build("label").field("label",l(r("Identifier"),null),c["null"]),r("WithStatement").bases("Statement").build("object","body").field("object",r("Expression")).field("body",r("Statement")),r("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",r("Expression")).field("cases",[r("SwitchCase")]).field("lexical",o,c["false"]),r("ReturnStatement").bases("Statement").build("argument").field("argument",l(r("Expression"),null)),r("ThrowStatement").bases("Statement").build("argument").field("argument",r("Expression")),r("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",r("BlockStatement")).field("handler",l(r("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[r("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[r("CatchClause")],c.emptyArray).field("finalizer",l(r("BlockStatement"),null),c["null"]),r("CatchClause").bases("Node").build("param","guard","body").field("param",r("Pattern")).field("guard",l(r("Expression"),null),c["null"]).field("body",r("BlockStatement")),r("WhileStatement").bases("Statement").build("test","body").field("test",r("Expression")).field("body",r("Statement")),r("DoWhileStatement").bases("Statement").build("body","test").field("body",r("Statement")).field("test",r("Expression")),r("ForStatement").bases("Statement").build("init","test","update","body").field("init",l(r("VariableDeclaration"),r("Expression"),null)).field("test",l(r("Expression"),null)).field("update",l(r("Expression"),null)).field("body",r("Statement")),r("ForInStatement").bases("Statement").build("left","right","body","each").field("left",l(r("VariableDeclaration"),r("Expression"))).field("right",r("Expression")).field("body",r("Statement")).field("each",o),r("DebuggerStatement").bases("Statement").build(),r("Declaration").bases("Statement"),r("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",r("Identifier")),r("FunctionExpression").bases("Function","Expression").build("id","params","body"),r("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",l("var","let","const")).field("declarations",[l(r("VariableDeclarator"),r("Identifier"))]),r("VariableDeclarator").bases("Node").build("id","init").field("id",r("Pattern")).field("init",l(r("Expression"),null)),r("Expression").bases("Node","Pattern"),r("ThisExpression").bases("Expression").build(),r("ArrayExpression").bases("Expression").build("elements").field("elements",[l(r("Expression"),null)]),r("ObjectExpression").bases("Expression").build("properties").field("properties",[r("Property")]),r("Property").bases("Node").build("kind","key","value").field("kind",l("init","get","set")).field("key",l(r("Literal"),r("Identifier"))).field("value",l(r("Expression"),r("Pattern"))),r("SequenceExpression").bases("Expression").build("expressions").field("expressions",[r("Expression")]);var f=l("-","+","!","~","typeof","void","delete");r("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",r("Expression")).field("prefix",o,c["true"]); var h=l("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");r("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",r("Expression")).field("right",r("Expression"));var m=l("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");r("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",r("Pattern")).field("right",r("Expression"));var g=l("++","--");r("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",g).field("argument",r("Expression")).field("prefix",o);var y=l("||","&&");r("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",r("Expression")).field("right",r("Expression")),r("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",r("Expression")).field("consequent",r("Expression")).field("alternate",r("Expression")),r("NewExpression").bases("Expression").build("callee","arguments").field("callee",r("Expression")).field("arguments",[r("Expression")]),r("CallExpression").bases("Expression").build("callee","arguments").field("callee",r("Expression")).field("arguments",[r("Expression")]),r("MemberExpression").bases("Expression").build("object","property","computed").field("object",r("Expression")).field("property",l(r("Identifier"),r("Expression"))).field("computed",o),r("Pattern").bases("Node"),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[l(r("PropertyPattern"),r("Property"))]),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",l(r("Literal"),r("Identifier"))).field("pattern",r("Pattern")),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[l(r("Pattern"),null)]),r("SwitchCase").bases("Node").build("test","consequent").field("test",l(r("Expression"),null)).field("consequent",[r("Statement")]),r("Identifier").bases("Node","Expression","Pattern").build("name").field("name",s),r("Literal").bases("Node","Expression").build("value").field("value",l(s,o,null,a,u)),r("Comment").bases("Printable").field("value",s).field("leading",o,c["true"]).field("trailing",o,c["false"]),r("Block").bases("Comment").build("value","leading","trailing"),r("Line").bases("Comment").build("value","leading","trailing")},{"../lib/shared":169,"../lib/types":170}],159:[function(e){e("./core");var t=e("../lib/types"),n=t.Type.def,r=t.Type.or,l=t.builtInTypes,i=l.string,s=l.boolean;n("XMLDefaultDeclaration").bases("Declaration").field("namespace",n("Expression")),n("XMLAnyName").bases("Expression"),n("XMLQualifiedIdentifier").bases("Expression").field("left",r(n("Identifier"),n("XMLAnyName"))).field("right",r(n("Identifier"),n("Expression"))).field("computed",s),n("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",r(n("Identifier"),n("Expression"))).field("computed",s),n("XMLAttributeSelector").bases("Expression").field("attribute",n("Expression")),n("XMLFilterExpression").bases("Expression").field("left",n("Expression")).field("right",n("Expression")),n("XMLElement").bases("XML","Expression").field("contents",[n("XML")]),n("XMLList").bases("XML","Expression").field("contents",[n("XML")]),n("XML").bases("Node"),n("XMLEscape").bases("XML").field("expression",n("Expression")),n("XMLText").bases("XML").field("text",i),n("XMLStartTag").bases("XML").field("contents",[n("XML")]),n("XMLEndTag").bases("XML").field("contents",[n("XML")]),n("XMLPointTag").bases("XML").field("contents",[n("XML")]),n("XMLName").bases("XML").field("contents",r(i,[n("XML")])),n("XMLAttribute").bases("XML").field("value",i),n("XMLCdata").bases("XML").field("contents",i),n("XMLComment").bases("XML").field("contents",i),n("XMLProcessingInstruction").bases("XML").field("target",i).field("contents",r(i,null))},{"../lib/types":170,"./core":158}],160:[function(e){e("./core");var t=e("../lib/types"),n=t.Type.def,r=t.Type.or,l=t.builtInTypes,i=l.boolean,s=(l.object,l.string),a=e("../lib/shared").defaults;n("Function").field("generator",i,a["false"]).field("expression",i,a["false"]).field("defaults",[r(n("Expression"),null)],a.emptyArray).field("rest",r(n("Identifier"),null),a["null"]),n("FunctionDeclaration").build("id","params","body","generator","expression"),n("FunctionExpression").build("id","params","body","generator","expression"),n("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,a["null"]).field("generator",!1,a["false"]),n("YieldExpression").bases("Expression").build("argument","delegate").field("argument",r(n("Expression"),null)).field("delegate",i,a["false"]),n("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",r(n("Expression"),null)),n("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",r(n("Expression"),null)),n("ComprehensionBlock").bases("Node").build("left","right","each").field("left",n("Pattern")).field("right",n("Expression")).field("each",i),n("ModuleSpecifier").bases("Literal").build("value").field("value",s),n("Property").field("key",r(n("Literal"),n("Identifier"),n("Expression"))).field("method",i,a["false"]).field("shorthand",i,a["false"]).field("computed",i,a["false"]),n("PropertyPattern").field("key",r(n("Literal"),n("Identifier"),n("Expression"))).field("computed",i,a["false"]),n("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",r("init","get","set","")).field("key",r(n("Literal"),n("Identifier"),n("Expression"))).field("value",n("Function")).field("computed",i,a["false"]),n("SpreadElement").bases("Node").build("argument").field("argument",n("Expression")),n("ArrayExpression").field("elements",[r(n("Expression"),n("SpreadElement"),null)]),n("NewExpression").field("arguments",[r(n("Expression"),n("SpreadElement"))]),n("CallExpression").field("arguments",[r(n("Expression"),n("SpreadElement"))]),n("SpreadElementPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("ArrayPattern").field("elements",[r(n("Pattern"),null,n("SpreadElement"))]);var o=r(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"));n("ClassProperty").bases("Declaration").build("key").field("key",r(n("Literal"),n("Identifier"),n("Expression"))).field("computed",i,a["false"]),n("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",o),n("ClassBody").bases("Declaration").build("body").field("body",[o]),n("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",n("Identifier")).field("body",n("ClassBody")).field("superClass",r(n("Expression"),null),a["null"]),n("ClassExpression").bases("Expression").build("id","body","superClass").field("id",r(n("Identifier"),null),a["null"]).field("body",n("ClassBody")).field("superClass",r(n("Expression"),null),a["null"]).field("implements",[n("ClassImplements")],a.emptyArray),n("ClassImplements").bases("Node").build("id").field("id",n("Identifier")).field("superClass",r(n("Expression"),null),a["null"]),n("Specifier").bases("Node"),n("NamedSpecifier").bases("Specifier").field("id",n("Identifier")).field("name",r(n("Identifier"),null),a["null"]),n("ExportSpecifier").bases("NamedSpecifier").build("id","name"),n("ExportBatchSpecifier").bases("Specifier").build(),n("ImportSpecifier").bases("NamedSpecifier").build("id","name"),n("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",n("Identifier")),n("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",n("Identifier")),n("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",i).field("declaration",r(n("Declaration"),n("Expression"),null)).field("specifiers",[r(n("ExportSpecifier"),n("ExportBatchSpecifier"))],a.emptyArray).field("source",r(n("ModuleSpecifier"),null),a["null"]),n("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[r(n("ImportSpecifier"),n("ImportNamespaceSpecifier"),n("ImportDefaultSpecifier"))],a.emptyArray).field("source",n("ModuleSpecifier")),n("TaggedTemplateExpression").bases("Expression").field("tag",n("Expression")).field("quasi",n("TemplateLiteral")),n("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[n("TemplateElement")]).field("expressions",[n("Expression")]),n("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:s,raw:s}).field("tail",i)},{"../lib/shared":169,"../lib/types":170,"./core":158}],161:[function(e){e("./core");var t=e("../lib/types"),n=t.Type.def,r=t.Type.or,l=t.builtInTypes,i=l.boolean,s=e("../lib/shared").defaults;n("Function").field("async",i,s["false"]),n("SpreadProperty").bases("Node").build("argument").field("argument",n("Expression")),n("ObjectExpression").field("properties",[r(n("Property"),n("SpreadProperty"))]),n("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("ObjectPattern").field("properties",[r(n("PropertyPattern"),n("SpreadPropertyPattern"),n("Property"),n("SpreadProperty"))]),n("AwaitExpression").bases("Expression").build("argument","all").field("argument",r(n("Expression"),null)).field("all",i,s["false"])},{"../lib/shared":169,"../lib/types":170,"./core":158}],162:[function(e){e("./core");var t=e("../lib/types"),n=t.Type.def,r=t.Type.or,l=t.builtInTypes,i=l.string,s=l.boolean,a=e("../lib/shared").defaults;n("JSXAttribute").bases("Node").build("name","value").field("name",r(n("JSXIdentifier"),n("JSXNamespacedName"))).field("value",r(n("Literal"),n("JSXExpressionContainer"),null),a["null"]),n("JSXIdentifier").bases("Node").build("name").field("name",i),n("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",n("JSXIdentifier")).field("name",n("JSXIdentifier")),n("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",r(n("JSXIdentifier"),n("JSXMemberExpression"))).field("property",n("JSXIdentifier")).field("computed",s,a.false);var o=r(n("JSXIdentifier"),n("JSXNamespacedName"),n("JSXMemberExpression"));n("JSXSpreadAttribute").bases("Node").build("argument").field("argument",n("Expression"));var u=[r(n("JSXAttribute"),n("JSXSpreadAttribute"))];n("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n("Expression")),n("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",n("JSXOpeningElement")).field("closingElement",r(n("JSXClosingElement"),null),a["null"]).field("children",[r(n("JSXElement"),n("JSXExpressionContainer"),n("JSXText"),n("Literal"))],a.emptyArray).field("name",o,function(){return this.openingElement.name}).field("selfClosing",s,function(){return this.openingElement.selfClosing}).field("attributes",u,function(){return this.openingElement.attributes}),n("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",o).field("attributes",u,a.emptyArray).field("selfClosing",s,a["false"]),n("JSXClosingElement").bases("Node").build("name").field("name",o),n("JSXText").bases("Literal").build("value").field("value",i),n("JSXEmptyExpression").bases("Expression").build(),n("Type").bases("Node"),n("AnyTypeAnnotation").bases("Type"),n("VoidTypeAnnotation").bases("Type"),n("NumberTypeAnnotation").bases("Type"),n("StringTypeAnnotation").bases("Type"),n("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",i).field("raw",i),n("BooleanTypeAnnotation").bases("Type"),n("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n("Type")),n("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",n("Type")),n("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[n("FunctionTypeParam")]).field("returnType",n("Type")).field("rest",r(n("FunctionTypeParam"),null)).field("typeParameters",r(n("TypeParameterDeclaration"),null)),n("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n("Identifier")).field("typeAnnotation",n("Type")).field("optional",s),n("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",n("Type")),n("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[n("ObjectTypeProperty")]).field("indexers",[n("ObjectTypeIndexer")],a.emptyArray).field("callProperties",[n("ObjectTypeCallProperty")],a.emptyArray),n("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",r(n("Literal"),n("Identifier"))).field("value",n("Type")).field("optional",s),n("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",n("Identifier")).field("key",n("Type")).field("value",n("Type")),n("ObjectTypeCallProperty").bases("Node").build("value").field("value",n("FunctionTypeAnnotation")).field("static",s,!1),n("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",r(n("Identifier"),n("QualifiedTypeIdentifier"))).field("id",n("Identifier")),n("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",r(n("Identifier"),n("QualifiedTypeIdentifier"))).field("typeParameters",r(n("TypeParameterInstantiation"),null)),n("MemberTypeAnnotation").bases("Type").build("object","property").field("object",n("Identifier")).field("property",r(n("MemberTypeAnnotation"),n("GenericTypeAnnotation"))),n("UnionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",n("Type")),n("Identifier").field("typeAnnotation",r(n("TypeAnnotation"),null),a["null"]),n("TypeParameterDeclaration").bases("Node").build("params").field("params",[n("Identifier")]),n("TypeParameterInstantiation").bases("Node").build("params").field("params",[n("Type")]),n("Function").field("returnType",r(n("TypeAnnotation"),null),a["null"]).field("typeParameters",r(n("TypeParameterDeclaration"),null),a["null"]),n("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",n("TypeAnnotation")).field("static",s,!1),n("ClassImplements").field("typeParameters",r(n("TypeParameterInstantiation"),null),a["null"]),n("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",n("Identifier")).field("typeParameters",r(n("TypeParameterDeclaration"),null),a["null"]).field("body",n("ObjectTypeAnnotation")).field("extends",[n("InterfaceExtends")]),n("InterfaceExtends").bases("Node").build("id").field("id",n("Identifier")).field("typeParameters",r(n("TypeParameterInstantiation"),null)),n("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",n("Identifier")).field("typeParameters",r(n("TypeParameterDeclaration"),null)).field("right",n("Type")),n("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TypeAnnotation")),n("TupleTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("DeclareVariable").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareFunction").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareClass").bases("InterfaceDeclaration").build("id"),n("DeclareModule").bases("Statement").build("id","body").field("id",r(n("Identifier"),n("Literal"))).field("body",n("BlockStatement"))},{"../lib/shared":169,"../lib/types":170,"./core":158}],163:[function(e){e("./core");var t=e("../lib/types"),n=t.Type.def,r=t.Type.or,l=e("../lib/shared").geq;n("ForOfStatement").bases("Statement").build("left","right","body").field("left",r(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("LetStatement").bases("Statement").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Statement")),n("LetExpression").bases("Expression").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Expression")),n("GraphExpression").bases("Expression").build("index","expression").field("index",l(0)).field("expression",n("Literal")),n("GraphIndexExpression").bases("Expression").build("index").field("index",l(0))},{"../lib/shared":169,"../lib/types":170,"./core":158}],164:[function(e,t){function n(e,t,n){return c.check(n)?n.length=0:n=null,l(e,t,n)}function r(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function l(e,t,n){return e===t?!0:c.check(e)?i(e,t,n):d.check(e)?s(e,t,n):f.check(e)?f.check(t)&&+e===+t:h.check(e)?h.check(t)&&e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.ignoreCase===t.ignoreCase:e==t}function i(e,t,n){c.assert(e);var r=e.length;if(!c.check(t)||t.length!==r)return n&&n.push("length"),!1;for(var i=0;r>i;++i){if(n&&n.push(i),i in e!=i in t)return!1;if(!l(e[i],t[i],n))return!1;n&&a.strictEqual(n.pop(),i)}return!0}function s(e,t,n){if(d.assert(e),!d.check(t))return!1;if(e.type!==t.type)return n&&n.push("type"),!1;var r=u(e),i=r.length,s=u(t),o=s.length;if(i===o){for(var c=0;i>c;++c){var f=r[c],h=p(e,f),g=p(t,f);if(n&&n.push(f),!l(h,g,n))return!1;n&&a.strictEqual(n.pop(),f)}return!0}if(!n)return!1;var y=Object.create(null);for(c=0;i>c;++c)y[r[c]]=!0;for(c=0;o>c;++c){if(f=s[c],!m.call(y,f))return n.push(f),!1;delete y[f]}for(f in y){n.push(f);break}return!1}var a=e("assert"),o=e("../main"),u=o.getFieldNames,p=o.getFieldValue,c=o.builtInTypes.array,d=o.builtInTypes.object,f=o.builtInTypes.Date,h=o.builtInTypes.RegExp,m=Object.prototype.hasOwnProperty;n.assert=function(e,t){var l=[];n(e,t,l)||(0===l.length?a.strictEqual(e,t):a.ok(!1,"Nodes differ in the following path: "+l.map(r).join("")))},t.exports=n},{"../main":171,assert:173}],165:[function(e,t){function n(e,t,r){o.ok(this instanceof n),h.call(this,e,t,r)}function r(e){return p.BinaryExpression.check(e)||p.LogicalExpression.check(e)}function l(e){return p.CallExpression.check(e)?!0:f.check(e)?e.some(l):p.Node.check(e)?u.someField(e,function(e,t){return l(t)}):!1}function i(e){for(var t,n;e.parent;e=e.parent){if(t=e.node,n=e.parent.node,p.BlockStatement.check(n)&&"body"===e.parent.name&&0===e.name)return o.strictEqual(n.body[0],t),!0;if(p.ExpressionStatement.check(n)&&"expression"===e.name)return o.strictEqual(n.expression,t),!0;if(p.SequenceExpression.check(n)&&"expressions"===e.parent.name&&0===e.name)o.strictEqual(n.expressions[0],t);else if(p.CallExpression.check(n)&&"callee"===e.name)o.strictEqual(n.callee,t);else if(p.MemberExpression.check(n)&&"object"===e.name)o.strictEqual(n.object,t);else if(p.ConditionalExpression.check(n)&&"test"===e.name)o.strictEqual(n.test,t);else if(r(n)&&"left"===e.name)o.strictEqual(n.left,t);else{if(!p.UnaryExpression.check(n)||n.prefix||"argument"!==e.name)return!1;o.strictEqual(n.argument,t)}}return!0}function s(e){if(p.VariableDeclaration.check(e.node)){var t=e.get("declarations").value;if(!t||0===t.length)return e.prune()}else if(p.ExpressionStatement.check(e.node)){if(!e.get("expression").value)return e.prune()}else p.IfStatement.check(e.node)&&a(e);return e}function a(e){var t=e.get("test").value,n=e.get("alternate").value,r=e.get("consequent").value;if(r||n){if(!r&&n){var l=c.unaryExpression("!",t,!0);p.UnaryExpression.check(t)&&"!"===t.operator&&(l=t.argument),e.get("test").replace(l),e.get("consequent").replace(n),e.get("alternate").replace()}}else{var i=c.expressionStatement(t);e.replace(i)}}var o=e("assert"),u=e("./types"),p=u.namedTypes,c=u.builders,d=u.builtInTypes.number,f=u.builtInTypes.array,h=e("./path"),m=e("./scope");e("util").inherits(n,h);var g=n.prototype;Object.defineProperties(g,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),g.replace=function(){return delete this.node,delete this.parent,delete this.scope,h.prototype.replace.apply(this,arguments)},g.prune=function(){var e=this.parent;return this.replace(),s(e)},g._computeNode=function(){var e=this.value;if(p.Node.check(e))return e;var t=this.parentPath;return t&&t.node||null},g._computeParent=function(){var e=this.value,t=this.parentPath;if(!p.Node.check(e)){for(;t&&!p.Node.check(t.value);)t=t.parentPath;t&&(t=t.parentPath)}for(;t&&!p.Node.check(t.value);)t=t.parentPath;return t||null},g._computeScope=function(){var e=this.value,t=this.parentPath,n=t&&t.scope;return p.Node.check(e)&&m.isEstablishedBy(e)&&(n=new m(this,n)),n||null},g.getValueProperty=function(e){return u.getFieldValue(this.value,e)},g.needsParens=function(e){var t=this.parentPath;if(!t)return!1;var n=this.value;if(!p.Expression.check(n))return!1;if("Identifier"===n.type)return!1;for(;!p.Node.check(t.value);)if(t=t.parentPath,!t)return!1;var r=t.value;switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return"MemberExpression"===r.type&&"object"===this.name&&r.object===n;case"BinaryExpression":case"LogicalExpression":switch(r.type){case"CallExpression":return"callee"===this.name&&r.callee===n;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return"object"===this.name&&r.object===n;case"BinaryExpression":case"LogicalExpression":var i=r.operator,t=y[i],s=n.operator,a=y[s];if(t>a)return!0;if(t===a&&"right"===this.name)return o.strictEqual(r.right,n),!0;default:return!1}case"SequenceExpression":switch(r.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(r.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===r.type&&d.check(n.value)&&"object"===this.name&&r.object===n;case"AssignmentExpression":case"ConditionalExpression":switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&r.callee===n;case"ConditionalExpression":return"test"===this.name&&r.test===n;case"MemberExpression":return"object"===this.name&&r.object===n;default:return!1}default:if("NewExpression"===r.type&&"callee"===this.name&&r.callee===n)return l(n)}return e!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement()?!0:!1};var y={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,t){e.forEach(function(e){y[e]=t})}),g.canBeFirstInStatement=function(){var e=this.node;return!p.FunctionExpression.check(e)&&!p.ObjectExpression.check(e)},g.firstInStatement=function(){return i(this)},t.exports=n},{"./path":167,"./scope":168,"./types":170,assert:173,util:199}],166:[function(e,t){function n(){o.ok(this instanceof n),this._reusableContextStack=[],this._methodNameTable=r(this),this._shouldVisitComments=m.call(this._methodNameTable,"Block")||m.call(this._methodNameTable,"Line"),this.Context=s(this),this._visiting=!1,this._changeReported=!1}function r(e){var t=Object.create(null);for(var n in e)/^visit[A-Z]/.test(n)&&(t[n.slice("visit".length)]=!0);for(var r=u.computeSupertypeLookupTable(t),l=Object.create(null),t=Object.keys(r),i=t.length,s=0;i>s;++s){var a=t[s];n="visit"+r[a],h.check(e[n])&&(l[a]=n)}return l}function l(e,t){for(var n in t)m.call(t,n)&&(e[n]=t[n]);return e}function i(e,t){o.ok(e instanceof p),o.ok(t instanceof n);var r=e.value;if(d.check(r))e.each(t.visitWithoutReset,t);else if(f.check(r)){var l=u.getFieldNames(r);t._shouldVisitComments&&r.comments&&l.indexOf("comments")<0&&l.push("comments");for(var i=l.length,s=[],a=0;i>a;++a){var c=l[a];m.call(r,c)||(r[c]=u.getFieldValue(r,c)),s.push(e.get(c))}for(var a=0;i>a;++a)t.visitWithoutReset(s[a])}else;return e.value}function s(e){function t(r){o.ok(this instanceof t),o.ok(this instanceof n),o.ok(r instanceof p),Object.defineProperty(this,"visitor",{value:e,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=r,this.needToCallTraverse=!0,Object.seal(this)}o.ok(e instanceof n);var r=t.prototype=Object.create(e);return r.constructor=t,l(r,b),t}var a,o=e("assert"),u=e("./types"),p=e("./node-path"),c=u.namedTypes.Printable,d=u.builtInTypes.array,f=u.builtInTypes.object,h=u.builtInTypes.function,m=Object.prototype.hasOwnProperty;n.fromMethodsObject=function(e){function t(){o.ok(this instanceof t),n.call(this)}if(e instanceof n)return e;if(!f.check(e))return new n;var r=t.prototype=Object.create(g);return r.constructor=t,l(r,e),l(t,n),h.assert(t.fromMethodsObject),h.assert(t.visit),new t},n.visit=function(e,t){return n.fromMethodsObject(t).visit(e)};var g=n.prototype,y=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");g.visit=function(){o.ok(!this._visiting,y),this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var e=arguments.length,t=new Array(e),n=0;e>n;++n)t[n]=arguments[n];t[0]instanceof p||(t[0]=new p({root:t[0]}).get("root")),this.reset.apply(this,t);try{var r=this.visitWithoutReset(t[0]),l=!0}finally{if(this._visiting=!1,!l&&this._abortRequested)return t[0].value}return r},g.AbortRequest=function(){},g.abort=function(){var e=this;e._abortRequested=!0;var t=new e.AbortRequest;throw t.cancel=function(){e._abortRequested=!1},t},g.reset=function(){},g.visitWithoutReset=function(e){if(this instanceof this.Context)return this.visitor.visitWithoutReset(e);o.ok(e instanceof p);var t=e.value,n=c.check(t)&&this._methodNameTable[t.type];if(!n)return i(e,this);var r=this.acquireContext(e);try{return r.invokeVisitorMethod(n)}finally{this.releaseContext(r)}},g.acquireContext=function(e){return 0===this._reusableContextStack.length?new this.Context(e):this._reusableContextStack.pop().reset(e)},g.releaseContext=function(e){o.ok(e instanceof this.Context),this._reusableContextStack.push(e),e.currentPath=null},g.reportChanged=function(){this._changeReported=!0},g.wasChangeReported=function(){return this._changeReported};var b=Object.create(null);b.reset=function(e){return o.ok(this instanceof this.Context),o.ok(e instanceof p),this.currentPath=e,this.needToCallTraverse=!0,this},b.invokeVisitorMethod=function(e){o.ok(this instanceof this.Context),o.ok(this.currentPath instanceof p);var t=this.visitor[e].call(this,this.currentPath);t===!1?this.needToCallTraverse=!1:t!==a&&(this.currentPath=this.currentPath.replace(t)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),o.strictEqual(this.needToCallTraverse,!1,"Must either call this.traverse or return false in "+e);var n=this.currentPath;return n&&n.value},b.traverse=function(e,t){return o.ok(this instanceof this.Context),o.ok(e instanceof p),o.ok(this.currentPath instanceof p),this.needToCallTraverse=!1,i(e,n.fromMethodsObject(t||this.visitor))},b.visit=function(e,t){return o.ok(this instanceof this.Context),o.ok(e instanceof p),o.ok(this.currentPath instanceof p),this.needToCallTraverse=!1,n.fromMethodsObject(t||this.visitor).visitWithoutReset(e)},b.reportChanged=function(){this.visitor.reportChanged()},b.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},t.exports=n},{"./node-path":165,"./types":170,assert:173}],167:[function(e,t){function n(e,t,r){o.ok(this instanceof n),t?o.ok(t instanceof n):(t=null,r=null),this.value=e,this.parentPath=t,this.name=r,this.__childCache=null}function r(e){return e.__childCache||(e.__childCache=Object.create(null))}function l(e,t){var n=r(e),l=e.getValueProperty(t),i=n[t];return p.call(n,t)&&i.value===l||(i=n[t]=new e.constructor(l,e,t)),i}function i(){}function s(e,t,n,l){if(d.assert(e.value),0===t)return i;var s=e.value.length;if(1>s)return i;var a=arguments.length;2===a?(n=0,l=s):3===a?(n=Math.max(n,0),l=s):(n=Math.max(n,0),l=Math.min(l,s)),f.assert(n),f.assert(l);for(var u=Object.create(null),c=r(e),h=n;l>h;++h)if(p.call(e.value,h)){var m=e.get(h);o.strictEqual(m.name,h);var g=h+t;m.name=g,u[g]=m,delete c[h]}return delete c.length,function(){for(var t in u){var n=u[t];o.strictEqual(n.name,+t),c[t]=n,e.value[t]=n.value}}}function a(e){o.ok(e instanceof n);var t=e.parentPath;if(!t)return e;var l=t.value,i=r(t);if(l[e.name]===e.value)i[e.name]=e;else if(d.check(l)){var s=l.indexOf(e.value);s>=0&&(i[e.name=s]=e)}else l[e.name]=e.value,i[e.name]=e;return o.strictEqual(l[e.name],e.value),o.strictEqual(e.parentPath.get(e.name),e),e}var o=e("assert"),u=Object.prototype,p=u.hasOwnProperty,c=e("./types"),d=c.builtInTypes.array,f=c.builtInTypes.number,h=Array.prototype,m=(h.slice,h.map,n.prototype);m.getValueProperty=function(e){return this.value[e]},m.get=function(){for(var e=this,t=arguments,n=t.length,r=0;n>r;++r)e=l(e,t[r]);return e},m.each=function(e,t){for(var n=[],r=this.value.length,l=0,l=0;r>l;++l)p.call(this.value,l)&&(n[l]=this.get(l));for(t=t||this,l=0;r>l;++l)p.call(n,l)&&e.call(t,n[l])},m.map=function(e,t){var n=[];return this.each(function(t){n.push(e.call(this,t))},t),n},m.filter=function(e,t){var n=[];return this.each(function(t){e.call(this,t)&&n.push(t)},t),n},m.shift=function(){var e=s(this,-1),t=this.value.shift();return e(),t},m.unshift=function(){var e=s(this,arguments.length),t=this.value.unshift.apply(this.value,arguments);return e(),t},m.push=function(){return d.assert(this.value),delete r(this).length,this.value.push.apply(this.value,arguments)},m.pop=function(){d.assert(this.value);var e=r(this);return delete e[this.value.length-1],delete e.length,this.value.pop()},m.insertAt=function(e){var t=arguments.length,n=s(this,t-1,e);if(n===i)return this;e=Math.max(e,0);for(var r=1;t>r;++r)this.value[e+r-1]=arguments[r];return n(),this},m.insertBefore=function(){for(var e=this.parentPath,t=arguments.length,n=[this.name],r=0;t>r;++r)n.push(arguments[r]);return e.insertAt.apply(e,n)},m.insertAfter=function(){for(var e=this.parentPath,t=arguments.length,n=[this.name+1],r=0;t>r;++r)n.push(arguments[r]);return e.insertAt.apply(e,n)},m.replace=function(e){var t=[],n=this.parentPath.value,l=r(this.parentPath),i=arguments.length;if(a(this),d.check(n)){for(var u=n.length,p=s(this.parentPath,i-1,this.name+1),c=[this.name,1],f=0;i>f;++f)c.push(arguments[f]);var h=n.splice.apply(n,c);if(o.strictEqual(h[0],this.value),o.strictEqual(n.length,u-1+i),p(),0===i)delete this.value,delete l[this.name],this.__childCache=null;else{for(o.strictEqual(n[this.name],e),this.value!==e&&(this.value=e,this.__childCache=null),f=0;i>f;++f)t.push(this.parentPath.get(this.name+f));o.strictEqual(t[0],this)}}else 1===i?(this.value!==e&&(this.__childCache=null),this.value=n[this.name]=e,t.push(this)):0===i?(delete n[this.name],delete this.value,this.__childCache=null):o.ok(!1,"Could not replace path");return t},t.exports=n},{"./types":170,assert:173}],168:[function(e,t){function n(t,r){a.ok(this instanceof n),a.ok(t instanceof e("./node-path")),y.assert(t.value);var l;r?(a.ok(r instanceof n),l=r.depth+1):(r=null,l=0),Object.defineProperties(this,{path:{value:t},node:{value:t.value},isGlobal:{value:!r,enumerable:!0},depth:{value:l},parent:{value:r},bindings:{value:{}}})}function r(e,t){var n=e.value;y.assert(n),p.CatchClause.check(n)?s(e.get("param"),t):l(e,t)}function l(e,t){var n=e.value;e.parent&&p.FunctionExpression.check(e.parent.node)&&e.parent.node.id&&s(e.parent.get("id"),t),n&&(f.check(n)?e.each(function(e){i(e,t)}):p.Function.check(n)?(e.get("params").each(function(e){s(e,t) }),i(e.get("body"),t)):p.VariableDeclarator.check(n)?(s(e.get("id"),t),i(e.get("init"),t)):"ImportSpecifier"===n.type||"ImportNamespaceSpecifier"===n.type||"ImportDefaultSpecifier"===n.type?s(e.get(n.name?"name":"id"),t):c.check(n)&&!d.check(n)&&o.eachField(n,function(n,r){var l=e.get(n);a.strictEqual(l.value,r),i(l,t)}))}function i(e,t){var n=e.value;if(!n||d.check(n));else if(p.FunctionDeclaration.check(n))s(e.get("id"),t);else if(p.ClassDeclaration&&p.ClassDeclaration.check(n))s(e.get("id"),t);else if(y.check(n)){if(p.CatchClause.check(n)){var r=n.param.name,i=h.call(t,r);l(e.get("body"),t),i||delete t[r]}}else l(e,t)}function s(e,t){var n=e.value;p.Pattern.assert(n),p.Identifier.check(n)?h.call(t,n.name)?t[n.name].push(e):t[n.name]=[e]:p.ObjectPattern&&p.ObjectPattern.check(n)?e.get("properties").each(function(e){var n=e.value;p.Pattern.check(n)?s(e,t):p.Property.check(n)?s(e.get("value"),t):p.SpreadProperty&&p.SpreadProperty.check(n)&&s(e.get("argument"),t)}):p.ArrayPattern&&p.ArrayPattern.check(n)?e.get("elements").each(function(e){var n=e.value;p.Pattern.check(n)?s(e,t):p.SpreadElement&&p.SpreadElement.check(n)&&s(e.get("argument"),t)}):p.PropertyPattern&&p.PropertyPattern.check(n)?s(e.get("pattern"),t):(p.SpreadElementPattern&&p.SpreadElementPattern.check(n)||p.SpreadPropertyPattern&&p.SpreadPropertyPattern.check(n))&&s(e.get("argument"),t)}var a=e("assert"),o=e("./types"),u=o.Type,p=o.namedTypes,c=p.Node,d=p.Expression,f=o.builtInTypes.array,h=Object.prototype.hasOwnProperty,m=o.builders,g=[p.Program,p.Function,p.CatchClause],y=u.or.apply(u,g);n.isEstablishedBy=function(e){return y.check(e)};var b=n.prototype;b.didScan=!1,b.declares=function(e){return this.scan(),h.call(this.bindings,e)},b.declareTemporary=function(e){e?a.ok(/^[a-z$_]/i.test(e),e):e="t$",e+=this.depth.toString(36)+"$",this.scan();for(var t=0;this.declares(e+t);)++t;var n=e+t;return this.bindings[n]=o.builders.identifier(n)},b.injectTemporary=function(e,t){e||(e=this.declareTemporary());var n=this.path.get("body");return p.BlockStatement.check(n.value)&&(n=n.get("body")),n.unshift(m.variableDeclaration("var",[m.variableDeclarator(e,t||null)])),e},b.scan=function(e){if(e||!this.didScan){for(var t in this.bindings)delete this.bindings[t];r(this.path,this.bindings),this.didScan=!0}},b.getBindings=function(){return this.scan(),this.bindings},b.lookup=function(e){for(var t=this;t&&!t.declares(e);t=t.parent);return t},b.getGlobalScope=function(){for(var e=this;!e.isGlobal;)e=e.parent;return e},t.exports=n},{"./node-path":165,"./types":170,assert:173}],169:[function(e,t,n){var r=e("../lib/types"),l=r.Type,i=r.builtInTypes,s=i.number;n.geq=function(e){return new l(function(t){return s.check(t)&&t>=e},s+" >= "+e)},n.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return!1},"true":function(){return!0},undefined:function(){}};var a=l.or(i.string,i.number,i.boolean,i.null,i.undefined);n.isPrimitive=new l(function(e){if(null===e)return!0;var t=typeof e;return!("object"===t||"function"===t)},a.toString())},{"../lib/types":170}],170:[function(e,t,n){function r(e,t){var n=this;h.ok(n instanceof r,n),h.strictEqual(v.call(e),x,e+" is not a function");var l=v.call(t);h.ok(l===x||l===E,t+" is neither a function nor a string"),Object.defineProperties(n,{name:{value:t},check:{value:function(t,r){var l=e.call(n,t,r);return!l&&r&&v.call(r)===x&&r(n,t),l}}})}function l(e){return C.check(e)?"{"+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+"}":A.check(e)?"["+e.map(l).join(", ")+"]":JSON.stringify(e)}function i(e,t){var n=v.call(e);return Object.defineProperty(I,t,{enumerable:!0,value:new r(function(e){return v.call(e)===n},t)}),I[t]}function s(e,t){return e instanceof r?e:e instanceof o?e.type:A.check(e)?r.fromArray(e):C.check(e)?r.fromObject(e):k.check(e)?new r(e,t):new r(function(t){return t===e},j.check(t)?function(){return e+""}:t)}function a(e,t,n,r){var l=this;h.ok(l instanceof a),w.assert(e),t=s(t);var i={name:{value:e},type:{value:t},hidden:{value:!!r}};k.check(n)&&(i.defaultFn={value:n}),Object.defineProperties(l,i)}function o(e){var t=this;h.ok(t instanceof o),Object.defineProperties(t,{typeName:{value:e},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new r(function(e,n){return t.check(e,n)},e)}})}function u(e){return e.replace(/^[A-Z]+/,function(e){var t=e.length;switch(t){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,t-1).toLowerCase()+e.charAt(t-1)}})}function p(e){var t=o.fromValue(e);return t?t.fieldNames.slice(0):("type"in e&&h.ok(!1,"did not recognize object of type "+JSON.stringify(e.type)),Object.keys(e))}function c(e,t){var n=o.fromValue(e);if(n){var r=n.allFields[t];if(r)return r.getValue(e)}return e[t]}function d(e,t){t.length=0,t.push(e);for(var n=Object.create(null),r=0;r<t.length;++r){e=t[r];var l=P[e];h.strictEqual(l.finalized,!0),_.call(n,e)&&delete t[n[e]],n[e]=r,t.push.apply(t,l.baseNames)}for(var i=0,s=i,a=t.length;a>s;++s)_.call(t,s)&&(t[i++]=t[s]);t.length=i}function f(e,t){return Object.keys(t).forEach(function(n){e[n]=t[n]}),e}var h=e("assert"),m=Array.prototype,g=m.slice,y=(m.map,m.forEach),b=Object.prototype,v=b.toString,x=v.call(function(){}),E=v.call(""),_=b.hasOwnProperty,S=r.prototype;n.Type=r,S.assert=function(e,t){if(!this.check(e,t)){var n=l(e);return h.ok(!1,n+" does not match type "+this),!1}return!0},S.toString=function(){var e=this.name;return w.check(e)?e:k.check(e)?e.call(this)+"":e+" type"};var I={};n.builtInTypes=I;var w=i("","string"),k=i(function(){},"function"),A=i([],"array"),C=i({},"object"),T=(i(/./,"RegExp"),i(new Date,"Date"),i(3,"number")),j=(i(!0,"boolean"),i(null,"null"),i(void 0,"undefined"));r.or=function(){for(var e=[],t=arguments.length,n=0;t>n;++n)e.push(s(arguments[n]));return new r(function(n,r){for(var l=0;t>l;++l)if(e[l].check(n,r))return!0;return!1},function(){return e.join(" | ")})},r.fromArray=function(e){return h.ok(A.check(e)),h.strictEqual(e.length,1,"only one element type is permitted for typed arrays"),s(e[0]).arrayOf()},S.arrayOf=function(){var e=this;return new r(function(t,n){return A.check(t)&&t.every(function(t){return e.check(t,n)})},function(){return"["+e+"]"})},r.fromObject=function(e){var t=Object.keys(e).map(function(t){return new a(t,e[t])});return new r(function(e,n){return C.check(e)&&t.every(function(t){return t.type.check(e[t.name],n)})},function(){return"{ "+t.join(", ")+" }"})};var M=a.prototype;M.toString=function(){return JSON.stringify(this.name)+": "+this.type},M.getValue=function(e){var t=e[this.name];return j.check(t)?(this.defaultFn&&(t=this.defaultFn.call(e)),t):t},r.def=function(e){return w.assert(e),_.call(P,e)?P[e]:P[e]=new o(e)};var P=Object.create(null);o.fromValue=function(e){if(e&&"object"==typeof e){var t=e.type;if("string"==typeof t&&_.call(P,t)){var n=P[t];if(n.finalized)return n}}return null};var L=o.prototype;L.isSupertypeOf=function(e){return e instanceof o?(h.strictEqual(this.finalized,!0),h.strictEqual(e.finalized,!0),_.call(e.allSupertypes,this.typeName)):void h.ok(!1,e+" is not a Def")},n.getSupertypeNames=function(e){h.ok(_.call(P,e));var t=P[e];return h.strictEqual(t.finalized,!0),t.supertypeList.slice(1)},n.computeSupertypeLookupTable=function(e){for(var t={},n=Object.keys(P),r=n.length,l=0;r>l;++l){var i=n[l],s=P[i];h.strictEqual(s.finalized,!0);for(var a=0;a<s.supertypeList.length;++a){var o=s.supertypeList[a];if(_.call(e,o)){t[i]=o;break}}}return t},L.checkAllFields=function(e,t){function n(n){var l=r[n],i=l.type,s=l.getValue(e);return i.check(s,t)}var r=this.allFields;return h.strictEqual(this.finalized,!0),C.check(e)&&Object.keys(r).every(n)},L.check=function(e,t){if(h.strictEqual(this.finalized,!0,"prematurely checking unfinalized type "+this.typeName),!C.check(e))return!1;var n=o.fromValue(e);return n?t&&n===this?this.checkAllFields(e,t):this.isSupertypeOf(n)?t?n.checkAllFields(e,t)&&this.checkAllFields(e,!1):!0:!1:"SourceLocation"===this.typeName||"Position"===this.typeName?this.checkAllFields(e,t):!1},L.bases=function(){var e=this.baseNames;return h.strictEqual(this.finalized,!1),y.call(arguments,function(t){w.assert(t),e.indexOf(t)<0&&e.push(t)}),this},Object.defineProperty(L,"buildable",{value:!1});var O={};n.builders=O;var D={};n.defineMethod=function(e,t){var n=D[e];return j.check(t)?delete D[e]:(k.assert(t),Object.defineProperty(D,e,{enumerable:!0,configurable:!0,value:t})),n},L.build=function(){var e=this;return Object.defineProperty(e,"buildParams",{value:g.call(arguments),writable:!1,enumerable:!1,configurable:!0}),h.strictEqual(e.finalized,!1),w.arrayOf().assert(e.buildParams),e.buildable?e:(e.field("type",e.typeName,function(){return e.typeName}),Object.defineProperty(e,"buildable",{value:!0}),Object.defineProperty(O,u(e.typeName),{enumerable:!0,value:function(){function t(t,s){if(!_.call(i,t)){var a=e.allFields;h.ok(_.call(a,t),t);var o,u=a[t],p=u.type;if(T.check(s)&&r>s)o=n[s];else if(u.defaultFn)o=u.defaultFn.call(i);else{var c="no value or default function given for field "+JSON.stringify(t)+" of "+e.typeName+"("+e.buildParams.map(function(e){return a[e]}).join(", ")+")";h.ok(!1,c)}p.check(o)||h.ok(!1,l(o)+" does not match field "+u+" of type "+e.typeName),i[t]=o}}var n=arguments,r=n.length,i=Object.create(D);return h.ok(e.finalized,"attempting to instantiate unfinalized type "+e.typeName),e.buildParams.forEach(function(e,n){t(e,n)}),Object.keys(e.allFields).forEach(function(e){t(e)}),h.strictEqual(i.type,e.typeName),i}}),e)},L.field=function(e,t,n,r){return h.strictEqual(this.finalized,!1),this.ownFields[e]=new a(e,t,n,r),this};var R={};n.namedTypes=R,n.getFieldNames=p,n.getFieldValue=c,n.eachField=function(e,t,n){p(e).forEach(function(n){t.call(this,n,c(e,n))},n)},n.someField=function(e,t,n){return p(e).some(function(n){return t.call(this,n,c(e,n))},n)},Object.defineProperty(L,"finalized",{value:!1}),L.finalize=function(){if(!this.finalized){var e=this.allFields,t=this.allSupertypes;this.baseNames.forEach(function(n){var r=P[n];r.finalize(),f(e,r.allFields),f(t,r.allSupertypes)}),f(e,this.ownFields),t[this.typeName]=this,this.fieldNames.length=0;for(var n in e)_.call(e,n)&&!e[n].hidden&&this.fieldNames.push(n);Object.defineProperty(R,this.typeName,{enumerable:!0,value:this.type}),Object.defineProperty(this,"finalized",{value:!0}),d(this.typeName,this.supertypeList)}},n.finalize=function(){Object.keys(P).forEach(function(e){P[e].finalize()})}},{assert:173}],171:[function(e,t,n){var r=e("./lib/types");e("./def/core"),e("./def/es6"),e("./def/es7"),e("./def/mozilla"),e("./def/e4x"),e("./def/fb-harmony"),r.finalize(),n.Type=r.Type,n.builtInTypes=r.builtInTypes,n.namedTypes=r.namedTypes,n.builders=r.builders,n.defineMethod=r.defineMethod,n.getFieldNames=r.getFieldNames,n.getFieldValue=r.getFieldValue,n.eachField=r.eachField,n.someField=r.someField,n.getSupertypeNames=r.getSupertypeNames,n.astNodesAreEquivalent=e("./lib/equiv"),n.finalize=r.finalize,n.NodePath=e("./lib/node-path"),n.PathVisitor=e("./lib/path-visitor"),n.visit=n.PathVisitor.visit},{"./def/core":158,"./def/e4x":159,"./def/es6":160,"./def/es7":161,"./def/fb-harmony":162,"./def/mozilla":163,"./lib/equiv":164,"./lib/node-path":165,"./lib/path-visitor":166,"./lib/types":170}],172:[function(){},{}],173:[function(e,t){function n(e,t){return d.isUndefined(t)?""+t:d.isNumber(t)&&!isFinite(t)?t.toString():d.isFunction(t)||d.isRegExp(t)?t.toString():t}function r(e,t){return d.isString(e)?e.length<t?e:e.slice(0,t):e}function l(e){return r(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+r(JSON.stringify(e.expected,n),128)}function i(e,t,n,r,l){throw new m.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:l})}function s(e,t){e||i(e,!0,t,"==",m.ok)}function a(e,t){if(e===t)return!0;if(d.isBuffer(e)&&d.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return d.isDate(e)&&d.isDate(t)?e.getTime()===t.getTime():d.isRegExp(e)&&d.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:d.isObject(e)||d.isObject(t)?u(e,t):e==t}function o(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function u(e,t){if(d.isNullOrUndefined(e)||d.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(d.isPrimitive(e)||d.isPrimitive(t))return e===t;var n=o(e),r=o(t);if(n&&!r||!n&&r)return!1;if(n)return e=f.call(e),t=f.call(t),a(e,t);var l,i,s=g(e),u=g(t);if(s.length!=u.length)return!1;for(s.sort(),u.sort(),i=s.length-1;i>=0;i--)if(s[i]!=u[i])return!1;for(i=s.length-1;i>=0;i--)if(l=s[i],!a(e[l],t[l]))return!1;return!0}function p(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function c(e,t,n,r){var l;d.isString(n)&&(r=n,n=null);try{t()}catch(s){l=s}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!l&&i(l,n,"Missing expected exception"+r),!e&&p(l,n)&&i(l,n,"Got unwanted exception"+r),e&&l&&n&&!p(l,n)||!e&&l)throw l}var d=e("util/"),f=Array.prototype.slice,h=Object.prototype.hasOwnProperty,m=t.exports=s;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var t=e.stackStartFunction||i;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,s=t.name,a=r.indexOf("\n"+s);if(a>=0){var o=r.indexOf("\n",a+1);r=r.substring(o+1)}this.stack=r}}},d.inherits(m.AssertionError,Error),m.fail=i,m.ok=s,m.equal=function(e,t,n){e!=t&&i(e,t,n,"==",m.equal)},m.notEqual=function(e,t,n){e==t&&i(e,t,n,"!=",m.notEqual)},m.deepEqual=function(e,t,n){a(e,t)||i(e,t,n,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,n){a(e,t)&&i(e,t,n,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,n){e!==t&&i(e,t,n,"===",m.strictEqual)},m.notStrictEqual=function(e,t,n){e===t&&i(e,t,n,"!==",m.notStrictEqual)},m.throws=function(){c.apply(this,[!0].concat(f.call(arguments)))},m.doesNotThrow=function(){c.apply(this,[!1].concat(f.call(arguments)))},m.ifError=function(e){if(e)throw e};var g=Object.keys||function(e){var t=[];for(var n in e)h.call(e,n)&&t.push(n);return t}},{"util/":199}],174:[function(e,t,n){arguments[4][172][0].apply(n,arguments)},{dup:172}],175:[function(e,t,n){function r(e,t,n){if(!(this instanceof r))return new r(e,t,n);var l,i=typeof e;if("number"===i)l=+e;else if("string"===i)l=r.byteLength(e,t);else{if("object"!==i||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&R(e.data)&&(e=e.data),l=+e.length}if(l>N)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N.toString(16)+" bytes");0>l?l=0:l>>>=0;var s=this;r.TYPED_ARRAY_SUPPORT?s=r._augment(new Uint8Array(l)):(s.length=l,s._isBuffer=!0);var a;if(r.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)s._set(e);else if(k(e))if(r.isBuffer(e))for(a=0;l>a;a++)s[a]=e.readUInt8(a);else for(a=0;l>a;a++)s[a]=(e[a]%256+256)%256;else if("string"===i)s.write(e,0,t);else if("number"===i&&!r.TYPED_ARRAY_SUPPORT&&!n)for(a=0;l>a;a++)s[a]=0;return l>0&&l<=r.poolSize&&(s.parent=F),s}function l(e,t,n){if(!(this instanceof l))return new l(e,t,n);var i=new r(e,t,n);return delete i.parent,i}function i(e,t,n,r){n=Number(n)||0;var l=e.length-n;r?(r=Number(r),r>l&&(r=l)):r=l;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;r>s;s++){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");e[n+s]=a}return s}function s(e,t,n,r){var l=P(C(t,e.length-n),e,n,r);return l}function a(e,t,n,r){var l=P(T(t),e,n,r);return l}function o(e,t,n,r){return a(e,t,n,r)}function u(e,t,n,r){var l=P(M(t),e,n,r);return l}function p(e,t,n,r){var l=P(j(t,e.length-n),e,n,r);return l}function c(e,t,n){return O.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function d(e,t,n){var r="",l="";n=Math.min(e.length,n);for(var i=t;n>i;i++)e[i]<=127?(r+=L(l)+String.fromCharCode(e[i]),l=""):l+="%"+e[i].toString(16);return r+L(l)}function f(e,t,n){var r="";n=Math.min(e.length,n);for(var l=t;n>l;l++)r+=String.fromCharCode(127&e[l]);return r}function h(e,t,n){var r="";n=Math.min(e.length,n);for(var l=t;n>l;l++)r+=String.fromCharCode(e[l]);return r}function m(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var l="",i=t;n>i;i++)l+=A(e[i]);return l}function g(e,t,n){for(var r=e.slice(t,n),l="",i=0;i<r.length;i+=2)l+=String.fromCharCode(r[i]+256*r[i+1]);return l}function y(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function b(e,t,n,l,i,s){if(!r.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||s>t)throw new RangeError("value is out of bounds");if(n+l>e.length)throw new RangeError("index out of range")}function v(e,t,n,r){0>t&&(t=65535+t+1);for(var l=0,i=Math.min(e.length-n,2);i>l;l++)e[n+l]=(t&255<<8*(r?l:1-l))>>>8*(r?l:1-l)}function x(e,t,n,r){0>t&&(t=4294967295+t+1);for(var l=0,i=Math.min(e.length-n,4);i>l;l++)e[n+l]=t>>>8*(r?l:3-l)&255}function E(e,t,n,r,l,i){if(t>l||i>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function _(e,t,n,r,l){return l||E(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),D.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,l){return l||E(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),D.write(e,t,n,r,52,8),n+8}function I(e){if(e=w(e).replace($,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function w(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function k(e){return R(e)||r.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function A(e){return 16>e?"0"+e.toString(16):e.toString(16)}function C(e,t){t=t||1/0;for(var n,r=e.length,l=null,i=[],s=0;r>s;s++){if(n=e.charCodeAt(s),n>55295&&57344>n){if(!l){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}l=n;continue}if(56320>n){(t-=3)>-1&&i.push(239,191,189),l=n;continue}n=l-55296<<10|n-56320|65536,l=null}else l&&((t-=3)>-1&&i.push(239,191,189),l=null);if(128>n){if((t-=1)<0)break;i.push(n)}else if(2048>n){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(2097152>n))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function T(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function j(e,t){for(var n,r,l,i=[],s=0;s<e.length&&!((t-=2)<0);s++)n=e.charCodeAt(s),r=n>>8,l=n%256,i.push(l),i.push(r);return i}function M(e){return O.toByteArray(I(e))}function P(e,t,n,r){for(var l=0;r>l&&!(l+n>=t.length||l>=e.length);l++)t[l+n]=e[l];return l}function L(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}var O=e("base64-js"),D=e("ieee754"),R=e("is-array");n.Buffer=r,n.SlowBuffer=l,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var N=1073741823,F={};r.TYPED_ARRAY_SUPPORT=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(n){return!1}}(),r.isBuffer=function(e){return!(null==e||!e._isBuffer)},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,l=t.length,i=0,s=Math.min(n,l);s>i&&e[i]===t[i];i++);return i!==s&&(n=e[i],l=t[i]),l>n?-1:n>l?1:0},r.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}},r.concat=function(e,t){if(!R(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new r(0);if(1===e.length)return e[0];var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var l=new r(t),i=0;for(n=0;n<e.length;n++){var s=e[n];s.copy(l,i),i+=s.length}return l},r.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"ascii":case"binary":case"raw":n=e.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;case"hex":n=e.length>>>1;break;case"utf8":case"utf-8":n=C(e).length;break;case"base64":n=M(e).length;break;default:n=e.length}return n},r.prototype.length=void 0,r.prototype.parent=void 0,r.prototype.toString=function(e,t,n){var r=!1;if(t>>>=0,n=void 0===n||1/0===n?this.length:n>>>0,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return m(this,t,n);case"utf8":case"utf-8":return d(this,t,n);case"ascii":return f(this,t,n);case"binary":return h(this,t,n);case"base64":return c(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}},r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===r.compare(this,e)},r.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},r.prototype.compare=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:r.compare(this,e)},r.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},r.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},r.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var l=r;r=t,t=n,n=l}if(t=Number(t)||0,0>n||0>t||t>this.length)throw new RangeError("attempt to write outside buffer bounds");var c=this.length-t;n?(n=Number(n),n>c&&(n=c)):n=c,r=String(r||"utf8").toLowerCase();var d;switch(r){case"hex":d=i(this,e,t,n);break;case"utf8":case"utf-8":d=s(this,e,t,n);break;case"ascii":d=a(this,e,t,n);break;case"binary":d=o(this,e,t,n);break;case"base64":d=u(this,e,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=p(this,e,t,n);break;default:throw new TypeError("Unknown encoding: "+r)}return d},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var l;if(r.TYPED_ARRAY_SUPPORT)l=r._augment(this.subarray(e,t));else{var i=t-e;l=new r(i,void 0,!0);for(var s=0;i>s;s++)l[s]=this[s+e]}return l.length&&(l.parent=this.parent||this),l},r.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],l=1,i=0;++i<t&&(l*=256);)r+=this[e+i]*l;return r},r.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e+--t],l=1;t>0&&(l*=256);)r+=this[e+--t]*l;return r},r.prototype.readUInt8=function(e,t){return t||y(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||y(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||y(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],l=1,i=0;++i<t&&(l*=256);)r+=this[e+i]*l;return l*=128,r>=l&&(r-=Math.pow(2,8*t)),r},r.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=t,l=1,i=this[e+--r];r>0&&(l*=256);)i+=this[e+--r]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*t)),i},r.prototype.readInt8=function(e,t){return t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||y(e,4,this.length),D.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||y(e,4,this.length),D.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||y(e,8,this.length),D.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||y(e,8,this.length),D.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||b(this,e,t,n,Math.pow(2,8*n),0);var l=1,i=0;for(this[t]=255&e;++i<n&&(l*=256);)this[t+i]=e/l>>>0&255;return t+n},r.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||b(this,e,t,n,Math.pow(2,8*n),0);var l=n-1,i=1;for(this[t+l]=255&e;--l>=0&&(i*=256);)this[t+l]=e/i>>>0&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):v(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):v(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e):x(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):x(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,r){e=+e,t>>>=0,r||b(this,e,t,n,Math.pow(2,8*n-1)-1,-Math.pow(2,8*n-1));var l=0,i=1,s=0>e?1:0;for(this[t]=255&e;++l<n&&(i*=256);)this[t+l]=(e/i>>0)-s&255;return t+n},r.prototype.writeIntBE=function(e,t,n,r){e=+e,t>>>=0,r||b(this,e,t,n,Math.pow(2,8*n-1)-1,-Math.pow(2,8*n-1));var l=n-1,i=1,s=0>e?1:0;for(this[t+l]=255&e;--l>=0&&(i*=256);)this[t+l]=(e/i>>0)-s&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):v(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):v(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||b(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):x(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return _(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return _(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,l){var i=this;if(n||(n=0),l||0===l||(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&n>l&&(l=n),l===n)return 0;if(0===e.length||0===i.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=i.length)throw new RangeError("sourceStart out of bounds");if(0>l)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-n&&(l=e.length-t+n);var s=l-n;if(1e3>s||!r.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)e[a+t]=this[a+n];else e._set(this.subarray(n,n+s),t);return s},r.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var l=C(e.toString()),i=l.length;for(r=t;n>r;r++)this[r]=l[r%i]}return this}},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r.TYPED_ARRAY_SUPPORT)return new r(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 TypeError("Buffer.toArrayBuffer not supported in this browser")};var B=r.prototype;r._augment=function(e){return e.constructor=r,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=B.get,e.set=B.set,e.write=B.write,e.toString=B.toString,e.toLocaleString=B.toString,e.toJSON=B.toJSON,e.equals=B.equals,e.compare=B.compare,e.copy=B.copy,e.slice=B.slice,e.readUIntLE=B.readUIntLE,e.readUIntBE=B.readUIntBE,e.readUInt8=B.readUInt8,e.readUInt16LE=B.readUInt16LE,e.readUInt16BE=B.readUInt16BE,e.readUInt32LE=B.readUInt32LE,e.readUInt32BE=B.readUInt32BE,e.readIntLE=B.readIntLE,e.readIntBE=B.readIntBE,e.readInt8=B.readInt8,e.readInt16LE=B.readInt16LE,e.readInt16BE=B.readInt16BE,e.readInt32LE=B.readInt32LE,e.readInt32BE=B.readInt32BE,e.readFloatLE=B.readFloatLE,e.readFloatBE=B.readFloatBE,e.readDoubleLE=B.readDoubleLE,e.readDoubleBE=B.readDoubleBE,e.writeUInt8=B.writeUInt8,e.writeUIntLE=B.writeUIntLE,e.writeUIntBE=B.writeUIntBE,e.writeUInt16LE=B.writeUInt16LE,e.writeUInt16BE=B.writeUInt16BE,e.writeUInt32LE=B.writeUInt32LE,e.writeUInt32BE=B.writeUInt32BE,e.writeIntLE=B.writeIntLE,e.writeIntBE=B.writeIntBE,e.writeInt8=B.writeInt8,e.writeInt16LE=B.writeInt16LE,e.writeInt16BE=B.writeInt16BE,e.writeInt32LE=B.writeInt32LE,e.writeInt32BE=B.writeInt32BE,e.writeFloatLE=B.writeFloatLE,e.writeFloatBE=B.writeFloatBE,e.writeDoubleLE=B.writeDoubleLE,e.writeDoubleBE=B.writeDoubleBE,e.fill=B.fill,e.inspect=B.inspect,e.toArrayBuffer=B.toArrayBuffer,e};var $=/[^+\/0-9A-z\-]/g},{"base64-js":176,ieee754:177,"is-array":178}],176:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===s||t===c?62:t===a||t===d?63:o>t?-1:o+10>t?t-o+26+26:p+26>t?t-p:u+26>t?t-u+26:void 0}function n(e){function n(e){u[c++]=e}var r,l,s,a,o,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=e.length;o="="===e.charAt(p-2)?2:"="===e.charAt(p-1)?1:0,u=new i(3*e.length/4-o),s=o>0?e.length-4:e.length;var c=0;for(r=0,l=0;s>r;r+=4,l+=3)a=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===o?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===o&&(a=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(a>>8&255),n(255&a)),u}function l(e){function t(e){return r.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var l,i,s,a=e.length%3,o="";for(l=0,s=e.length-a;s>l;l+=3)i=(e[l]<<16)+(e[l+1]<<8)+e[l+2],o+=n(i);switch(a){case 1:i=e[e.length-1],o+=t(i>>2),o+=t(i<<4&63),o+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],o+=t(i>>10),o+=t(i>>4&63),o+=t(i<<2&63),o+="="}return o}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),o="0".charCodeAt(0),u="a".charCodeAt(0),p="A".charCodeAt(0),c="-".charCodeAt(0),d="_".charCodeAt(0); e.toByteArray=n,e.fromByteArray=l}("undefined"==typeof n?this.base64js={}:n)},{}],177:[function(e,t,n){n.read=function(e,t,n,r,l){var i,s,a=8*l-r-1,o=(1<<a)-1,u=o>>1,p=-7,c=n?l-1:0,d=n?-1:1,f=e[t+c];for(c+=d,i=f&(1<<-p)-1,f>>=-p,p+=a;p>0;i=256*i+e[t+c],c+=d,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=r;p>0;s=256*s+e[t+c],c+=d,p-=8);if(0===i)i=1-u;else{if(i===o)return s?0/0:1/0*(f?-1:1);s+=Math.pow(2,r),i-=u}return(f?-1:1)*s*Math.pow(2,i-r)},n.write=function(e,t,n,r,l,i){var s,a,o,u=8*i-l-1,p=(1<<u)-1,c=p>>1,d=23===l?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,h=r?1:-1,m=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=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-s))<1&&(s--,o*=2),t+=s+c>=1?d/o:d*Math.pow(2,1-c),t*o>=2&&(s++,o/=2),s+c>=p?(a=0,s=p):s+c>=1?(a=(t*o-1)*Math.pow(2,l),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,l),s=0));l>=8;e[n+f]=255&a,f+=h,a/=256,l-=8);for(s=s<<l|a,u+=l;u>0;e[n+f]=255&s,f+=h,s/=256,u-=8);e[n+f-h]|=128*m}},{}],178:[function(e,t){var n=Array.isArray,r=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==r.call(e)}},{}],179:[function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function l(e){return"number"==typeof e}function i(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(!l(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,l,a,o,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(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(r(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(l=arguments.length,a=new Array(l-1),o=1;l>o;o++)a[o-1]=arguments[o];n.apply(this,a)}else if(i(n)){for(l=arguments.length,a=new Array(l-1),o=1;l>o;o++)a[o-1]=arguments[o];for(u=n.slice(),l=u.length,o=0;l>o;o++)u[o].apply(this,a)}return!0},n.prototype.addListener=function(e,t){var l;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var l;l=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,l&&l>0&&this._events[e].length>l&&(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),l||(l=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var l=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,l,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,l=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(a=s;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){l=a;break}if(0>l)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(l,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],r(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]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},{}],180:[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}},{}],181:[function(e,t){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],182:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var l=e[r];"."===l?e.splice(r,1):".."===l?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return l.exec(e).slice(1)};n.resolve=function(){for(var n="",l=!1,i=arguments.length-1;i>=-1&&!l;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,l="/"===s.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!l).join("/"),(l?"/":"")+n||"."},n.normalize=function(e){var l=n.isAbsolute(e),i="/"===s(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!l).join("/"),e||l||(e="."),e&&i&&(e+="/"),(l?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var l=r(e.split("/")),i=r(t.split("/")),s=Math.min(l.length,i.length),a=s,o=0;s>o;o++)if(l[o]!==i[o]){a=o;break}for(var u=[],o=a;o<l.length;o++)u.push("..");return u=u.concat(i.slice(a)),u.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(this,e("_process"))},{_process:183}],183:[function(e,t){function n(){if(!s){s=!0;for(var e,t=i.length;t;){e=i,i=[];for(var n=-1;++n<t;)e[n]();t=i.length}s=!1}}function r(){}var l=t.exports={},i=[],s=!1;l.nextTick=function(e){i.push(e),s||setTimeout(n,0)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=r,l.addListener=r,l.once=r,l.off=r,l.removeListener=r,l.removeAllListeners=r,l.emit=r,l.binding=function(){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],184:[function(e,t){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":185}],185:[function(e,t){(function(n){function r(e){return this instanceof r?(o.call(this,e),u.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",l)):new r(e)}function l(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}function i(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}t.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=e("core-util-is");a.inherits=e("inherits");var o=e("./_stream_readable"),u=e("./_stream_writable");a.inherits(r,o),i(s(u.prototype),function(e){r.prototype[e]||(r.prototype[e]=u.prototype[e])})}).call(this,e("_process"))},{"./_stream_readable":187,"./_stream_writable":189,_process:183,"core-util-is":190,inherits:180}],186:[function(e,t){function n(e){return this instanceof n?void r.call(this,e):new n(e)}t.exports=n;var r=e("./_stream_transform"),l=e("core-util-is");l.inherits=e("inherits"),l.inherits(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":188,"core-util-is":190,inherits:180}],187:[function(e,t){(function(n){function r(t,n){var r=e("./_stream_duplex");t=t||{};var l=t.highWaterMark,i=t.objectMode?16:16384;this.highWaterMark=l||0===l?l:i,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(C||(C=e("string_decoder/").StringDecoder),this.decoder=new C(t.encoding),this.encoding=t.encoding)}function l(t){e("./_stream_duplex");return this instanceof l?(this._readableState=new r(t,this),this.readable=!0,void k.call(this)):new l(t)}function i(e,t,n,r,l){var i=u(t,n);if(i)e.emit("error",i);else if(A.isNullOrUndefined(n))t.reading=!1,t.ended||p(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!l){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&l){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||l||r||(n=t.decoder.write(n)),l||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,l?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&c(e)),f(e,t);else l||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=j)e=j;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function o(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||A.isNull(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 u(e,t){var n=null;return A.isBuffer(t)||A.isString(t)||A.isNullOrUndefined(t)||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(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,c(e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(T("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(function(){d(e)}):d(e))}function d(e){T("emit readable"),e.emit("readable"),b(e)}function f(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){h(e,t)}))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(T("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function m(e){return function(){var t=e._readableState;T("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&w.listenerCount(e,"data")&&(t.flowing=!0,b(e))}}function g(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(function(){y(e,t)}))}function y(e,t){t.resumeScheduled=!1,e.emit("resume"),b(e),t.flowing&&!t.reading&&e.read(0)}function b(e){var t=e._readableState;if(T("flow",t.flowing),t.flowing)do var n=e.read();while(null!==n&&t.flowing)}function v(e,t){var n,r=t.buffer,l=t.length,i=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===l)n=null;else if(s)n=r.shift();else if(!e||e>=l)n=i?r.join(""):I.concat(r,l),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new I(e);for(var o=0,u=0,p=r.length;p>u&&e>o;u++){var a=r[0],c=Math.min(e-o,a.length);i?n+=a.slice(0,c):a.copy(n,o,0,c),c<a.length?r[0]=a.slice(c):r.shift(),o+=c}}return n}function x(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function E(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function _(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=l;var S=e("isarray"),I=e("buffer").Buffer;l.ReadableState=r;var w=e("events").EventEmitter;w.listenerCount||(w.listenerCount=function(e,t){return e.listeners(t).length});var k=e("stream"),A=e("core-util-is");A.inherits=e("inherits");var C,T=e("util");T=T&&T.debuglog?T.debuglog("stream"):function(){},A.inherits(l,k),l.prototype.push=function(e,t){var n=this._readableState;return A.isString(e)&&!n.objectMode&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=new I(e,t),t="")),i(this,n,e,t,!1)},l.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},l.prototype.setEncoding=function(t){return C||(C=e("string_decoder/").StringDecoder),this._readableState.decoder=new C(t),this._readableState.encoding=t,this};var j=8388608;l.prototype.read=function(e){T("read",e);var t=this._readableState,n=e;if((!A.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return T("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?x(this):c(this),null;if(e=o(e,t),0===e&&t.ended)return 0===t.length&&x(this),null;var r=t.needReadable;T("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,T("length less than watermark",r)),(t.ended||t.reading)&&(r=!1,T("reading or ended",r)),r&&(T("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=o(n,t));var l;return l=e>0?v(e,t):null,A.isNull(l)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&x(this),A.isNull(l)||this.emit("data",l),l},l.prototype._read=function(){this.emit("error",new Error("not implemented"))},l.prototype.pipe=function(e,t){function r(e){T("onunpipe"),e===c&&i()}function l(){T("onend"),e.end()}function i(){T("cleanup"),e.removeListener("close",o),e.removeListener("finish",u),e.removeListener("drain",g),e.removeListener("error",a),e.removeListener("unpipe",r),c.removeListener("end",l),c.removeListener("end",i),c.removeListener("data",s),!d.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function s(t){T("ondata");var n=e.write(t);!1===n&&(T("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++,c.pause())}function a(t){T("onerror",t),p(),e.removeListener("error",a),0===w.listenerCount(e,"error")&&e.emit("error",t)}function o(){e.removeListener("finish",u),p()}function u(){T("onfinish"),e.removeListener("close",o),p()}function p(){T("unpipe"),c.unpipe(e)}var c=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,T("pipe count=%d opts=%j",d.pipesCount,t);var f=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=f?l:i;d.endEmitted?n.nextTick(h):c.once("end",h),e.on("unpipe",r);var g=m(c);return e.on("drain",g),c.on("data",s),e._events&&e._events.error?S(e._events.error)?e._events.error.unshift(a):e._events.error=[a,e._events.error]:e.on("error",a),e.once("close",o),e.once("finish",u),e.emit("pipe",c),d.flowing||(T("pipe resume"),c.resume()),e},l.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,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var l=0;r>l;l++)n[l].emit("unpipe",this);return this}var l=_(t.pipes,e);return-1===l?this:(t.pipes.splice(l,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},l.prototype.on=function(e,t){var r=k.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var l=this._readableState;if(!l.readableListening)if(l.readableListening=!0,l.emittedReadable=!1,l.needReadable=!0,l.reading)l.length&&c(this,l);else{var i=this;n.nextTick(function(){T("readable nexttick read 0"),i.read(0)})}}return r},l.prototype.addListener=l.prototype.on,l.prototype.resume=function(){var e=this._readableState;return e.flowing||(T("resume"),e.flowing=!0,e.reading||(T("resume read 0"),this.read(0)),g(this,e)),this},l.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this},l.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(T("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(l){if(T("wrapped data"),t.decoder&&(l=t.decoder.write(l)),l&&(t.objectMode||l.length)){var i=r.push(l);i||(n=!0,e.pause())}});for(var l in e)A.isFunction(e[l])&&A.isUndefined(this[l])&&(this[l]=function(t){return function(){return e[t].apply(e,arguments)}}(l));var i=["error","close","destroy","pause","resume"];return E(i,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){T("wrapped _read",t),n&&(n=!1,e.resume())},r},l._fromList=v}).call(this,e("_process"))},{"./_stream_duplex":185,_process:183,buffer:175,"core-util-is":190,events:179,inherits:180,isarray:181,stream:195,"string_decoder/":196,util:174}],188:[function(e,t){function n(e,t){this.afterTransform=function(e,n){return r(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function r(e,t,n){var r=e._transformState;r.transforming=!1;var l=r.writecb;if(!l)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,a.isNullOrUndefined(n)||e.push(n),l&&l(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);s.call(this,e),this._transformState=new n(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){a.isFunction(this._flush)?this._flush(function(e){i(t,e)}):i(t)})}function i(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=l;var s=e("./_stream_duplex"),a=e("core-util-is");a.inherits=e("inherits"),a.inherits(l,s),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},l.prototype._transform=function(){throw new Error("not implemented")},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var l=this._readableState;(r.needTransform||l.needReadable||l.length<l.highWaterMark)&&this._read(l.highWaterMark)}},l.prototype._read=function(){var e=this._transformState;a.isNull(e.writechunk)||!e.writecb||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))}},{"./_stream_duplex":185,"core-util-is":190,inherits:180}],189:[function(e,t){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function l(t,n){var r=e("./_stream_duplex");t=t||{};var l=t.highWaterMark,i=t.objectMode?16:16384;this.highWaterMark=l||0===l?l:i,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){f(n,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function i(t){var n=e("./_stream_duplex");return this instanceof i||this instanceof n?(this._writableState=new l(t,this),this.writable=!0,void S.call(this)):new i(t)}function s(e,t,r){var l=new Error("write after end");e.emit("error",l),n.nextTick(function(){r(l)})}function a(e,t,r,l){var i=!0;if(!(_.isBuffer(r)||_.isString(r)||_.isNullOrUndefined(r)||t.objectMode)){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),n.nextTick(function(){l(s)}),i=!1}return i}function o(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&_.isString(t)&&(t=new E(t,n)),t}function u(e,t,n,l,i){n=o(t,n,l),_.isBuffer(n)&&(l="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked?t.buffer.push(new r(n,l,i)):p(e,t,!1,s,n,l,i),a}function p(e,t,n,r,l,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(l,t.onwrite):e._write(l,i,t.onwrite),t.sync=!1}function c(e,t,r,l,i){r?n.nextTick(function(){t.pendingcb--,i(l)}):(t.pendingcb--,i(l)),e._writableState.errorEmitted=!0,e.emit("error",l)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function f(e,t){var r=e._writableState,l=r.sync,i=r.writecb;if(d(r),t)c(e,r,l,t,i);else{var s=y(e,r);s||r.corked||r.bufferProcessing||!r.buffer.length||g(e,r),l?n.nextTick(function(){h(e,r,s,i)}):h(e,r,s,i)}}function h(e,t,n,r){n||m(e,t),t.pendingcb--,r(),v(e,t)}function m(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function g(e,t){if(t.bufferProcessing=!0,e._writev&&t.buffer.length>1){for(var n=[],r=0;r<t.buffer.length;r++)n.push(t.buffer[r].callback);t.pendingcb++,p(e,t,!0,t.length,t.buffer,"",function(e){for(var r=0;r<n.length;r++)t.pendingcb--,n[r](e)}),t.buffer=[]}else{for(var r=0;r<t.buffer.length;r++){var l=t.buffer[r],i=l.chunk,s=l.encoding,a=l.callback,o=t.objectMode?1:i.length;if(p(e,t,!1,o,i,s,a),t.writing){r++;break}}r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}t.bufferProcessing=!1}function y(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function b(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function v(e,t){var n=y(e,t);return n&&(0===t.pendingcb?(b(e,t),t.finished=!0,e.emit("finish")):b(e,t)),n}function x(e,t,r){t.ending=!0,v(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=i;var E=e("buffer").Buffer;i.WritableState=l;var _=e("core-util-is");_.inherits=e("inherits");var S=e("stream");_.inherits(i,S),i.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},i.prototype.write=function(e,t,n){var r=this._writableState,l=!1;return _.isFunction(t)&&(n=t,t=null),_.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),_.isFunction(n)||(n=function(){}),r.ended?s(this,r,n):a(this,r,e,n)&&(r.pendingcb++,l=u(this,r,e,t,n)),l},i.prototype.cork=function(){var e=this._writableState;e.corked++},i.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||g(this,e))},i.prototype._write=function(e,t,n){n(new Error("not implemented"))},i.prototype._writev=null,i.prototype.end=function(e,t,n){var r=this._writableState;_.isFunction(e)?(n=e,e=null,t=null):_.isFunction(t)&&(n=t,t=null),_.isNullOrUndefined(e)||this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||x(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":185,_process:183,buffer:175,"core-util-is":190,inherits:180,stream:195}],190:[function(e,t,n){(function(e){function t(e){return Array.isArray(e)}function r(e){return"boolean"==typeof e}function l(e){return null===e}function i(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function o(e){return"symbol"==typeof e}function u(e){return void 0===e}function p(e){return c(e)&&"[object RegExp]"===y(e)}function c(e){return"object"==typeof e&&null!==e}function d(e){return c(e)&&"[object Date]"===y(e)}function f(e){return c(e)&&("[object Error]"===y(e)||e instanceof Error)}function h(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function g(t){return e.isBuffer(t)}function y(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=l,n.isNullOrUndefined=i,n.isNumber=s,n.isString=a,n.isSymbol=o,n.isUndefined=u,n.isRegExp=p,n.isObject=c,n.isDate=d,n.isError=f,n.isFunction=h,n.isPrimitive=m,n.isBuffer=g}).call(this,e("buffer").Buffer)},{buffer:175}],191:[function(e,t){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":186}],192:[function(e,t,n){n=t.exports=e("./lib/_stream_readable.js"),n.Stream=e("stream"),n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":185,"./lib/_stream_passthrough.js":186,"./lib/_stream_readable.js":187,"./lib/_stream_transform.js":188,"./lib/_stream_writable.js":189,stream:195}],193:[function(e,t){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":188}],194:[function(e,t){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":189}],195:[function(e,t){function n(){r.call(this)}t.exports=n;var r=e("events").EventEmitter,l=e("inherits");l(n,r),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function l(){u.readable&&u.resume&&u.resume()}function i(){p||(p=!0,e.end())}function s(){p||(p=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(o(),0===r.listenerCount(this,"error"))throw e}function o(){u.removeListener("data",n),e.removeListener("drain",l),u.removeListener("end",i),u.removeListener("close",s),u.removeListener("error",a),e.removeListener("error",a),u.removeListener("end",o),u.removeListener("close",o),e.removeListener("close",o)}var u=this;u.on("data",n),e.on("drain",l),e._isStdio||t&&t.end===!1||(u.on("end",i),u.on("close",s));var p=!1;return u.on("error",a),e.on("error",a),u.on("end",o),u.on("close",o),e.on("close",o),e.emit("pipe",u),e}},{events:179,inherits:180,"readable-stream/duplex.js":184,"readable-stream/passthrough.js":191,"readable-stream/readable.js":192,"readable-stream/transform.js":193,"readable-stream/writable.js":194}],196:[function(e,t,n){function r(e){if(e&&!o(e))throw new Error("Unknown encoding: "+e)}function l(e){return e.toString(this.encoding)}function i(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,o=a.isEncoding||function(e){switch(e&&e.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!0;default:return!1}},u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=l)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&56319>=r)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var l=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,l),l-=this.charReceived),t+=e.toString(this.encoding,0,l);var l=t.length-1,r=t.charCodeAt(l);if(r>=55296&&56319>=r){var i=this.surrogateSize;return this.charLength+=i,this.charReceived+=i,this.charBuffer.copy(this.charBuffer,i,0,i),e.copy(this.charBuffer,0,0,i),t.substring(0,l)}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}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,l=this.encoding;t+=r.slice(0,n).toString(l)}return t}},{buffer:175}],197:[function(e,t,n){function r(){throw new Error("tty.ReadStream is not implemented")}function l(){throw new Error("tty.ReadStream is not implemented")}n.isatty=function(){return!1},n.ReadStream=r,n.WriteStream=l},{}],198:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],199:[function(e,t,n){(function(t,r){function l(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(t)?r.showHidden=t:t&&n._extend(r,t),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),o(r,e,r.depth)}function i(e,t){var n=l.styles[t];return n?"["+l.colors[n][0]+"m"+e+"["+l.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 o(e,t,r){if(e.customInspect&&t&&k(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var l=t.inspect(r,e);return v(l)||(l=o(e,l,r)),l}var i=u(e,t);if(i)return i;var s=Object.keys(t),m=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),w(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(t);if(0===s.length){if(k(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(I(t))return e.stylize(Date.prototype.toString.call(t),"date");if(w(t))return p(t)}var y="",b=!1,x=["{","}"];if(h(t)&&(b=!0,x=["[","]"]),k(t)){var E=t.name?": "+t.name:"";y=" [Function"+E+"]"}if(_(t)&&(y=" "+RegExp.prototype.toString.call(t)),I(t)&&(y=" "+Date.prototype.toUTCString.call(t)),w(t)&&(y=" "+p(t)),0===s.length&&(!b||0==t.length))return x[0]+y+x[1];if(0>r)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var S;return S=b?c(e,t,r,m,s):s.map(function(n){return d(e,t,r,m,n,b)}),e.seen.pop(),f(S,y,x)}function u(e,t){if(E(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 b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0 }function p(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,l){for(var i=[],s=0,a=t.length;a>s;++s)i.push(M(t,String(s))?d(e,t,n,r,String(s),!0):"");return l.forEach(function(l){l.match(/^\d+$/)||i.push(d(e,t,n,r,l,!0))}),i}function d(e,t,n,r,l,i){var s,a,u;if(u=Object.getOwnPropertyDescriptor(t,l)||{value:t[l]},u.get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),M(r,l)||(s="["+l+"]"),a||(e.seen.indexOf(u.value)<0?(a=g(n)?o(e,u.value,null):o(e,u.value,n-1),a.indexOf("\n")>-1&&(a=i?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")),E(s)){if(i&&l.match(/^\d+$/))return a;s=JSON.stringify(""+l),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 f(e,t,n){var r=0,l=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return l>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return null==e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function x(e){return"symbol"==typeof e}function E(e){return void 0===e}function _(e){return S(e)&&"[object RegExp]"===C(e)}function S(e){return"object"==typeof e&&null!==e}function I(e){return S(e)&&"[object Date]"===C(e)}function w(e){return S(e)&&("[object Error]"===C(e)||e instanceof Error)}function k(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function T(e){return 10>e?"0"+e.toString(10):e.toString(10)}function j(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;n.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(l(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(e).replace(P,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];i>n;a=r[++n])s+=g(a)||!S(a)?" "+a:" "+l(a);return s},n.deprecate=function(e,l){function i(){if(!s){if(t.throwDeprecation)throw new Error(l);t.traceDeprecation?console.trace(l):console.error(l),s=!0}return e.apply(this,arguments)}if(E(r.process))return function(){return n.deprecate(e,l).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return i};var L,O={};n.debuglog=function(e){if(E(L)&&(L=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!O[e])if(new RegExp("\\b"+e+"\\b","i").test(L)){var r=t.pid;O[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else O[e]=function(){};return O[e]},n.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=m,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=b,n.isString=v,n.isSymbol=x,n.isUndefined=E,n.isRegExp=_,n.isObject=S,n.isDate=I,n.isError=w,n.isFunction=k,n.isPrimitive=A,n.isBuffer=e("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",j(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":198,_process:183,inherits:180}],200:[function(e,t){(function(n){"use strict";function r(e){this.enabled=e&&void 0!==e.enabled?e.enabled:c}function l(e){var t=function n(){return i.apply(n,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=h,t}function i(){var e=arguments,t=e.length,n=0!==t&&String(arguments[0]);if(t>1)for(var r=1;t>r;r++)n+=" "+e[r];if(!this.enabled||!n)return n;for(var l=this._styles,i=l.length;i--;){var s=o[l[i]];n=s.open+n.replace(s.closeRe,s.open)+s.close}return n}function s(){var e={};return Object.keys(f).forEach(function(t){e[t]={get:function(){return l.call(this,[t])}}}),e}var a=e("escape-string-regexp"),o=e("ansi-styles"),u=e("strip-ansi"),p=e("has-ansi"),c=e("supports-color"),d=Object.defineProperties;"win32"===n.platform&&(o.blue.open="");var f=function(){var e={};return Object.keys(o).forEach(function(t){o[t].closeRe=new RegExp(a(o[t].close),"g"),e[t]={get:function(){return l.call(this,this._styles.concat(t))}}}),e}(),h=d(function(){},f);d(r.prototype,s()),t.exports=new r,t.exports.styles=o,t.exports.hasColor=p,t.exports.stripColor=u,t.exports.supportsColor=c}).call(this,e("_process"))},{_process:183,"ansi-styles":201,"escape-string-regexp":202,"has-ansi":203,"strip-ansi":205,"supports-color":207}],201:[function(e,t){"use strict";var n=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};n.colors.grey=n.colors.gray,Object.keys(n).forEach(function(e){var t=n[e];Object.keys(t).forEach(function(e){var r=t[e];n[e]=t[e]={open:"["+r[0]+"m",close:"["+r[1]+"m"}}),Object.defineProperty(n,e,{value:t,enumerable:!1})})},{}],202:[function(e,t){"use strict";var n=/[|\\{}()[\]^$+*?.]/g;t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(n,"\\$&")}},{}],203:[function(e,t){"use strict";var n=e("ansi-regex"),r=new RegExp(n().source);t.exports=r.test.bind(r)},{"ansi-regex":204}],204:[function(e,t){"use strict";t.exports=function(){return/(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g}},{}],205:[function(e,t){"use strict";var n=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(n,""):e}},{"ansi-regex":206}],206:[function(e,t,n){arguments[4][204][0].apply(n,arguments)},{dup:204}],207:[function(e,t){(function(e){"use strict";var n=e.argv;t.exports=function(){return"FORCE_COLOR"in e.env?!0:-1!==n.indexOf("--no-color")||-1!==n.indexOf("--no-colors")||-1!==n.indexOf("--color=false")?!1:-1!==n.indexOf("--color")||-1!==n.indexOf("--colors")||-1!==n.indexOf("--color=true")||-1!==n.indexOf("--color=always")?!0:e.stdout&&!e.stdout.isTTY?!1:"UPSTART_JOB"in e.env?!1:"win32"===e.platform?!0:"COLORTERM"in e.env?!0:"dumb"===e.env.TERM?!1:/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(e.env.TERM)?!0:!1}()}).call(this,e("_process"))},{_process:183}],208:[function(e,t,n){(function(t){"use strict";function r(e){return new t(e,"base64").toString()}function l(e){return e.split(",").pop()}function i(e,t){var n=p.exec(e);p.lastIndex=0;var r=n[1]||n[2],l=o.join(t,r);try{return a.readFileSync(l,"utf8")}catch(i){throw new Error("An error occurred while trying to read the map file at "+l+"\n"+i)}}function s(e,t){t=t||{};try{t.isFileComment&&(e=i(e,t.commentFileDir)),t.hasComment&&(e=l(e)),t.isEncoded&&(e=r(e)),(t.isJSON||t.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}catch(n){return console.error(n),null}}var a=e("fs"),o=e("path"),u=/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset:\S+;)?base64,(.*)$/gm,p=/(?:\/\/[@#][ \t]+sourceMappingURL=(.+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm;s.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},s.prototype.toBase64=function(){var e=this.toJSON();return new t(e).toString("base64")},s.prototype.toComment=function(){var e=this.toBase64();return"//# sourceMappingURL=data:application/json;base64,"+e},s.prototype.toObject=function(){return JSON.parse(this.toJSON())},s.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,t)},s.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},s.prototype.getProperty=function(e){return this.sourcemap[e]},n.fromObject=function(e){return new s(e)},n.fromJSON=function(e){return new s(e,{isJSON:!0})},n.fromBase64=function(e){return new s(e,{isEncoded:!0})},n.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new s(e,{isEncoded:!0,hasComment:!0})},n.fromMapFileComment=function(e,t){return new s(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},n.fromSource=function(e){var t=e.match(u);return u.lastIndex=0,t?n.fromComment(t.pop()):null},n.fromMapFileSource=function(e,t){var r=e.match(p);return p.lastIndex=0,r?n.fromMapFileComment(r.pop(),t):null},n.removeComments=function(e){return u.lastIndex=0,e.replace(u,"")},n.removeMapFileComments=function(e){return p.lastIndex=0,e.replace(p,"")},n.__defineGetter__("commentRegex",function(){return u.lastIndex=0,u}),n.__defineGetter__("mapFileCommentRegex",function(){return p.lastIndex=0,p})}).call(this,e("buffer").Buffer)},{buffer:175,fs:172,path:182}],209:[function(e,t){e("./shim"),e("./modules/core.dict"),e("./modules/core.iter-helpers"),e("./modules/core.$for"),e("./modules/core.delay"),e("./modules/core.binding"),e("./modules/core.object"),e("./modules/core.array.turn"),e("./modules/core.number.iterator"),e("./modules/core.number.math"),e("./modules/core.string.escape-html"),e("./modules/core.date"),e("./modules/core.global"),e("./modules/core.log"),t.exports=e("./modules/$").core},{"./modules/$":223,"./modules/core.$for":235,"./modules/core.array.turn":236,"./modules/core.binding":237,"./modules/core.date":238,"./modules/core.delay":239,"./modules/core.dict":240,"./modules/core.global":241,"./modules/core.iter-helpers":242,"./modules/core.log":243,"./modules/core.number.iterator":244,"./modules/core.number.math":245,"./modules/core.object":246,"./modules/core.string.escape-html":247,"./shim":291}],210:[function(e,t){"use strict";var n=e("./$");t.exports=function(e){return function(t){var r,l=n.toObject(this),i=n.toLength(l.length),s=n.toIndex(arguments[1],i);if(e&&t!=t){for(;i>s;)if(r=l[s++],r!=r)return!0}else for(;i>s;s++)if((e||s in l)&&l[s]===t)return e||s;return!e&&-1}}},{"./$":223}],211:[function(e,t){"use strict";var n=e("./$"),r=e("./$.ctx");t.exports=function(e){var t=1==e,l=2==e,i=3==e,s=4==e,a=6==e,o=5==e||a;return function(u){for(var p,c,d=Object(n.assertDefined(this)),f=n.ES5Object(d),h=r(u,arguments[1],3),m=n.toLength(f.length),g=0,y=t?Array(m):l?[]:void 0;m>g;g++)if((o||g in f)&&(p=f[g],c=h(p,g,d),e))if(t)y[g]=c;else if(c)switch(e){case 3:return!0;case 5:return p;case 6:return g;case 2:y.push(p)}else if(s)return!1;return a?-1:i||s?s:y}}},{"./$":223,"./$.ctx":218}],212:[function(e,t){function n(e,t,n){if(!e)throw TypeError(n?t+n:t)}var r=e("./$");n.def=r.assertDefined,n.fn=function(e){if(!r.isFunction(e))throw TypeError(e+" is not a function!");return e},n.obj=function(e){if(!r.isObject(e))throw TypeError(e+" is not an object!");return e},n.inst=function(e,t,n){if(!(e instanceof t))throw TypeError(n+": use the 'new' operator!");return e},t.exports=n},{"./$":223}],213:[function(e,t){var n=e("./$");t.exports=Object.assign||function(e){for(var t=Object(n.assertDefined(e)),r=arguments.length,l=1;r>l;)for(var i,s=n.ES5Object(arguments[l++]),a=n.getKeys(s),o=a.length,u=0;o>u;)t[i=a[u++]]=s[i];return t}},{"./$":223}],214:[function(e,t){function n(e){return i.call(e).slice(8,-1)}var r=e("./$"),l=e("./$.wks")("toStringTag"),i={}.toString;n.classof=function(e){var t,r;return void 0==e?void 0===e?"Undefined":"Null":"string"==typeof(r=(t=Object(e))[l])?r:n(t)},n.set=function(e,t,n){e&&!r.has(e=n?e:e.prototype,l)&&r.hide(e,l,t)},t.exports=n},{"./$":223,"./$.wks":234}],215:[function(e,t){"use strict";function n(e,t){if(!c(e))return("string"==typeof e?"S":"P")+e;if(h(e))return"F";if(!u(e,m)){if(!t)return"E";d(e,m,++E)}return"O"+e[m]}function r(e,t){var r,l=n(t);if("F"!=l)return e[g][l];for(r=e[b];r;r=r.n)if(r.k==t)return r}var l=e("./$"),i=e("./$.ctx"),s=e("./$.uid").safe,a=e("./$.assert"),o=e("./$.iter"),u=l.has,p=l.set,c=l.isObject,d=l.hide,f=o.step,h=Object.isFrozen||l.core.Object.isFrozen,m=s("id"),g=s("O1"),y=s("last"),b=s("first"),v=s("iter"),x=l.DESC?s("size"):"size",E=0;t.exports={getConstructor:function(e,t,n){function s(r){var i=a.inst(this,s,e);p(i,g,l.create(null)),p(i,x,0),p(i,y,void 0),p(i,b,void 0),void 0!=r&&o.forOf(r,t,i[n],i)}return l.mix(s.prototype,{clear:function(){for(var e=this,t=e[g],n=e[b];n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e[b]=e[y]=void 0,e[x]=0},"delete":function(e){var t=this,n=r(t,e);if(n){var l=n.n,i=n.p;delete t[g][n.i],n.r=!0,i&&(i.n=l),l&&(l.p=i),t[b]==n&&(t[b]=l),t[y]==n&&(t[y]=i),t[x]--}return!!n},forEach:function(e){for(var t,n=i(e,arguments[1],3);t=t?t.n:this[b];)for(n(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!r(this,e)}}),l.DESC&&l.setDesc(s.prototype,"size",{get:function(){return a.def(this[x])}}),s},def:function(e,t,l){var i,s,a=r(e,t);return a?a.v=l:(e[y]=a={i:s=n(t,!0),k:t,v:l,p:i=e[y],n:void 0,r:!1},e[b]||(e[b]=a),i&&(i.n=a),e[x]++,"F"!=s&&(e[g][s]=a)),e},getEntry:r,getIterConstructor:function(){return function(e,t){p(this,v,{o:e,k:t})}},next:function(){for(var e=this[v],t=e.k,n=e.l;n&&n.r;)n=n.p;return e.o&&(e.l=n=n?n.n:e.o[b])?"key"==t?f(0,n.k):"value"==t?f(0,n.v):f(0,[n.k,n.v]):(e.o=void 0,f(1))}}},{"./$":223,"./$.assert":212,"./$.ctx":218,"./$.iter":222,"./$.uid":232}],216:[function(e,t){"use strict";function n(e,t){return y.call(e.array,function(e){return e[0]===t})}function r(e){return e[m]||p(e,m,{array:[],get:function(e){var t=n(this,e);return t?t[1]:void 0},has:function(e){return!!n(this,e)},set:function(e,t){var r=n(this,e);r?r[1]=t:this.array.push([e,t])},"delete":function(e){var t=b.call(this.array,function(t){return t[0]===e});return~t&&this.array.splice(t,1),!!~t}})[m]}var l=e("./$"),i=e("./$.uid").safe,s=e("./$.assert"),a=e("./$.iter").forOf,o=l.has,u=l.isObject,p=l.hide,c=Object.isFrozen||l.core.Object.isFrozen,d=0,f=i("id"),h=i("weak"),m=i("leak"),g=e("./$.array-methods"),y=g(5),b=g(6);t.exports={getConstructor:function(e,t,n){function i(r){l.set(s.inst(this,i,e),f,d++),void 0!=r&&a(r,t,this[n],this)}return l.mix(i.prototype,{"delete":function(e){return u(e)?c(e)?r(this)["delete"](e):o(e,h)&&o(e[h],this[f])&&delete e[h][this[f]]:!1},has:function(e){return u(e)?c(e)?r(this).has(e):o(e,h)&&o(e[h],this[f]):!1}}),i},def:function(e,t,n){return c(s.obj(t))?r(e).set(t,n):(o(t,h)||p(t,h,{}),t[h][e[f]]=n),e},leakStore:r,WEAK:h,ID:f}},{"./$":223,"./$.array-methods":211,"./$.assert":212,"./$.iter":222,"./$.uid":232}],217:[function(e,t){"use strict";var n=e("./$"),r=e("./$.def"),l=e("./$.iter"),i=e("./$.assert").inst;t.exports=function(t,s,a,o,u){function p(e,t){var r=h[e];n.FW&&(h[e]=function(e,n){var l=r.call(this,0===e?0:e,n);return t?this:l})}var c=n.g[t],d=c,f=o?"set":"add",h=d&&d.prototype,m={};if(n.isFunction(d)&&(u||!l.BUGGY&&h.forEach&&h.entries)){var g,y=new d,b=y[f](u?{}:-0,1);(l.fail(function(e){new d(e)})||l.DANGER_CLOSING)&&(d=function(e){i(this,d,t);var n=new c;return void 0!=e&&l.forOf(e,o,n[f],n),n},d.prototype=h,n.FW&&(h.constructor=d)),u||y.forEach(function(e,t){g=1/t===-1/0}),g&&(p("delete"),p("has"),o&&p("get")),(g||b!==y)&&p(f,!0)}else d=a.getConstructor(t,o,f),n.mix(d.prototype,s);return e("./$.cof").set(d,t),e("./$.species")(d),m[t]=d,r(r.G+r.W+r.F*(d!=c),m),u||l.std(d,t,a.getIterConstructor(),a.next,o?"key+value":"value",!o,!0),d}},{"./$":223,"./$.assert":212,"./$.cof":214,"./$.def":219,"./$.iter":222,"./$.species":229}],218:[function(e,t){var n=e("./$.assert").fn;t.exports=function(e,t,r){if(n(e),~r&&void 0===t)return e;switch(r){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,l){return e.call(t,n,r,l)}}return function(){return e.apply(t,arguments)}}},{"./$.assert":212}],219:[function(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}function r(e,t,o){var u,p,c,d,f=e&r.G,h=f?i:e&r.S?i[t]:(i[t]||{}).prototype,m=f?s:s[t]||(s[t]={});f&&(o=t);for(u in o)p=!(e&r.F)&&h&&u in h,p&&u in m||(c=p?h[u]:o[u],f&&!a(h[u])?d=o[u]:e&r.B&&p?d=n(c,i):e&r.W&&h[u]==c?!function(e){d=function(t){return this instanceof e?new e(t):e(t)},d.prototype=e.prototype}(c):d=e&r.P&&a(c)?n(Function.call,c):c,l.hide(m,u,d))}var l=e("./$"),i=l.g,s=l.core,a=l.isFunction;r.F=1,r.G=2,r.S=4,r.P=8,r.B=16,r.W=32,t.exports=r},{"./$":223}],220:[function(e,t){t.exports=function(e){return e.FW=!1,e.path=e.core,e}},{}],221:[function(e,t){t.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3]);case 5:return r?e(t[0],t[1],t[2],t[3],t[4]):e.call(n,t[0],t[1],t[2],t[3],t[4])}return e.apply(n,t)}},{}],222:[function(e,t){"use strict";function n(e,t){a.hide(e,d,t),f in[]&&a.hide(e,f,t)}function r(e,t,r,l){var i=e.prototype,s=i[d]||i[f]||l&&i[l]||r;if(a.FW&&n(i,s),s!==r){var o=a.getProto(s.call(new e));u.set(o,t+" Iterator",!0),a.FW&&a.has(i,f)&&n(o,a.that)}return h[t]=s,h[t+" Iterator"]=a.that,s}function l(e){var t=a.g.Symbol,n=e[t&&t.iterator||f],r=n||e[d]||h[u.classof(e)];return c(r.call(e))}function i(e){var t=e["return"];void 0!==t&&c(t.call(e))}function s(e,t,n,r){try{return r?t(c(n)[0],n[1]):t(n)}catch(l){throw i(e),l}}var a=e("./$"),o=e("./$.ctx"),u=e("./$.cof"),p=e("./$.def"),c=e("./$.assert").obj,d=e("./$.wks")("iterator"),f="@@iterator",h={},m={},g="keys"in[]&&!("next"in[].keys());n(m,a.that);var y=!0;!function(){try{var e=[1].keys();e["return"]=function(){y=!1},Array.from(e,function(){throw 2})}catch(t){}}();var b=t.exports={BUGGY:g,DANGER_CLOSING:y,fail:function(e){var t=!0;try{var n=[[{},1]],r=n[d](),l=r.next;r.next=function(){return t=!1,l.call(this)},n[d]=function(){return r},e(n)}catch(i){}return t},Iterators:h,prototype:m,step:function(e,t){return{value:t,done:!!e}},stepCall:s,close:i,is:function(e){var t=Object(e),n=a.g.Symbol,r=n&&n.iterator||f;return r in t||d in t||a.has(h,u.classof(t))},get:l,set:n,create:function(e,t,n,r){e.prototype=a.create(r||b.prototype,{next:a.desc(1,n)}),u.set(e,t+" Iterator")},define:r,std:function(e,t,n,l,i,s,o){function u(e){return function(){return new n(this,e)}}b.create(n,t,l);var c,d,f=u("key+value"),h=u("value"),m=e.prototype;if("value"==i?h=r(e,t,h,"values"):f=r(e,t,f,"entries"),i&&(c={entries:f,keys:s?h:u("key"),values:h},p(p.P+p.F*g,t,c),o))for(d in c)d in m||a.hide(m,d,c[d])},forOf:function(e,t,n,r){for(var a,u=l(e),p=o(n,r,t?2:1);!(a=u.next()).done;)if(s(u,p,a.value,t)===!1)return i(u)}}},{"./$":223,"./$.assert":212,"./$.cof":214,"./$.ctx":218,"./$.def":219,"./$.wks":234}],223:[function(e,t){"use strict";function n(e){return isNaN(e=+e)?0:(e>0?h:f)(e)}function r(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function l(e,t,n){return e[t]=n,e}function i(e){return y?function(t,n,l){return v.setDesc(t,n,r(e,l))}:l}function s(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function a(e){return"function"==typeof e}function o(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}var u="undefined"!=typeof self?self:Function("return this")(),p={},c=Object.defineProperty,d={}.hasOwnProperty,f=Math.ceil,h=Math.floor,m=Math.max,g=Math.min,y=!!function(){try{return 2==c({},"a",{get:function(){return 2}}).a}catch(e){}}(),b=i(1),v=t.exports=e("./$.fw")({g:u,core:p,html:u.document&&document.documentElement,isObject:s,isFunction:a,it:function(e){return e},that:function(){return this},toInteger:n,toLength:function(e){return e>0?g(n(e),9007199254740991):0},toIndex:function(e,t){return e=n(e),0>e?m(e+t,0):g(e,t)},has:function(e,t){return d.call(e,t)},create:Object.create,getProto:Object.getPrototypeOf,DESC:y,desc:r,getDesc:Object.getOwnPropertyDescriptor,setDesc:c,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:o,ES5Object:Object,toObject:function(e){return v.ES5Object(o(e))},hide:b,def:i(0),set:u.Symbol?l:b,mix:function(e,t){for(var n in t)b(e,n,t[n]);return e},each:[].forEach});"undefined"!=typeof __e&&(__e=p),"undefined"!=typeof __g&&(__g=u)},{"./$.fw":220}],224:[function(e,t){var n=e("./$");t.exports=function(e,t){for(var r,l=n.toObject(e),i=n.getKeys(l),s=i.length,a=0;s>a;)if(l[r=i[a++]]===t)return r}},{"./$":223}],225:[function(e,t){var n=e("./$"),r=e("./$.assert").obj;t.exports=function(e){return r(e),n.getSymbols?n.getNames(e).concat(n.getSymbols(e)):n.getNames(e)}},{"./$":223,"./$.assert":212}],226:[function(e,t){"use strict";var n=e("./$"),r=e("./$.invoke"),l=e("./$.assert").fn;t.exports=function(){for(var e=l(this),t=arguments.length,i=Array(t),s=0,a=n.path._,o=!1;t>s;)(i[s]=arguments[s++])===a&&(o=!0);return function(){var n,l=this,s=arguments.length,u=0,p=0;if(!o&&!s)return r(e,i,l);if(n=i.slice(),o)for(;t>u;u++)n[u]===a&&(n[u]=arguments[p++]);for(;s>p;)n.push(arguments[p++]);return r(e,n,l)}}},{"./$":223,"./$.assert":212,"./$.invoke":221}],227:[function(e,t){"use strict";t.exports=function(e,t,n){var r=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(n?t:this).replace(e,r)}}},{}],228:[function(e,t){var n=e("./$"),r=e("./$.assert");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(t,l){try{l=e("./$.ctx")(Function.call,n.getDesc(Object.prototype,"__proto__").set,2),l({},[])}catch(i){t=!0}return function(e,i){return r.obj(e),r(null===i||n.isObject(i),i,": can't set as prototype!"),t?e.__proto__=i:l(e,i),e}}():void 0)},{"./$":223,"./$.assert":212,"./$.ctx":218}],229:[function(e,t){var n=e("./$");t.exports=function(t){n.DESC&&n.FW&&n.setDesc(t,e("./$.wks")("species"),{configurable:!0,get:n.that})}},{"./$":223,"./$.wks":234}],230:[function(e,t){"use strict";var n=e("./$");t.exports=function(e){return function(t){var r,l,i=String(n.assertDefined(this)),s=n.toInteger(t),a=i.length;return 0>s||s>=a?e?"":void 0:(r=i.charCodeAt(s),55296>r||r>56319||s+1===a||(l=i.charCodeAt(s+1))<56320||l>57343?e?i.charAt(s):r:e?i.slice(s,s+2):(r-55296<<10)+(l-56320)+65536)}}},{"./$":223}],231:[function(e,t){"use strict";function n(){var e=+this;if(a.has(v,e)){var t=v[e];delete v[e],t()}}function r(e){n.call(e.data)}var l,i,s,a=e("./$"),o=e("./$.ctx"),u=e("./$.cof"),p=e("./$.invoke"),c=a.g,d=a.isFunction,f=c.setImmediate,h=c.clearImmediate,m=c.postMessage,g=c.addEventListener,y=c.MessageChannel,b=0,v={},x="onreadystatechange";d(f)&&d(h)||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++b]=function(){p(d(e)?e:Function(e),t)},l(b),b},h=function(e){delete v[e]},"process"==u(c.process)?l=function(e){c.process.nextTick(o(n,e,1))}:g&&d(m)&&!a.g.importScripts?(l=function(e){m(e,"*")},g("message",r,!1)):d(y)?(i=new y,s=i.port2,i.port1.onmessage=r,l=o(s.postMessage,s,1)):l=a.g.document&&x in document.createElement("script")?function(e){a.html.appendChild(document.createElement("script"))[x]=function(){a.html.removeChild(this),n.call(e)}}:function(e){setTimeout(o(n,e,1),0)}),t.exports={set:f,clear:h}},{"./$":223,"./$.cof":214,"./$.ctx":218,"./$.invoke":221}],232:[function(e,t){function n(e){return"Symbol("+e+")_"+(++r+Math.random()).toString(36)}var r=0;n.safe=e("./$").g.Symbol||n,t.exports=n},{"./$":223}],233:[function(e,t){var n=e("./$"),r=e("./$.wks")("unscopables");!n.FW||r in[]||n.hide(Array.prototype,r,{}),t.exports=function(e){n.FW&&([][r][e]=!0)}},{"./$":223,"./$.wks":234}],234:[function(e,t){var n=e("./$").g,r={};t.exports=function(t){return r[t]||(r[t]=n.Symbol&&n.Symbol[t]||e("./$.uid").safe("Symbol."+t))}},{"./$":223,"./$.uid":232}],235:[function(e){"use strict";function t(e,n){return this instanceof t?(this[p]=f(e),void(this[o]=!!n)):new t(e,n)}function n(e){function t(e,t,n){this[p]=f(e),this[o]=e[o],this[u]=l(t,n,e[o]?2:1)}return m(t,"Chain",e,g),h(t.prototype,r.that),t}var r=e("./$"),l=e("./$.ctx"),i=e("./$.uid").safe,s=e("./$.def"),a=e("./$.iter"),o=i("entries"),u=i("fn"),p=i("iter"),c=a.forOf,d=a.stepCall,f=a.get,h=a.set,m=a.create;m(t,"Wrapper",function(){return this[p].next()});var g=t.prototype;h(g,function(){return this[p]});var y=n(function(){var e=this[p].next();return e.done?e:a.step(0,d(this[p],this[u],e.value,this[o]))}),b=n(function(){for(;;){var e=this[p].next();if(e.done||d(this[p],this[u],e.value,this[o]))return e}});r.mix(g,{of:function(e,t){c(this,this[o],e,t)},array:function(e,t){var n=[];return c(void 0!=e?this.map(e,t):this,!1,n.push,n),n},filter:function(e,t){return new b(this,e,t)},map:function(e,t){return new y(this,e,t)}}),t.isIterable=a.is,t.getIterator=f,s(s.G+s.F,{$for:t})},{"./$":223,"./$.ctx":218,"./$.def":219,"./$.iter":222,"./$.uid":232}],236:[function(e){"use strict";var t=e("./$"),n=e("./$.def"),r=e("./$.assert").fn;n(n.P+n.F,"Array",{turn:function(e,n){r(e);for(var l=void 0==n?[]:Object(n),i=t.ES5Object(this),s=t.toLength(i.length),a=0;s>a&&e(l,i[a],a++,this)!==!1;);return l}}),e("./$.unscope")("turn")},{"./$":223,"./$.assert":212,"./$.def":219,"./$.unscope":233}],237:[function(e){"use strict";function t(e){var t=this,l={};return s(t,o,function(e){return void 0!==e&&e in t?n.has(l,e)?l[e]:l[e]=r(t[e],t,-1):u.call(t)})[o](e)}var n=e("./$"),r=e("./$.ctx"),l=e("./$.def"),i=e("./$.invoke"),s=n.hide,a=e("./$.assert").fn,o=n.DESC?e("./$.uid")("tie"):"toLocaleString",u={}.toLocaleString;n.core._=n.path._=n.path._||{},l(l.P+l.F,"Function",{part:e("./$.partial"),only:function(e,t){var r=a(this),l=n.toLength(e),s=arguments.length>1;return function(){for(var e=Math.min(l,arguments.length),n=Array(e),a=0;e>a;)n[a]=arguments[a++];return i(r,n,s?t:this)}}}),s(n.path._,"toString",function(){return o}),s(Object.prototype,o,t),n.DESC||s(Array.prototype,o,t)},{"./$":223,"./$.assert":212,"./$.ctx":218,"./$.def":219,"./$.invoke":221,"./$.partial":226,"./$.uid":232}],238:[function(e){function t(e){return e>9?e:"0"+e}function n(e){return function(n,r){function i(t){return s[e+t]()}var s=this,o=u[l.has(u,r)?r:p];return String(n).replace(a,function(e){switch(e){case"s":return i(c);case"ss":return t(i(c));case"m":return i(d);case"mm":return t(i(d));case"h":return i(f);case"hh":return t(i(f));case"D":return i(h);case"DD":return t(i(h));case"W":return o[0][i("Day")];case"N":return i(m)+1;case"NN":return t(i(m)+1);case"M":return o[2][i(m)];case"MM":return o[1][i(m)];case"Y":return i(g);case"YY":return t(i(g)%100)}return e})}}function r(e,t){function n(e){var n=[];return l.each.call(t.months.split(","),function(t){n.push(t.replace(o,"$"+e))}),n}return u[e]=[t.weekdays.split(","),n(1),n(2)],s}var l=e("./$"),i=e("./$.def"),s=l.core,a=/\b\w\w?\b/g,o=/:(.*)\|(.*)$/,u={},p="en",c="Seconds",d="Minutes",f="Hours",h="Date",m="Month",g="FullYear";i(i.P+i.F,h,{format:n("get"),formatUTC:n("getUTC")}),r(p,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"}),r("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"}),s.locale=function(e){return l.has(u,e)?p=e:p},s.addLocale=r},{"./$":223,"./$.def":219}],239:[function(e){var t=e("./$"),n=e("./$.def"),r=e("./$.partial");n(n.G+n.F,{delay:function(e){return new(t.core.Promise||t.g.Promise)(function(t){setTimeout(r.call(t,!0),e)})}})},{"./$":223,"./$.def":219,"./$.partial":226}],240:[function(e){function t(e){var t=a.create(null);return void 0!=e&&(h.is(e)?h.forOf(e,!0,function(e,n){t[e]=n}):p(t,e)),t}function n(e,t){a.set(this,d,{o:y(e),a:g(e),i:0,k:t})}function r(e){return function(t){return new n(t,e)}}function l(e,t){return"function"==typeof e?e:t}function i(e){var n=1==e,r=4==e;return function(i,s,a){var u,p,c,d=o(s,a,3),f=y(i),h=n||7==e||2==e?new(l(this,t)):void 0;for(u in f)if(b(f,u)&&(p=f[u],c=d(p,u,i),e))if(n)h[u]=c;else if(c)switch(e){case 2:h[u]=p;break;case 3:return!0;case 5:return p;case 6:return u;case 7:h[c[0]]=c[1]}else if(r)return!1;return 3==e||r?r:h}}function s(e){return function(n,r,i){f.fn(r);var s,a,o,u=y(n),p=g(u),c=p.length,d=0;for(e?s=void 0==i?new(l(this,t)):Object(i):arguments.length<3?(f(c,"Reduce of empty object with no initial value"),s=u[p[d++]]):s=Object(i);c>d;)if(b(u,a=p[d++]))if(o=r(s,u[a],a,n),e){if(o===!1)break}else s=o;return s}}var a=e("./$"),o=e("./$.ctx"),u=e("./$.def"),p=e("./$.assign"),c=e("./$.keyof"),d=e("./$.uid").safe("iter"),f=e("./$.assert"),h=e("./$.iter"),m=h.step,g=a.getKeys,y=a.toObject,b=a.has;t.prototype=null,h.create(n,"Dict",function(){var e,t=this[d],n=t.o,r=t.a,l=t.k;do if(t.i>=r.length)return t.o=void 0,m(1);while(!b(n,e=r[t.i++]));return"key"==l?m(0,e):"value"==l?m(0,n[e]):m(0,[e,n[e]])});var v=i(6);u(u.G+u.F,{Dict:a.mix(t,{keys:r("key"),values:r("value"),entries:r("key+value"),forEach:i(0),map:i(1),filter:i(2),some:i(3),every:i(4),find:i(5),findKey:v,mapPairs:i(7),reduce:s(!1),turn:s(!0),keyOf:c,includes:function(e,t){return void 0!==(t==t?c(e,t):v(e,function(e){return e!=e}))},has:b,get:function(e,t){return b(e,t)?e[t]:void 0},set:a.def,isDict:function(e){return a.isObject(e)&&a.getProto(e)===t.prototype}})})},{"./$":223,"./$.assert":212,"./$.assign":213,"./$.ctx":218,"./$.def":219,"./$.iter":222,"./$.keyof":224,"./$.uid":232}],241:[function(e){var t=e("./$.def");t(t.G+t.F,{global:e("./$").g})},{"./$":223,"./$.def":219}],242:[function(e){var t=e("./$").core,n=e("./$.iter");t.isIterable=n.is,t.getIterator=n.get},{"./$":223,"./$.iter":222}],243:[function(e){var t=e("./$"),n=e("./$.def"),r={},l=!0;t.each.call("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,markTimeline,profile,profileEnd,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(","),function(e){r[e]=function(){return l&&t.g.console&&t.isFunction(console[e])?Function.apply.call(console[e],console,arguments):void 0}}),n(n.G+n.F,{log:e("./$.assign")(r.log,r,{enable:function(){l=!0},disable:function(){l=!1}})})},{"./$":223,"./$.assign":213,"./$.def":219}],244:[function(e){"use strict";function t(e){n.set(this,r,{l:n.toLength(e),i:0})}var n=e("./$"),r=e("./$.uid").safe("iter"),l=e("./$.iter"),i=l.step,s="Number";l.create(t,s,function(){var e=this[r],t=e.i++;return t<e.l?i(0,t):i(1)}),l.define(Number,s,function(){return new t(this)})},{"./$":223,"./$.iter":222,"./$.uid":232}],245:[function(e){"use strict";var t=e("./$"),n=e("./$.def"),r=e("./$.invoke"),l={};l.random=function(e){var t=+this,n=void 0==e?0:+e,r=Math.min(t,n);return Math.random()*(Math.max(t,n)-r)+r},t.FW&&t.each.call("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc".split(","),function(e){var t=Math[e];t&&(l[e]=function(){for(var e=[+this],n=0;arguments.length>n;)e.push(arguments[n++]);return r(t,e)})}),n(n.P+n.F,"Number",l)},{"./$":223,"./$.def":219,"./$.invoke":221}],246:[function(e){function t(e,t){for(var r,i=l(n.toObject(t)),s=i.length,a=0;s>a;)n.setDesc(e,r=i[a++],n.getDesc(t,r)); return e}var n=e("./$"),r=e("./$.def"),l=e("./$.own-keys");r(r.S+r.F,"Object",{isObject:n.isObject,classof:e("./$.cof").classof,define:t,make:function(e,r){return t(n.create(e),r)}})},{"./$":223,"./$.cof":214,"./$.def":219,"./$.own-keys":225}],247:[function(e){var t,n=e("./$.def"),r=e("./$.replacer"),l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"},i={};for(t in l)i[l[t]]=t;n(n.P+n.F,"String",{escapeHTML:r(/[&<>"']/g,l),unescapeHTML:r(/&(?:amp|lt|gt|quot|apos);/g,i)})},{"./$.def":219,"./$.replacer":227}],248:[function(e){function t(e,t){return function(n){var r,l=w(n),i=0,s=[];for(r in l)r!=d&&E(l,r)&&s.push(r);for(;t>i;)E(l,r=e[i++])&&(~b.call(s,r)||s.push(r));return s}}function n(e){return!a.isObject(e)}function r(){}function l(e){return function(){return e.apply(a.ES5Object(this),arguments)}}function i(e){return function(t,n){f.fn(t);var r=w(this),l=k(r.length),i=e?l-1:0,s=e?-1:1;if(arguments.length<2)for(;;){if(i in r){n=r[i],i+=s;break}i+=s,f(e?i>=0:l>i,"Reduce of empty array with no initial value")}for(;e?i>=0:l>i;i+=s)i in r&&(n=t(n,r[i],i,this));return n}}function s(e){return e>9?e:"0"+e}var a=e("./$"),o=e("./$.cof"),u=e("./$.def"),p=e("./$.invoke"),c=e("./$.array-methods"),d=e("./$.uid").safe("__proto__"),f=e("./$.assert"),h=f.obj,m=Object.prototype,g=[],y=g.slice,b=g.indexOf,v=o.classof,x=Object.defineProperties,E=a.has,_=a.setDesc,S=a.getDesc,I=a.isFunction,w=a.toObject,k=a.toLength,A=!1;if(!a.DESC){try{A=8==_(document.createElement("div"),"x",{get:function(){return 8}}).x}catch(C){}a.setDesc=function(e,t,n){if(A)try{return _(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(h(e)[t]=n.value),e},a.getDesc=function(e,t){if(A)try{return S(e,t)}catch(n){}return E(e,t)?a.desc(!m.propertyIsEnumerable.call(e,t),e[t]):void 0},x=function(e,t){h(e);for(var n,r=a.getKeys(t),l=r.length,i=0;l>i;)a.setDesc(e,n=r[i++],t[n]);return e}}u(u.S+u.F*!a.DESC,"Object",{getOwnPropertyDescriptor:a.getDesc,defineProperty:a.setDesc,defineProperties:x});var T="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),j=T.concat("length","prototype"),M=T.length,P=function(){var e,t=document.createElement("iframe"),n=M;for(t.style.display="none",a.html.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object</script>"),e.close(),P=e.F;n--;)delete P.prototype[T[n]];return P()};u(u.S,"Object",{getPrototypeOf:a.getProto=a.getProto||function(e){return e=Object(f.def(e)),E(e,d)?e[d]:I(e.constructor)&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?m:null},getOwnPropertyNames:a.getNames=a.getNames||t(j,j.length,!0),create:a.create=a.create||function(e,t){var n;return null!==e?(r.prototype=h(e),n=new r,r.prototype=null,n[d]=e):n=P(),void 0===t?n:x(n,t)},keys:a.getKeys=a.getKeys||t(T,M,!1),seal:a.it,freeze:a.it,preventExtensions:a.it,isSealed:n,isFrozen:n,isExtensible:a.isObject}),u(u.P,"Function",{bind:function(e){function t(){var l=r.concat(y.call(arguments));return p(n,l,this instanceof t?a.create(n.prototype):e)}var n=f.fn(this),r=y.call(arguments,1);return n.prototype&&(t.prototype=n.prototype),t}}),0 in Object("z")&&"z"=="z"[0]||(a.ES5Object=function(e){return"String"==o(e)?e.split(""):Object(e)}),u(u.P+u.F*(a.ES5Object!=Object),"Array",{slice:l(y),join:l(g.join)}),u(u.S,"Array",{isArray:function(e){return"Array"==o(e)}}),u(u.P,"Array",{forEach:a.each=a.each||c(0),map:c(1),filter:c(2),some:c(3),every:c(4),reduce:i(!1),reduceRight:i(!0),indexOf:b=b||e("./$.array-includes")(!1),lastIndexOf:function(e,t){var n=w(this),r=k(n.length),l=r-1;for(arguments.length>1&&(l=Math.min(l,a.toInteger(t))),0>l&&(l=k(r+l));l>=0;l--)if(l in n&&n[l]===e)return l;return-1}}),u(u.P,"String",{trim:e("./$.replacer")(/^\s*([\s\S]*\S)?\s*$/,"$1")}),u(u.S,"Date",{now:function(){return+new Date}}),u(u.P,"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=0>t?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}}),"Object"==v(function(){return arguments}())&&(o.classof=function(e){var t=v(e);return"Object"==t&&I(e.callee)?"Arguments":t})},{"./$":223,"./$.array-includes":210,"./$.array-methods":211,"./$.assert":212,"./$.cof":214,"./$.def":219,"./$.invoke":221,"./$.replacer":227,"./$.uid":232}],249:[function(e){"use strict";var t=e("./$"),n=e("./$.def"),r=t.toIndex;n(n.P,"Array",{copyWithin:function(e,n){var l=Object(t.assertDefined(this)),i=t.toLength(l.length),s=r(e,i),a=r(n,i),o=arguments[2],u=void 0===o?i:r(o,i),p=Math.min(u-a,i-s),c=1;for(s>a&&a+p>s&&(c=-1,a=a+p-1,s=s+p-1);p-->0;)a in l?l[s]=l[a]:delete l[s],s+=c,a+=c;return l}}),e("./$.unscope")("copyWithin")},{"./$":223,"./$.def":219,"./$.unscope":233}],250:[function(e){"use strict";var t=e("./$"),n=e("./$.def"),r=t.toIndex;n(n.P,"Array",{fill:function(e){for(var n=Object(t.assertDefined(this)),l=t.toLength(n.length),i=r(arguments[1],l),s=arguments[2],a=void 0===s?l:r(s,l);a>i;)n[i++]=e;return n}}),e("./$.unscope")("fill")},{"./$":223,"./$.def":219,"./$.unscope":233}],251:[function(e){var t=e("./$.def");t(t.P,"Array",{findIndex:e("./$.array-methods")(6)}),e("./$.unscope")("findIndex")},{"./$.array-methods":211,"./$.def":219,"./$.unscope":233}],252:[function(e){var t=e("./$.def");t(t.P,"Array",{find:e("./$.array-methods")(5)}),e("./$.unscope")("find")},{"./$.array-methods":211,"./$.def":219,"./$.unscope":233}],253:[function(e){var t=e("./$"),n=e("./$.ctx"),r=e("./$.def"),l=e("./$.iter"),i=l.stepCall;r(r.S+r.F*l.DANGER_CLOSING,"Array",{from:function(e){var r,s,a,o,u=Object(t.assertDefined(e)),p=arguments[1],c=void 0!==p,d=c?n(p,arguments[2],2):void 0,f=0;if(l.is(u))for(o=l.get(u),s=new("function"==typeof this?this:Array);!(a=o.next()).done;f++)s[f]=c?i(o,d,[a.value,f],!0):a.value;else for(s=new("function"==typeof this?this:Array)(r=t.toLength(u.length));r>f;f++)s[f]=c?d(u[f],f):u[f];return s.length=f,s}})},{"./$":223,"./$.ctx":218,"./$.def":219,"./$.iter":222}],254:[function(e){var t=e("./$"),n=e("./$.unscope"),r=e("./$.uid").safe("iter"),l=e("./$.iter"),i=l.step,s=l.Iterators;l.std(Array,"Array",function(e,n){t.set(this,r,{o:t.toObject(e),i:0,k:n})},function(){var e=this[r],t=e.o,n=e.k,l=e.i++;return!t||l>=t.length?(e.o=void 0,i(1)):"key"==n?i(0,l):"value"==n?i(0,t[l]):i(0,[l,t[l]])},"value"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"./$":223,"./$.iter":222,"./$.uid":232,"./$.unscope":233}],255:[function(e){var t=e("./$.def");t(t.S,"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)n[e]=arguments[e++];return n.length=t,n}})},{"./$.def":219}],256:[function(e){e("./$.species")(Array)},{"./$.species":229}],257:[function(e){"use strict";var t=e("./$"),n="name",r=t.setDesc,l=Function.prototype;n in l||t.FW&&t.DESC&&r(l,n,{configurable:!0,get:function(){var e=String(this).match(/^\s*function ([^ (]*)/),l=e?e[1]:"";return t.has(this,n)||r(this,n,t.desc(5,l)),l},set:function(e){t.has(this,n)||r(this,n,t.desc(0,e))}})},{"./$":223}],258:[function(e){"use strict";var t=e("./$.collection-strong");e("./$.collection")("Map",{get:function(e){var n=t.getEntry(this,e);return n&&n.v},set:function(e,n){return t.def(this,0===e?0:e,n)}},t,!0)},{"./$.collection":217,"./$.collection-strong":215}],259:[function(e){function t(e){return isFinite(e=+e)&&0!=e?0>e?-t(-e):u(e+p(e*e+1)):e}function n(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:o(e)-1}var r=1/0,l=e("./$.def"),i=Math.E,s=Math.pow,a=Math.abs,o=Math.exp,u=Math.log,p=Math.sqrt,c=Math.ceil,d=Math.floor,f=Math.sign||function(e){return 0==(e=+e)||e!=e?e:0>e?-1:1};l(l.S,"Math",{acosh:function(e){return(e=+e)<1?0/0:isFinite(e)?u(e/i+p(e+1)*p(e-1)/i)+1:e},asinh:t,atanh:function(e){return 0==(e=+e)?e:u((1+e)/(1-e))/2},cbrt:function(e){return f(e=+e)*s(a(e),1/3)},clz32:function(e){return(e>>>=0)?32-e.toString(2).length:32},cosh:function(e){return(o(e=+e)+o(-e))/2},expm1:n,fround:function(e){return new Float32Array([e])[0]},hypot:function(){for(var e,t=0,n=arguments.length,l=n,i=Array(n),a=-r;n--;){if(e=i[n]=+arguments[n],e==r||e==-r)return r;e>a&&(a=e)}for(a=e||1;l--;)t+=s(i[l]/a,2);return a*p(t)},imul:function(e,t){var n=65535,r=+e,l=+t,i=n&r,s=n&l;return 0|i*s+((n&r>>>16)*s+i*(n&l>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:u(1+e)},log10:function(e){return u(e)/Math.LN10},log2:function(e){return u(e)/Math.LN2},sign:f,sinh:function(e){return a(e=+e)<1?(n(e)-n(-e))/2:(o(e-1)-o(-e-1))*(i/2)},tanh:function(e){var t=n(e=+e),l=n(-e);return t==r?1:l==r?-1:(t-l)/(o(e)+o(-e))},trunc:function(e){return(e>0?d:c)(e)}})},{"./$.def":219}],260:[function(e){"use strict";function t(e){var t,n;if(i(t=e.valueOf)&&!l(n=t.call(e)))return n;if(i(t=e.toString)&&!l(n=t.call(e)))return n;throw TypeError("Can't convert object to number")}function n(e){if(l(e)&&(e=t(e)),"string"==typeof e&&e.length>2&&48==e.charCodeAt(0)){var n=!1;switch(e.charCodeAt(1)){case 66:case 98:n=!0;case 79:case 111:return parseInt(e.slice(2),n?2:8)}}return+e}var r=e("./$"),l=r.isObject,i=r.isFunction,s="Number",a=r.g[s],o=a,u=a.prototype;!r.FW||a("0o1")&&a("0b1")||(a=function p(e){return this instanceof p?new o(n(e)):n(e)},r.each.call(r.DESC?r.getNames(o):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(e){r.has(o,e)&&!r.has(a,e)&&r.setDesc(a,e,r.getDesc(o,e))}),a.prototype=u,u.constructor=a,r.hide(r.g,s,a))},{"./$":223}],261:[function(e){function t(e){return!n.isObject(e)&&isFinite(e)&&i(e)===e}var n=e("./$"),r=e("./$.def"),l=Math.abs,i=Math.floor,s=9007199254740991;r(r.S,"Number",{EPSILON:Math.pow(2,-52),isFinite:function(e){return"number"==typeof e&&isFinite(e)},isInteger:t,isNaN:function(e){return e!=e},isSafeInteger:function(e){return t(e)&&l(e)<=s},MAX_SAFE_INTEGER:s,MIN_SAFE_INTEGER:-s,parseFloat:parseFloat,parseInt:parseInt})},{"./$":223,"./$.def":219}],262:[function(e){var t=e("./$.def");t(t.S,"Object",{assign:e("./$.assign")})},{"./$.assign":213,"./$.def":219}],263:[function(e){var t=e("./$.def");t(t.S,"Object",{is:function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}})},{"./$.def":219}],264:[function(e){var t=e("./$.def");t(t.S,"Object",{setPrototypeOf:e("./$.set-proto")})},{"./$.def":219,"./$.set-proto":228}],265:[function(e){function t(e,t){var s=(n.core.Object||{})[e]||Object[e],a=0,o={};o[e]=1==t?function(e){return l(e)?s(e):e}:2==t?function(e){return l(e)?s(e):!0}:3==t?function(e){return l(e)?s(e):!1}:4==t?function(e,t){return s(i(e),t)}:5==t?function(e){return s(Object(n.assertDefined(e)))}:function(e){return s(i(e))};try{s("z")}catch(u){a=1}r(r.S+r.F*a,"Object",o)}var n=e("./$"),r=e("./$.def"),l=n.isObject,i=n.toObject;t("freeze",1),t("seal",1),t("preventExtensions",1),t("isFrozen",2),t("isSealed",2),t("isExtensible",3),t("getOwnPropertyDescriptor",4),t("getPrototypeOf",5),t("keys"),t("getOwnPropertyNames")},{"./$":223,"./$.def":219}],266:[function(e){"use strict";var t=e("./$"),n=e("./$.cof"),r={};r[e("./$.wks")("toStringTag")]="z",t.FW&&"z"!=n(r)&&t.hide(Object.prototype,"toString",function(){return"[object "+n.classof(this)+"]"})},{"./$":223,"./$.cof":214,"./$.wks":234}],267:[function(e){"use strict";function t(e){var t=E(e)[u];return void 0!=t?t:e}var n,r=e("./$"),l=e("./$.ctx"),i=e("./$.cof"),s=e("./$.def"),a=e("./$.assert"),o=e("./$.iter"),u=e("./$.wks")("species"),p=e("./$.uid").safe("record"),c=o.forOf,d="Promise",f=r.g,h=f.process,m=h&&h.nextTick||e("./$.task").set,g=f[d],y=g,b=r.isFunction,v=r.isObject,x=a.fn,E=a.obj;b(g)&&b(g.resolve)&&g.resolve(n=new g(function(){}))==n||function(){function e(e){var t;return v(e)&&(t=e.then),b(t)?t:!1}function t(e){var n,r=e[p],l=r.c,i=0;if(r.h)return!0;for(;l.length>i;)if(n=l[i++],n.fail||t(n.P))return!0}function n(n,r){var l=n.c;(r||l.length)&&m(function(){var s=n.p,a=n.v,o=1==n.s,u=0;if(r&&!t(s))setTimeout(function(){t(s)||("process"==i(h)?h.emit("unhandledRejection",a,s):f.console&&b(console.error)&&console.error("Unhandled promise rejection",a))},1e3);else for(;l.length>u;)!function(t){var r,l,i=o?t.ok:t.fail;try{i?(o||(n.h=!0),r=i===!0?a:i(a),r===t.P?t.rej(TypeError(d+"-chain cycle")):(l=e(r))?l.call(r,t.res,t.rej):t.res(r)):t.rej(a)}catch(s){t.rej(s)}}(l[u++]);l.length=0})}function s(e){var t=this;t.d||(t.d=!0,t=t.r||t,t.v=e,t.s=2,n(t,!0))}function o(t){var r,i,a=this;if(!a.d){a.d=!0,a=a.r||a;try{(r=e(t))?(i={r:a,d:!1},r.call(t,l(o,i,1),l(s,i,1))):(a.v=t,a.s=1,n(a))}catch(u){s.call(i||{r:a,d:!1},u)}}}g=function(e){x(e);var t={p:a.inst(this,g,d),c:[],s:0,d:!1,v:void 0,h:!1};r.hide(this,p,t);try{e(l(o,t,1),l(s,t,1))}catch(n){s.call(t,n)}},r.mix(g.prototype,{then:function(e,t){var r=E(E(this).constructor)[u],l={ok:b(e)?e:!0,fail:b(t)?t:!1},i=l.P=new(void 0!=r?r:g)(function(e,t){l.res=x(e),l.rej=x(t)}),s=this[p];return s.c.push(l),s.s&&n(s),i},"catch":function(e){return this.then(void 0,e)}})}(),s(s.G+s.W+s.F*(g!=y),{Promise:g}),s(s.S,d,{reject:function(e){return new(t(this))(function(t,n){n(e)})},resolve:function(e){return v(e)&&p in e&&r.getProto(e)===this.prototype?e:new(t(this))(function(t){t(e)})}}),s(s.S+s.F*(o.fail(function(e){g.all(e)["catch"](function(){})})||o.DANGER_CLOSING),d,{all:function(e){var n=t(this),l=[];return new n(function(t,i){c(e,!1,l.push,l);var s=l.length,a=Array(s);s?r.each.call(l,function(e,r){n.resolve(e).then(function(e){a[r]=e,--s||t(a)},i)}):t(a)})},race:function(e){var n=t(this);return new n(function(t,r){c(e,!1,function(e){n.resolve(e).then(t,r)})})}}),i.set(g,d),e("./$.species")(g)},{"./$":223,"./$.assert":212,"./$.cof":214,"./$.ctx":218,"./$.def":219,"./$.iter":222,"./$.species":229,"./$.task":231,"./$.uid":232,"./$.wks":234}],268:[function(e){function t(e){var t,n=[];for(t in e)n.push(t);i.set(this,u,{o:e,a:n,i:0})}function n(e){return function(t){y(t);try{return e.apply(void 0,arguments),!0}catch(n){return!1}}}function r(e,t){var n,l=arguments.length<3?e:arguments[2],s=f(y(e),t);return s?i.has(s,"value")?s.value:void 0===s.get?void 0:s.get.call(l):d(n=m(e))?r(n,t,l):void 0}function l(e,t,n){var r,s,a=arguments.length<4?e:arguments[3],o=f(y(e),t);if(!o){if(d(s=m(e)))return l(s,t,n,a);o=i.desc(0)}return i.has(o,"value")?o.writable!==!1&&d(a)?(r=f(a,t)||i.desc(0),r.value=n,h(a,t,r),!0):!1:void 0===o.set?!1:(o.set.call(a,n),!0)}var i=e("./$"),s=e("./$.def"),a=e("./$.set-proto"),o=e("./$.iter"),u=e("./$.uid").safe("iter"),p=o.step,c=e("./$.assert"),d=i.isObject,f=i.getDesc,h=i.setDesc,m=i.getProto,g=Function.apply,y=c.obj,b=Object.isExtensible||i.it;o.create(t,"Object",function(){var e,t=this[u],n=t.a;do if(t.i>=n.length)return p(1);while(!((e=n[t.i++])in t.o));return p(0,e)});var v={apply:e("./$.ctx")(Function.call,g,3),construct:function(e,t){var n=c.fn(arguments.length<3?e:arguments[2]).prototype,r=i.create(d(n)?n:Object.prototype),l=g.call(e,r,t);return d(l)?l:r},defineProperty:n(h),deleteProperty:function(e,t){var n=f(y(e),t);return n&&!n.configurable?!1:delete e[t]},enumerate:function(e){return new t(y(e))},get:r,getOwnPropertyDescriptor:function(e,t){return f(y(e),t)},getPrototypeOf:function(e){return m(y(e))},has:function(e,t){return t in e},isExtensible:function(e){return!!b(y(e))},ownKeys:e("./$.own-keys"),preventExtensions:n(Object.preventExtensions||i.it),set:l};a&&(v.setPrototypeOf=function(e,t){return a(y(e),t),!0}),s(s.G,{Reflect:{}}),s(s.S,"Reflect",v)},{"./$":223,"./$.assert":212,"./$.ctx":218,"./$.def":219,"./$.iter":222,"./$.own-keys":225,"./$.set-proto":228,"./$.uid":232}],269:[function(e){var t=e("./$"),n=e("./$.cof"),r=t.g.RegExp,l=r,i=r.prototype;t.FW&&t.DESC&&(function(){try{return"/a/i"==r(/a/g,"i")}catch(e){}}()||(r=function(e,t){return new l("RegExp"==n(e)&&void 0!==t?e.source:e,t)},t.each.call(t.getNames(l),function(e){e in r||t.setDesc(r,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})}),i.constructor=r,r.prototype=i,t.hide(t.g,"RegExp",r)),"g"!=/./g.flags&&t.setDesc(i,"flags",{configurable:!0,get:e("./$.replacer")(/^.*\/(\w*)$/,"$1")})),e("./$.species")(r)},{"./$":223,"./$.cof":214,"./$.replacer":227,"./$.species":229}],270:[function(e){"use strict";var t=e("./$.collection-strong");e("./$.collection")("Set",{add:function(e){return t.def(this,e=0===e?0:e,e)}},t)},{"./$.collection":217,"./$.collection-strong":215}],271:[function(e){var t=e("./$.def");t(t.P,"String",{codePointAt:e("./$.string-at")(!1)})},{"./$.def":219,"./$.string-at":230}],272:[function(e){"use strict";var t=e("./$"),n=e("./$.cof"),r=e("./$.def"),l=t.toLength;r(r.P,"String",{endsWith:function(e){if("RegExp"==n(e))throw TypeError();var r=String(t.assertDefined(this)),i=arguments[1],s=l(r.length),a=void 0===i?s:Math.min(l(i),s);return e+="",r.slice(a-e.length,a)===e}})},{"./$":223,"./$.cof":214,"./$.def":219}],273:[function(e){var t=e("./$.def"),n=e("./$").toIndex,r=String.fromCharCode;t(t.S,"String",{fromCodePoint:function(){for(var e,t=[],l=arguments.length,i=0;l>i;){if(e=+arguments[i++],n(e,1114111)!==e)throw RangeError(e+" is not a valid code point");t.push(65536>e?r(e):r(((e-=65536)>>10)+55296,e%1024+56320))}return t.join("")}})},{"./$":223,"./$.def":219}],274:[function(e){"use strict";var t=e("./$"),n=e("./$.cof"),r=e("./$.def");r(r.P,"String",{includes:function(e){if("RegExp"==n(e))throw TypeError();return!!~String(t.assertDefined(this)).indexOf(e,arguments[1])}})},{"./$":223,"./$.cof":214,"./$.def":219}],275:[function(e){var t=e("./$").set,n=e("./$.string-at")(!0),r=e("./$.uid").safe("iter"),l=e("./$.iter"),i=l.step;l.std(String,"String",function(e){t(this,r,{o:String(e),i:0})},function(){var e,t=this[r],l=t.o,s=t.i;return s>=l.length?i(1):(e=n.call(l,s),t.i+=e.length,i(0,e))})},{"./$":223,"./$.iter":222,"./$.string-at":230,"./$.uid":232}],276:[function(e){var t=e("./$"),n=e("./$.def");n(n.S,"String",{raw:function(e){for(var n=t.toObject(e.raw),r=t.toLength(n.length),l=arguments.length,i=[],s=0;r>s;)i.push(String(n[s++])),l>s&&i.push(String(arguments[s]));return i.join("")}})},{"./$":223,"./$.def":219}],277:[function(e){"use strict";var t=e("./$"),n=e("./$.def");n(n.P,"String",{repeat:function(e){var n=String(t.assertDefined(this)),r="",l=t.toInteger(e);if(0>l||1/0==l)throw RangeError("Count can't be negative");for(;l>0;(l>>>=1)&&(n+=n))1&l&&(r+=n);return r}})},{"./$":223,"./$.def":219}],278:[function(e){"use strict";var t=e("./$"),n=e("./$.cof"),r=e("./$.def");r(r.P,"String",{startsWith:function(e){if("RegExp"==n(e))throw TypeError();var r=String(t.assertDefined(this)),l=t.toLength(Math.min(arguments[1],r.length));return e+="",r.slice(l,l+e.length)===e}})},{"./$":223,"./$.cof":214,"./$.def":219}],279:[function(e){"use strict";function t(e){var t=m[e]=n.set(n.create(p.prototype),f,e);return n.DESC&&d&&n.setDesc(Object.prototype,e,{configurable:!0,set:function(t){a(this,e,t)}}),t}var n=e("./$"),r=e("./$.cof").set,l=e("./$.uid"),i=e("./$.def"),s=n.has,a=n.hide,o=n.getNames,u=n.toObject,p=n.g.Symbol,c=p,d=!1,f=l.safe("tag"),h={},m={};n.isFunction(p)||(p=function(e){if(this instanceof p)throw TypeError("Symbol is not a constructor");return t(l(e))},a(p.prototype,"toString",function(){return this[f]})),i(i.G+i.W,{Symbol:p});var g={"for":function(e){return s(h,e+="")?h[e]:h[e]=p(e)},keyFor:e("./$.partial").call(e("./$.keyof"),h,0),pure:l.safe,set:n.set,useSetter:function(){d=!0},useSimple:function(){d=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(n){var r=e("./$.wks")(n);g[n]=p===c?r:t(r)}),d=!0,i(i.S,"Symbol",g),i(i.S+i.F*(p!=c),"Object",{getOwnPropertyNames:function(e){for(var t,n=o(u(e)),r=[],l=0;n.length>l;)s(m,t=n[l++])||r.push(t);return r},getOwnPropertySymbols:function(e){for(var t,n=o(u(e)),r=[],l=0;n.length>l;)s(m,t=n[l++])&&r.push(m[t]);return r}}),r(p,"Symbol"),r(Math,"Math",!0),r(n.g.JSON,"JSON",!0)},{"./$":223,"./$.cof":214,"./$.def":219,"./$.keyof":224,"./$.partial":226,"./$.uid":232,"./$.wks":234}],280:[function(e){"use strict";var t=e("./$"),n=e("./$.collection-weak"),r=n.leakStore,l=n.ID,i=n.WEAK,s=t.has,a=t.isObject,o=Object.isFrozen||t.core.Object.isFrozen,u={},p=e("./$.collection")("WeakMap",{get:function(e){if(a(e)){if(o(e))return r(this).get(e);if(s(e,i))return e[i][this[l]]}},set:function(e,t){return n.def(this,e,t)}},n,!0,!0);t.FW&&7!=(new p).set((Object.freeze||Object)(u),7).get(u)&&t.each.call(["delete","has","get","set"],function(e){var t=p.prototype[e];p.prototype[e]=function(n,l){if(a(n)&&o(n)){var i=r(this)[e](n,l);return"set"==e?this:i}return t.call(this,n,l)}})},{"./$":223,"./$.collection":217,"./$.collection-weak":216}],281:[function(e){"use strict";var t=e("./$.collection-weak");e("./$.collection")("WeakSet",{add:function(e){return t.def(this,e,!0)}},t,!1,!0)},{"./$.collection":217,"./$.collection-weak":216}],282:[function(e){var t=e("./$.def");t(t.P,"Array",{includes:e("./$.array-includes")(!0)}),e("./$.unscope")("includes")},{"./$.array-includes":210,"./$.def":219,"./$.unscope":233}],283:[function(e){var t=e("./$"),n=e("./$.def"),r=e("./$.own-keys");n(n.S,"Object",{getOwnPropertyDescriptors:function(e){var n=t.toObject(e),l={};return t.each.call(r(n),function(e){t.setDesc(l,e,t.desc(0,t.getDesc(n,e)))}),l}})},{"./$":223,"./$.def":219,"./$.own-keys":225}],284:[function(e){function t(e){return function(t){var r,l=n.toObject(t),i=n.getKeys(t),s=i.length,a=0,o=Array(s);if(e)for(;s>a;)o[a]=[r=i[a++],l[r]];else for(;s>a;)o[a]=l[i[a++]];return o}}var n=e("./$"),r=e("./$.def");r(r.S,"Object",{values:t(!1),entries:t(!0)})},{"./$":223,"./$.def":219}],285:[function(e){var t=e("./$.def");t(t.S,"RegExp",{escape:e("./$.replacer")(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",!0)})},{"./$.def":219,"./$.replacer":227}],286:[function(e){var t=e("./$.def");t(t.P,"String",{at:e("./$.string-at")(!0)})},{"./$.def":219,"./$.string-at":230}],287:[function(e){function t(t,r){n.each.call(t.split(","),function(t){void 0==r&&t in l.Array?i[t]=l.Array[t]:t in[]&&(i[t]=e("./$.ctx")(Function.call,[][t],r))})}var n=e("./$"),r=e("./$.def"),l=n.core,i={};t("pop,reverse,shift,keys,values,entries",1),t("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),t("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill,turn"),r(r.S,"Array",i)},{"./$":223,"./$.ctx":218,"./$.def":219}],288:[function(e){e("./es6.array.iterator");var t=e("./$"),n=e("./$.iter").Iterators,r=e("./$.wks")("iterator"),l=t.g.NodeList;!t.FW||!l||r in l.prototype||t.hide(l.prototype,r,n.Array),n.NodeList=n.Array},{"./$":223,"./$.iter":222,"./$.wks":234,"./es6.array.iterator":254}],289:[function(e){var t=e("./$.def"),n=e("./$.task");t(t.G+t.B,{setImmediate:n.set,clearImmediate:n.clear})},{"./$.def":219,"./$.task":231}],290:[function(e){function t(e){return s?function(t,r){return e(l(i,[].slice.call(arguments,2),n.isFunction(t)?t:Function(t)),r)}:e}var n=e("./$"),r=e("./$.def"),l=e("./$.invoke"),i=e("./$.partial"),s=!!n.g.navigator&&/MSIE .\./.test(navigator.userAgent);r(r.G+r.B+r.F*s,{setTimeout:t(setTimeout),setInterval:t(setInterval)})},{"./$":223,"./$.def":219,"./$.invoke":221,"./$.partial":226}],291:[function(e,t){e("./modules/es5"),e("./modules/es6.symbol"),e("./modules/es6.object.assign"),e("./modules/es6.object.is"),e("./modules/es6.object.set-prototype-of"),e("./modules/es6.object.to-string"),e("./modules/es6.object.statics-accept-primitives"),e("./modules/es6.function.name"),e("./modules/es6.number.constructor"),e("./modules/es6.number.statics"),e("./modules/es6.math"),e("./modules/es6.string.from-code-point"),e("./modules/es6.string.raw"),e("./modules/es6.string.iterator"),e("./modules/es6.string.code-point-at"),e("./modules/es6.string.ends-with"),e("./modules/es6.string.includes"),e("./modules/es6.string.repeat"),e("./modules/es6.string.starts-with"),e("./modules/es6.array.from"),e("./modules/es6.array.of"),e("./modules/es6.array.iterator"),e("./modules/es6.array.species"),e("./modules/es6.array.copy-within"),e("./modules/es6.array.fill"),e("./modules/es6.array.find"),e("./modules/es6.array.find-index"),e("./modules/es6.regexp"),e("./modules/es6.promise"),e("./modules/es6.map"),e("./modules/es6.set"),e("./modules/es6.weak-map"),e("./modules/es6.weak-set"),e("./modules/es6.reflect"),e("./modules/es7.array.includes"),e("./modules/es7.string.at"),e("./modules/es7.regexp.escape"),e("./modules/es7.object.get-own-property-descriptors"),e("./modules/es7.object.to-array"),e("./modules/js.array.statics"),e("./modules/web.timers"),e("./modules/web.immediate"),e("./modules/web.dom.iterable"),t.exports=e("./modules/$").core},{"./modules/$":223,"./modules/es5":248,"./modules/es6.array.copy-within":249,"./modules/es6.array.fill":250,"./modules/es6.array.find":252,"./modules/es6.array.find-index":251,"./modules/es6.array.from":253,"./modules/es6.array.iterator":254,"./modules/es6.array.of":255,"./modules/es6.array.species":256,"./modules/es6.function.name":257,"./modules/es6.map":258,"./modules/es6.math":259,"./modules/es6.number.constructor":260,"./modules/es6.number.statics":261,"./modules/es6.object.assign":262,"./modules/es6.object.is":263,"./modules/es6.object.set-prototype-of":264,"./modules/es6.object.statics-accept-primitives":265,"./modules/es6.object.to-string":266,"./modules/es6.promise":267,"./modules/es6.reflect":268,"./modules/es6.regexp":269,"./modules/es6.set":270,"./modules/es6.string.code-point-at":271,"./modules/es6.string.ends-with":272,"./modules/es6.string.from-code-point":273,"./modules/es6.string.includes":274,"./modules/es6.string.iterator":275,"./modules/es6.string.raw":276,"./modules/es6.string.repeat":277,"./modules/es6.string.starts-with":278,"./modules/es6.symbol":279,"./modules/es6.weak-map":280,"./modules/es6.weak-set":281,"./modules/es7.array.includes":282,"./modules/es7.object.get-own-property-descriptors":283,"./modules/es7.object.to-array":284,"./modules/es7.regexp.escape":285,"./modules/es7.string.at":286,"./modules/js.array.statics":287,"./modules/web.dom.iterable":288,"./modules/web.immediate":289,"./modules/web.timers":290}],292:[function(e,t,n){function r(){return n.colors[p++%n.colors.length]}function l(e){function t(){}function l(){var e=l,t=+new Date,i=t-(u||t);e.diff=i,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var l=n.formatters[r];if("function"==typeof l){var i=s[a];t=l.call(e,i),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var o=l.log||n.log||console.log.bind(console);o.apply(e,s)}t.enabled=!1,l.enabled=!0;var i=n.enabled(e)?l:t;return i.namespace=e,i}function i(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,l=0;r>l;l++)t[l]&&(e=t[l].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function s(){n.enable("")}function a(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function o(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=l,n.coerce=o,n.disable=s,n.enable=i,n.enabled=a,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var u,p=0},{ms:294}],293:[function(e,t,n){(function(r){function l(){var e=(r.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?p.isatty(d):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e}function i(){var e=arguments,t=this.useColors,r=this.namespace;if(t){var l=this.color;e[0]=" [9"+l+"m"+r+" "+e[0]+"[3"+l+"m +"+n.humanize(this.diff)+""}else e[0]=(new Date).toUTCString()+" "+r+" "+e[0];return e}function s(){return f.write(c.format.apply(this,arguments)+"\n")}function a(e){null==e?delete r.env.DEBUG:r.env.DEBUG=e}function o(){return r.env.DEBUG}function u(t){var n,l=r.binding("tty_wrap");switch(l.guessHandleType(t)){case"TTY":n=new p.WriteStream(t),n._type="tty",n._handle&&n._handle.unref&&n._handle.unref();break;case"FILE":var i=e("fs");n=new i.SyncWriteStream(t,{autoClose:!1}),n._type="fs";break;case"PIPE":case"TCP":var s=e("net");n=new s.Socket({fd:t,readable:!1,writable:!0}),n.readable=!1,n.read=null,n._type="pipe",n._handle&&n._handle.unref&&n._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return n.fd=t,n._isStdio=!0,n}var p=e("tty"),c=e("util");n=t.exports=e("./debug"),n.log=s,n.formatArgs=i,n.save=a,n.load=o,n.useColors=l,n.colors=[6,2,3,4,5,1];var d=parseInt(r.env.DEBUG_FD,10)||2,f=1===d?r.stdout:2===d?r.stderr:u(d),h=4===c.inspect.length?function(e,t){return c.inspect(e,void 0,void 0,t)}:function(e,t){return c.inspect(e,{colors:t})};n.formatters.o=function(e){return h(e,this.useColors).replace(/\s*\n\s*/g," ")},n.enable(o())}).call(this,e("_process"))},{"./debug":292,_process:183,fs:172,net:172,tty:197,util:199}],294:[function(e,t){function n(e){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*o;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=o?Math.round(e/o)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function l(e){return i(e,u,"day")||i(e,o,"hour")||i(e,a,"minute")||i(e,s,"second")||e+" ms"}function i(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,a=60*s,o=60*a,u=24*o,p=365.25*u;t.exports=function(e,t){return t=t||{},"string"==typeof e?n(e):t.long?l(e):r(e)}},{}],295:[function(e,t){"use strict";function n(e){var t=0,n=0,r=0;for(var l in e){var i=e[l],s=i[0],a=i[1];(s>n||s===n&&a>r)&&(n=s,r=a,t=+l)}return t}var r=e("repeating"),l=/^(?:( )+|\t+)/;t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var t,i,s=0,a=0,o=0,u={};e.split(/\n/g).forEach(function(e){if(e){var n,r=e.match(l);r?(n=r[0].length,r[1]?a++:s++):n=0;var p=n-o;o=n,p?(i=p>0,t=u[i?p:-p],t?t[0]++:t=u[p]=[1,0]):t&&(t[1]+=+i)}});var p,c,d=n(u);return d?a>=s?(p="space",c=r(" ",d)):(p="tab",c=r(" ",d)):(p=null,c=""),{amount:d,type:p,indent:c}}},{repeating:435}],296:[function(t,n,r){!function(t,n){"use strict";"function"==typeof e&&e.amd?e(["exports"],n):n("undefined"!=typeof r?r:t.estraverse={})}(this,function l(e){"use strict";function t(){}function n(e){var t,r,l={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],l[t]="object"==typeof r&&null!==r?n(r):r);return l}function r(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function i(e,t){var n,r,l,i;for(r=e.length,l=0;r;)n=r>>>1,i=l+n,t(e[i])?r=n:(l=i+1,r-=n+1);return l}function s(e,t){var n,r,l,i;for(r=e.length,l=0;r;)n=r>>>1,i=l+n,t(e[i])?(l=i+1,r-=n+1):r=n;return l}function a(e,t){var n,r,l,i=_(t);for(r=0,l=i.length;l>r;r+=1)n=i[r],e[n]=t[n];return e}function o(e,t){this.parent=e,this.key=t}function u(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function p(){}function c(e){return null==e?!1:"object"==typeof e&&"string"==typeof e.type}function d(e,t){return(e===y.ObjectExpression||e===y.ObjectPattern)&&"properties"===t}function f(e,t){var n=new p;return n.traverse(e,t)}function h(e,t){var n=new p;return n.replace(e,t)}function m(e,t){var n;return n=i(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),n-=1,n>=0&&(e.extendedRange[0]=t[n].range[1]),e }function g(e,t,r){var l,i,s,a,o=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(s=0,i=t.length;i>s;s+=1)l=n(t[s]),l.extendedRange=[0,e.range[0]],o.push(l);e.leadingComments=o}return e}for(s=0,i=t.length;i>s;s+=1)o.push(m(n(t[s]),r));return a=0,f(e,{enter:function(e){for(var t;a<o.length&&(t=o[a],!(t.extendedRange[1]>e.range[0]));)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),o.splice(a,1)):a+=1;return a===o.length?v.Break:o[a].extendedRange[0]>e.range[1]?v.Skip:void 0}}),a=0,f(e,{leave:function(e){for(var t;a<o.length&&(t=o[a],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),o.splice(a,1)):a+=1;return a===o.length?v.Break:o[a].extendedRange[0]>e.range[1]?v.Skip:void 0}}),e}var y,b,v,x,E,_,S,I,w;return b=Array.isArray,b||(b=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t(r),t(s),E=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}(),_=Object.keys||function(e){var t,n=[];for(t in e)n.push(t);return n},y={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},x={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},S={},I={},w={},v={Break:S,Skip:I,Remove:w},o.prototype.replace=function(e){this.parent[this.key]=e},o.prototype.remove=function(){return b(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){function e(e,t){if(b(t))for(r=0,l=t.length;l>r;++r)e.push(t[r]);else e.push(t)}var t,n,r,l,i,s;if(!this.__current.path)return null;for(i=[],t=2,n=this.__leavelist.length;n>t;++t)s=this.__leavelist[t],e(i,s.path);return e(i,this.__current.path),i},p.prototype.type=function(){var e=this.current();return e.type||this.__current.wrap},p.prototype.parents=function(){var e,t,n;for(n=[],e=1,t=this.__leavelist.length;t>e;++e)n.push(this.__leavelist[e].node);return n},p.prototype.current=function(){return this.__current.node},p.prototype.__execute=function(e,t){var n,r;return r=void 0,n=this.__current,this.__current=t,this.__state=null,e&&(r=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=n,r},p.prototype.notify=function(e){this.__state=e},p.prototype.skip=function(){this.notify(I)},p.prototype["break"]=function(){this.notify(S)},p.prototype.remove=function(){this.notify(w)},p.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback="iteration"===t.fallback,this.__keys=x,t.keys&&(this.__keys=a(E(this.__keys),t.keys))},p.prototype.traverse=function(e,t){var n,r,l,i,s,a,o,p,f,h,m,g;for(this.__initialize(e,t),g={},n=this.__worklist,r=this.__leavelist,n.push(new u(e,null,null,null)),r.push(new u(null,null,null,null));n.length;)if(l=n.pop(),l!==g){if(l.node){if(a=this.__execute(t.enter,l),this.__state===S||a===S)return;if(n.push(g),r.push(l),this.__state===I||a===I)continue;if(i=l.node,s=l.wrap||i.type,h=this.__keys[s],!h){if(!this.__fallback)throw new Error("Unknown node type "+s+".");h=_(i)}for(p=h.length;(p-=1)>=0;)if(o=h[p],m=i[o])if(b(m)){for(f=m.length;(f-=1)>=0;)if(m[f]){if(d(s,h[p]))l=new u(m[f],[o,f],"Property",null);else{if(!c(m[f]))continue;l=new u(m[f],[o,f],null,null)}n.push(l)}}else c(m)&&n.push(new u(m,o,null,null))}}else if(l=r.pop(),a=this.__execute(t.leave,l),this.__state===S||a===S)return},p.prototype.replace=function(e,t){function n(e){var t,n,l,i;if(e.ref.remove())for(n=e.ref.key,i=e.ref.parent,t=r.length;t--;)if(l=r[t],l.ref&&l.ref.parent===i){if(l.ref.key<n)break;--l.ref.key}}var r,l,i,s,a,p,f,h,m,g,y,v,x;for(this.__initialize(e,t),y={},r=this.__worklist,l=this.__leavelist,v={root:e},p=new u(e,null,null,new o(v,"root")),r.push(p),l.push(p);r.length;)if(p=r.pop(),p!==y){if(a=this.__execute(t.enter,p),void 0!==a&&a!==S&&a!==I&&a!==w&&(p.ref.replace(a),p.node=a),(this.__state===w||a===w)&&(n(p),p.node=null),this.__state===S||a===S)return v.root;if(i=p.node,i&&(r.push(y),l.push(p),this.__state!==I&&a!==I)){if(s=p.wrap||i.type,m=this.__keys[s],!m){if(!this.__fallback)throw new Error("Unknown node type "+s+".");m=_(i)}for(f=m.length;(f-=1)>=0;)if(x=m[f],g=i[x])if(b(g)){for(h=g.length;(h-=1)>=0;)if(g[h]){if(d(s,m[f]))p=new u(g[h],[x,h],"Property",new o(g,h));else{if(!c(g[h]))continue;p=new u(g[h],[x,h],null,new o(g,h))}r.push(p)}}else c(g)&&r.push(new u(g,x,null,new o(i,x)))}}else if(p=l.pop(),a=this.__execute(t.leave,p),void 0!==a&&a!==S&&a!==I&&a!==w&&p.ref.replace(a),(this.__state===w||a===w)&&n(p),this.__state===S||a===S)return v.root;return v.root},e.version="1.8.1-dev",e.Syntax=y,e.traverse=f,e.replace=h,e.attachComments=g,e.VisitorKeys=x,e.VisitorOption=v,e.Controller=p,e.cloneEnvironment=function(){return l({})},e})},{}],297:[function(e,t){!function(){"use strict";function e(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function n(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function r(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function l(e){return r(e)||null!=e&&"FunctionDeclaration"===e.type}function i(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function s(e){var t;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;t=e.consequent;do{if("IfStatement"===t.type&&null==t.alternate)return!0;t=i(t)}while(t);return!1}t.exports={isExpression:e,isStatement:r,isIterationStatement:n,isSourceElement:l,isProblematicIfStatement:s,trailingStatement:i}}()},{}],298:[function(e,t){!function(){"use strict";function e(e){return e>=48&&57>=e}function n(t){return e(t)||t>=97&&102>=t||t>=65&&70>=t}function r(e){return e>=48&&55>=e}function l(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&u.indexOf(e)>=0}function i(e){return 10===e||13===e||8232===e||8233===e}function s(e){return e>=97&&122>=e||e>=65&&90>=e||36===e||95===e||92===e||e>=128&&o.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function a(e){return e>=97&&122>=e||e>=65&&90>=e||e>=48&&57>=e||36===e||95===e||92===e||e>=128&&o.NonAsciiIdentifierPart.test(String.fromCharCode(e))}var o,u;o={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},u=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],t.exports={isDecimalDigit:e,isHexDigit:n,isOctalDigit:r,isWhiteSpace:l,isLineTerminator:i,isIdentifierStart:s,isIdentifierPart:a}}()},{}],299:[function(e,t){!function(){"use strict";function n(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function r(e,t){return t||"yield"!==e?l(e,t):!1}function l(e,t){if(t&&n(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function i(e,t){return"null"===e||"true"===e||"false"===e||r(e,t)}function s(e,t){return"null"===e||"true"===e||"false"===e||l(e,t)}function a(e){return"eval"===e||"arguments"===e}function o(e){var t,n,r;if(0===e.length)return!1;if(r=e.charCodeAt(0),!c.isIdentifierStart(r)||92===r)return!1;for(t=1,n=e.length;n>t;++t)if(r=e.charCodeAt(t),!c.isIdentifierPart(r)||92===r)return!1;return!0}function u(e,t){return o(e)&&!i(e,t)}function p(e,t){return o(e)&&!s(e,t)}var c=e("./code");t.exports={isKeywordES5:r,isKeywordES6:l,isReservedWordES5:i,isReservedWordES6:s,isRestrictedWord:a,isIdentifierName:o,isIdentifierES5:u,isIdentifierES6:p}}()},{"./code":298}],300:[function(e,t,n){!function(){"use strict";n.ast=e("./ast"),n.code=e("./code"),n.keyword=e("./keyword")}()},{"./ast":297,"./code":298,"./keyword":299}],301:[function(e,t){t.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},nonstandard:{escape:!1,unescape:!1},browser:{addEventListener:!1,alert:!1,applicationCache:!1,atob:!1,Audio:!1,AudioProcessingEvent:!1,BeforeUnloadEvent:!1,Blob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,crypto:!1,CSS:!1,CustomEvent:!1,DataView:!1,Debug:!1,defaultStatus:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DOMParser:!1,DragEvent:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FormData:!1,frameElement:!1,frames:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,history:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,Intl:!1,KeyboardEvent:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,navigator:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProgressEvent:!1,prompt:!1,Range:!1,removeEventListener:!1,requestAnimationFrame:!1,resizeBy:!1,resizeTo:!1,screen:!1,screenX:!1,screenY:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,self:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,showModalDialog:!1,status:!1,stop:!1,StorageEvent:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,TouchEvent:!1,UIEvent:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},worker:{importScripts:!0,postMessage:!0,self:!0},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,DataView:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,target:!1,tempdir:!1,test:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,ObjectId:!1,PlanCache:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1}}},{}],302:[function(e,t){t.exports=e("./globals.json")},{"./globals.json":301}],303:[function(e,t){var n=e("is-nan"),r=e("is-finite");t.exports=Number.isInteger||function(e){return"number"==typeof e&&!n(e)&&r(e)&&parseInt(e,10)===e}},{"is-finite":304,"is-nan":305}],304:[function(e,t){"use strict";t.exports=Number.isFinite||function(e){return"number"!=typeof e||e!==e||1/0===e||e===-1/0?!1:!0}},{}],305:[function(e,t){"use strict";t.exports=function(e){return e!==e}},{}],306:[function(e,t){t.exports=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|((?:0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?))|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]{1,6}\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-*\/%&|^]|<{1,2}|>{1,3}|!=?|={1,2})=?|[?:~]|[;,.[\](){}])|(\s+)|(^$|[\s\S])/g,t.exports.matchToToken=function(e){return token={type:"invalid",value:e[0]},e[1]?(token.type="string",token.closed=!(!e[3]&&!e[4])):e[5]?token.type="comment":e[6]?(token.type="comment",token.closed=!!e[7]):e[8]?token.type="regex":e[9]?token.type="number":e[10]?token.type="name":e[11]?token.type="punctuator":e[12]&&(token.type="whitespace"),token}},{}],307:[function(e,t){var n=[],r=[];t.exports=function(e,t){if(e===t)return 0;var l=e.length,i=t.length;if(0===l)return i;if(0===i)return l;for(var s,a,o,u,p=0,c=0;l>p;)r[p]=e.charCodeAt(p),n[p]=++p;for(;i>c;)for(s=t.charCodeAt(c),o=c++,a=c,p=0;l>p;p++)u=s===r[p]?o:o+1,o=n[p],a=n[p]=o>a?u>a?a+1:u:u>o?o+1:u;return a}},{}],308:[function(e,t){function n(e,t,n){return t in e?e[t]:n}function r(e,t){var r=n.bind(null,t||{}),i=r("transform",Function.prototype),s=r("padding"," "),a=r("before"," "),o=r("after"," | "),u=r("start",1),p=Array.isArray(e),c=p?e:e.split("\n"),d=u+c.length-1,f=String(d).length,h=c.map(function(e,t){var n=u+t,r={before:a,number:n,width:f,after:o,line:e};return i(r),r.before+l(r.number,f,s)+r.after+r.line});return p?h:h.join("\n")}var l=e("left-pad");t.exports=r},{"left-pad":309}],309:[function(e,t){function n(e,t,n){e=String(e);var r=-1;for(n||(n=" "),t-=e.length;++r<t;)e=n+e;return e}t.exports=n},{}],310:[function(e,t){function n(e){for(var t=-1,n=e?e.length:0,r=-1,l=[];++t<n;){var i=e[t];i&&(l[++r]=i)}return l}t.exports=n},{}],311:[function(e,t){function n(e,t,n){var i=e?e.length:0;return n&&l(e,t,n)&&(t=!1),i?r(e,t,!1,0):[]}var r=e("../internal/baseFlatten"),l=e("../internal/isIterateeCall");t.exports=n},{"../internal/baseFlatten":338,"../internal/isIterateeCall":379}],312:[function(e,t){function n(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=n},{}],313:[function(e,t){function n(){var e=arguments,t=e[0];if(!t||!t.length)return t;for(var n=0,l=r,s=e.length;++n<s;)for(var a=0,o=e[n];(a=l(t,o,a))>-1;)i.call(t,a,1);return t}var r=e("../internal/baseIndexOf"),l=Array.prototype,i=l.splice;t.exports=n},{"../internal/baseIndexOf":344}],314:[function(e,t){function n(e,t,n,a){var o=e?e.length:0;return o?(null!=t&&"boolean"!=typeof t&&(a=n,n=i(e,t,a)?null:t,t=!1),n=null==n?n:r(n,a,3),t?s(e,n):l(e,n)):[]}var r=e("../internal/baseCallback"),l=e("../internal/baseUniq"),i=e("../internal/isIterateeCall"),s=e("../internal/sortedUniq");t.exports=n},{"../internal/baseCallback":332,"../internal/baseUniq":360,"../internal/isIterateeCall":379,"../internal/sortedUniq":386}],315:[function(e,t){t.exports=e("./includes")},{"./includes":319}],316:[function(e,t){t.exports=e("./forEach")},{"./forEach":317}],317:[function(e,t){function n(e,t,n){return"function"==typeof t&&"undefined"==typeof n&&s(e)?r(e,t):l(e,i(t,n,3))}var r=e("../internal/arrayEach"),l=e("../internal/baseEach"),i=e("../internal/bindCallback"),s=e("../lang/isArray");t.exports=n},{"../internal/arrayEach":326,"../internal/baseEach":336,"../internal/bindCallback":362,"../lang/isArray":390}],318:[function(e,t){var n=e("../internal/createAggregator"),r=Object.prototype,l=r.hasOwnProperty,i=n(function(e,t,n){l.call(e,n)?e[n].push(t):e[n]=[t]});t.exports=i},{"../internal/createAggregator":367}],319:[function(e,t){function n(e,t,n){var u=e?e.length:0;return i(u)||(e=a(e),u=e.length),u?(n="number"==typeof n?0>n?o(u+n,0):n||0:0,"string"==typeof e||!l(e)&&s(e)?u>n&&e.indexOf(t,n)>-1:r(e,t,n)>-1):!1}var r=e("../internal/baseIndexOf"),l=e("../lang/isArray"),i=e("../internal/isLength"),s=e("../lang/isString"),a=e("../object/values"),o=Math.max;t.exports=n},{"../internal/baseIndexOf":344,"../internal/isLength":380,"../lang/isArray":390,"../lang/isString":399,"../object/values":409}],320:[function(e,t){function n(e,t,n){var a=s(e)?r:i;return t=l(t,n,3),a(e,t)}var r=e("../internal/arrayMap"),l=e("../internal/baseCallback"),i=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=n},{"../internal/arrayMap":327,"../internal/baseCallback":332,"../internal/baseMap":349,"../lang/isArray":390}],321:[function(e,t){function n(e,t,n,o){var u=a(e)?r:s;return u(e,l(t,o,4),n,arguments.length<3,i)}var r=e("../internal/arrayReduceRight"),l=e("../internal/baseCallback"),i=e("../internal/baseEachRight"),s=e("../internal/baseReduce"),a=e("../lang/isArray");t.exports=n},{"../internal/arrayReduceRight":328,"../internal/baseCallback":332,"../internal/baseEachRight":337,"../internal/baseReduce":355,"../lang/isArray":390}],322:[function(e,t){function n(e,t,n){var a=s(e)?r:i;return("function"!=typeof t||"undefined"!=typeof n)&&(t=l(t,n,3)),a(e,t)}var r=e("../internal/arraySome"),l=e("../internal/baseCallback"),i=e("../internal/baseSome"),s=e("../lang/isArray"); t.exports=n},{"../internal/arraySome":329,"../internal/baseCallback":332,"../internal/baseSome":357,"../lang/isArray":390}],323:[function(e,t){function n(e,t,n){if(null==e)return[];var u=-1,p=e.length,c=o(p)?Array(p):[];return n&&a(e,t,n)&&(t=null),t=r(t,n,3),l(e,function(e,n,r){c[++u]={criteria:t(e,n,r),index:u,value:e}}),i(c,s)}var r=e("../internal/baseCallback"),l=e("../internal/baseEach"),i=e("../internal/baseSortBy"),s=e("../internal/compareAscending"),a=e("../internal/isIterateeCall"),o=e("../internal/isLength");t.exports=n},{"../internal/baseCallback":332,"../internal/baseEach":336,"../internal/baseSortBy":358,"../internal/compareAscending":366,"../internal/isIterateeCall":379,"../internal/isLength":380}],324:[function(e,t){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:a(null),set:new s};t--;)this.push(e[t])}var l=e("./cachePush"),i=e("../lang/isNative"),s=i(s=n.Set)&&s,a=i(a=Object.create)&&a;r.prototype.push=l,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":394,"./cachePush":365}],325:[function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=n},{}],326:[function(e,t){function n(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n},{}],327:[function(e,t){function n(e,t){for(var n=-1,r=e.length,l=Array(r);++n<r;)l[n]=t(e[n],n,e);return l}t.exports=n},{}],328:[function(e,t){function n(e,t,n,r){var l=e.length;for(r&&l&&(n=e[--l]);l--;)n=t(n,e[l],l,e);return n}t.exports=n},{}],329:[function(e,t){function n(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n},{}],330:[function(e,t){function n(e,t){return"undefined"==typeof e?t:e}t.exports=n},{}],331:[function(e,t){function n(e,t,n){var i=l(t);if(!n)return r(t,e,i);for(var s=-1,a=i.length;++s<a;){var o=i[s],u=e[o],p=n(u,t[o],o,e,t);(p===p?p===u:u!==u)&&("undefined"!=typeof u||o in e)||(e[o]=p)}return e}var r=e("./baseCopy"),l=e("../object/keys");t.exports=n},{"../object/keys":406,"./baseCopy":335}],332:[function(e,t){function n(e,t,n){var u=typeof e;return"function"==u?"undefined"!=typeof t&&o(e)?s(e,t,n):e:null==e?a:"object"==u?r(e):"undefined"==typeof t?i(e+""):l(e+"",t)}var r=e("./baseMatches"),l=e("./baseMatchesProperty"),i=e("./baseProperty"),s=e("./bindCallback"),a=e("../utility/identity"),o=e("./isBindable");t.exports=n},{"../utility/identity":413,"./baseMatches":350,"./baseMatchesProperty":351,"./baseProperty":354,"./bindCallback":362,"./isBindable":377}],333:[function(e,t){function n(e,t,h,m,g,y,v){var x;if(h&&(x=g?h(e,m,g):h(e)),"undefined"!=typeof x)return x;if(!c(e))return e;var _=p(e);if(_){if(x=a(e),!t)return r(e,x)}else{var S=F.call(e),I=S==b;if(S!=E&&S!=f&&(!I||g))return R[S]?o(e,S,t):g?e:{};if(x=u(I?{}:e),!t)return i(e,x,d(e))}y||(y=[]),v||(v=[]);for(var w=y.length;w--;)if(y[w]==e)return v[w];return y.push(e),v.push(x),(_?l:s)(e,function(r,l){x[l]=n(r,t,h,l,e,y,v)}),x}var r=e("./arrayCopy"),l=e("./arrayEach"),i=e("./baseCopy"),s=e("./baseForOwn"),a=e("./initCloneArray"),o=e("./initCloneByTag"),u=e("./initCloneObject"),p=e("../lang/isArray"),c=e("../lang/isObject"),d=e("../object/keys"),f="[object Arguments]",h="[object Array]",m="[object Boolean]",g="[object Date]",y="[object Error]",b="[object Function]",v="[object Map]",x="[object Number]",E="[object Object]",_="[object RegExp]",S="[object Set]",I="[object String]",w="[object WeakMap]",k="[object ArrayBuffer]",A="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",j="[object Int16Array]",M="[object Int32Array]",P="[object Uint8Array]",L="[object Uint8ClampedArray]",O="[object Uint16Array]",D="[object Uint32Array]",R={};R[f]=R[h]=R[k]=R[m]=R[g]=R[A]=R[C]=R[T]=R[j]=R[M]=R[x]=R[E]=R[_]=R[I]=R[P]=R[L]=R[O]=R[D]=!0,R[y]=R[b]=R[v]=R[S]=R[w]=!1;var N=Object.prototype,F=N.toString;t.exports=n},{"../lang/isArray":390,"../lang/isObject":396,"../object/keys":406,"./arrayCopy":325,"./arrayEach":326,"./baseCopy":335,"./baseForOwn":341,"./initCloneArray":374,"./initCloneByTag":375,"./initCloneObject":376}],334:[function(e,t){function n(e,t){if(e!==t){var n=e===e,r=t===t;if(e>t||!n||"undefined"==typeof e&&r)return 1;if(t>e||!r||"undefined"==typeof t&&n)return-1}return 0}t.exports=n},{}],335:[function(e,t){function n(e,t,n){n||(n=t,t={});for(var r=-1,l=n.length;++r<l;){var i=n[r];t[i]=e[i]}return t}t.exports=n},{}],336:[function(e,t){function n(e,t){var n=e?e.length:0;if(!l(n))return r(e,t);for(var s=-1,a=i(e);++s<n&&t(a[s],s,a)!==!1;);return e}var r=e("./baseForOwn"),l=e("./isLength"),i=e("./toObject");t.exports=n},{"./baseForOwn":341,"./isLength":380,"./toObject":387}],337:[function(e,t){function n(e,t){var n=e?e.length:0;if(!l(n))return r(e,t);for(var s=i(e);n--&&t(s[n],n,s)!==!1;);return e}var r=e("./baseForOwnRight"),l=e("./isLength"),i=e("./toObject");t.exports=n},{"./baseForOwnRight":342,"./isLength":380,"./toObject":387}],338:[function(e,t){function n(e,t,a,o){for(var u=o-1,p=e.length,c=-1,d=[];++u<p;){var f=e[u];if(s(f)&&i(f.length)&&(l(f)||r(f))){t&&(f=n(f,t,a,0));var h=-1,m=f.length;for(d.length+=m;++h<m;)d[++c]=f[h]}else a||(d[++c]=f)}return d}var r=e("../lang/isArguments"),l=e("../lang/isArray"),i=e("./isLength"),s=e("./isObjectLike");t.exports=n},{"../lang/isArguments":389,"../lang/isArray":390,"./isLength":380,"./isObjectLike":381}],339:[function(e,t){function n(e,t,n){for(var l=-1,i=r(e),s=n(e),a=s.length;++l<a;){var o=s[l];if(t(i[o],o,i)===!1)break}return e}var r=e("./toObject");t.exports=n},{"./toObject":387}],340:[function(e,t){function n(e,t){return r(e,t,l)}var r=e("./baseFor"),l=e("../object/keysIn");t.exports=n},{"../object/keysIn":407,"./baseFor":339}],341:[function(e,t){function n(e,t){return r(e,t,l)}var r=e("./baseFor"),l=e("../object/keys");t.exports=n},{"../object/keys":406,"./baseFor":339}],342:[function(e,t){function n(e,t){return r(e,t,l)}var r=e("./baseForRight"),l=e("../object/keys");t.exports=n},{"../object/keys":406,"./baseForRight":343}],343:[function(e,t){function n(e,t,n){for(var l=r(e),i=n(e),s=i.length;s--;){var a=i[s];if(t(l[a],a,l)===!1)break}return e}var r=e("./toObject");t.exports=n},{"./toObject":387}],344:[function(e,t){function n(e,t,n){if(t!==t)return r(e,n);for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}var r=e("./indexOfNaN");t.exports=n},{"./indexOfNaN":373}],345:[function(e,t){function n(e,t,l,i,s,a){if(e===t)return 0!==e||1/e==1/t;var o=typeof e,u=typeof t;return"function"!=o&&"object"!=o&&"function"!=u&&"object"!=u||null==e||null==t?e!==e&&t!==t:r(e,t,n,l,i,s,a)}var r=e("./baseIsEqualDeep");t.exports=n},{"./baseIsEqualDeep":346}],346:[function(e,t){function n(e,t,n,c,h,m,g){var y=s(e),b=s(t),v=u,x=u;y||(v=f.call(e),v==o?v=p:v!=p&&(y=a(e))),b||(x=f.call(t),x==o?x=p:x!=p&&(b=a(t)));var E=v==p,_=x==p,S=v==x;if(S&&!y&&!E)return l(e,t,v);var I=E&&d.call(e,"__wrapped__"),w=_&&d.call(t,"__wrapped__");if(I||w)return n(I?e.value():e,w?t.value():t,c,h,m,g);if(!S)return!1;m||(m=[]),g||(g=[]);for(var k=m.length;k--;)if(m[k]==e)return g[k]==t;m.push(e),g.push(t);var A=(y?r:i)(e,t,n,c,h,m,g);return m.pop(),g.pop(),A}var r=e("./equalArrays"),l=e("./equalByTag"),i=e("./equalObjects"),s=e("../lang/isArray"),a=e("../lang/isTypedArray"),o="[object Arguments]",u="[object Array]",p="[object Object]",c=Object.prototype,d=c.hasOwnProperty,f=c.toString;t.exports=n},{"../lang/isArray":390,"../lang/isTypedArray":400,"./equalArrays":370,"./equalByTag":371,"./equalObjects":372}],347:[function(e,t){function n(e){return"function"==typeof e||!1}t.exports=n},{}],348:[function(e,t){function n(e,t,n,l,s){var a=t.length;if(null==e)return!a;for(var o=-1,u=!s;++o<a;)if(u&&l[o]?n[o]!==e[t[o]]:!i.call(e,t[o]))return!1;for(o=-1;++o<a;){var p=t[o];if(u&&l[o])var c=i.call(e,p);else{var d=e[p],f=n[o];c=s?s(d,f,p):void 0,"undefined"==typeof c&&(c=r(f,d,s,!0))}if(!c)return!1}return!0}var r=e("./baseIsEqual"),l=Object.prototype,i=l.hasOwnProperty;t.exports=n},{"./baseIsEqual":345}],349:[function(e,t){function n(e,t){var n=[];return r(e,function(e,r,l){n.push(t(e,r,l))}),n}var r=e("./baseEach");t.exports=n},{"./baseEach":336}],350:[function(e,t){function n(e){var t=i(e),n=t.length;if(1==n){var s=t[0],o=e[s];if(l(o))return function(e){return null!=e&&e[s]===o&&a.call(e,s)}}for(var u=Array(n),p=Array(n);n--;)o=e[t[n]],u[n]=o,p[n]=l(o);return function(e){return r(e,t,u,p)}}var r=e("./baseIsMatch"),l=e("./isStrictComparable"),i=e("../object/keys"),s=Object.prototype,a=s.hasOwnProperty;t.exports=n},{"../object/keys":406,"./baseIsMatch":348,"./isStrictComparable":382}],351:[function(e,t){function n(e,t){return l(t)?function(n){return null!=n&&n[e]===t}:function(n){return null!=n&&r(t,n[e],null,!0)}}var r=e("./baseIsEqual"),l=e("./isStrictComparable");t.exports=n},{"./baseIsEqual":345,"./isStrictComparable":382}],352:[function(e,t){function n(e,t,c,d,f){if(!o(e))return e;var h=a(t.length)&&(s(t)||p(t));return(h?r:l)(t,function(t,r,l){if(u(t))return d||(d=[]),f||(f=[]),i(e,l,r,n,c,d,f);var s=e[r],a=c?c(s,t,r,e,l):void 0,o="undefined"==typeof a;o&&(a=t),!h&&"undefined"==typeof a||!o&&(a===a?a===s:s!==s)||(e[r]=a)}),e}var r=e("./arrayEach"),l=e("./baseForOwn"),i=e("./baseMergeDeep"),s=e("../lang/isArray"),a=e("./isLength"),o=e("../lang/isObject"),u=e("./isObjectLike"),p=e("../lang/isTypedArray");t.exports=n},{"../lang/isArray":390,"../lang/isObject":396,"../lang/isTypedArray":400,"./arrayEach":326,"./baseForOwn":341,"./baseMergeDeep":353,"./isLength":380,"./isObjectLike":381}],353:[function(e,t){function n(e,t,n,p,c,d,f){for(var h=d.length,m=t[n];h--;)if(d[h]==m)return void(e[n]=f[h]);var g=e[n],y=c?c(g,m,n,e,t):void 0,b="undefined"==typeof y;b&&(y=m,s(m.length)&&(i(m)||o(m))?y=i(g)?g:g?r(g):[]:a(m)||l(m)?y=l(g)?u(g):a(g)?g:{}:b=!1),d.push(m),f.push(y),b?e[n]=p(y,m,c,d,f):(y===y?y!==g:g===g)&&(e[n]=y)}var r=e("./arrayCopy"),l=e("../lang/isArguments"),i=e("../lang/isArray"),s=e("./isLength"),a=e("../lang/isPlainObject"),o=e("../lang/isTypedArray"),u=e("../lang/toPlainObject");t.exports=n},{"../lang/isArguments":389,"../lang/isArray":390,"../lang/isPlainObject":397,"../lang/isTypedArray":400,"../lang/toPlainObject":401,"./arrayCopy":325,"./isLength":380}],354:[function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}t.exports=n},{}],355:[function(e,t){function n(e,t,n,r,l){return l(e,function(e,l,i){n=r?(r=!1,e):t(n,e,l,i)}),n}t.exports=n},{}],356:[function(e,t){var n=e("../utility/identity"),r=e("./metaMap"),l=r?function(e,t){return r.set(e,t),e}:n;t.exports=l},{"../utility/identity":413,"./metaMap":383}],357:[function(e,t){function n(e,t){var n;return r(e,function(e,r,l){return n=t(e,r,l),!n}),!!n}var r=e("./baseEach");t.exports=n},{"./baseEach":336}],358:[function(e,t){function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n},{}],359:[function(e,t){function n(e){return"string"==typeof e?e:null==e?"":e+""}t.exports=n},{}],360:[function(e,t){function n(e,t){var n=-1,s=r,a=e.length,o=!0,u=o&&a>=200,p=u?i():null,c=[];p?(s=l,o=!1):(u=!1,p=t?[]:c);e:for(;++n<a;){var d=e[n],f=t?t(d,n,e):d;if(o&&d===d){for(var h=p.length;h--;)if(p[h]===f)continue e;t&&p.push(f),c.push(d)}else s(p,f,0)<0&&((t||u)&&p.push(f),c.push(d))}return c}var r=e("./baseIndexOf"),l=e("./cacheIndexOf"),i=e("./createCache");t.exports=n},{"./baseIndexOf":344,"./cacheIndexOf":364,"./createCache":369}],361:[function(e,t){function n(e,t){for(var n=-1,r=t.length,l=Array(r);++n<r;)l[n]=e[t[n]];return l}t.exports=n},{}],362:[function(e,t){function n(e,t,n){if("function"!=typeof e)return r;if("undefined"==typeof t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,l){return e.call(t,n,r,l)};case 4:return function(n,r,l,i){return e.call(t,n,r,l,i)};case 5:return function(n,r,l,i,s){return e.call(t,n,r,l,i,s)}}return function(){return e.apply(t,arguments)}}var r=e("../utility/identity");t.exports=n},{"../utility/identity":413}],363:[function(e,t){(function(n){function r(e){return a.call(e,0)}var l=e("../utility/constant"),i=e("../lang/isNative"),s=i(s=n.ArrayBuffer)&&s,a=i(a=s&&new s(0).slice)&&a,o=Math.floor,u=i(u=n.Uint8Array)&&u,p=function(){try{var e=i(e=n.Float64Array)&&e,t=new e(new s(10),0,1)&&e}catch(r){}return t}(),c=p?p.BYTES_PER_ELEMENT:0;a||(r=s&&u?function(e){var t=e.byteLength,n=p?o(t/c):0,r=n*c,l=new s(t);if(n){var i=new p(l,0,n);i.set(new p(e,0,n))}return t!=r&&(i=new u(l,r),i.set(new u(e,r))),l}:l(null)),t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":394,"../utility/constant":412}],364:[function(e,t){function n(e,t){var n=e.data,l="string"==typeof t||r(t)?n.set.has(t):n.hash[t];return l?0:-1}var r=e("../lang/isObject");t.exports=n},{"../lang/isObject":396}],365:[function(e,t){function n(e){var t=this.data;"string"==typeof e||r(e)?t.set.add(e):t.hash[e]=!0}var r=e("../lang/isObject");t.exports=n},{"../lang/isObject":396}],366:[function(e,t){function n(e,t){return r(e.criteria,t.criteria)||e.index-t.index}var r=e("./baseCompareAscending");t.exports=n},{"./baseCompareAscending":334}],367:[function(e,t){function n(e,t){return function(n,s,a){var o=t?t():{};if(s=r(s,a,3),i(n))for(var u=-1,p=n.length;++u<p;){var c=n[u];e(o,c,s(c,u,n),n)}else l(n,function(t,n,r){e(o,t,s(t,n,r),r)});return o}}var r=e("./baseCallback"),l=e("./baseEach"),i=e("../lang/isArray");t.exports=n},{"../lang/isArray":390,"./baseCallback":332,"./baseEach":336}],368:[function(e,t){function n(e){return function(){var t=arguments,n=t.length,i=t[0];if(2>n||null==i)return i;var s=t[n-2],a=t[n-1],o=t[3];n>3&&"function"==typeof s?(s=r(s,a,5),n-=2):(s=n>2&&"function"==typeof a?a:null,n-=s?1:0),o&&l(t[1],t[2],o)&&(s=3==n?null:s,n=2);for(var u=0;++u<n;){var p=t[u];p&&e(i,p,s)}return i}}var r=e("./bindCallback"),l=e("./isIterateeCall");t.exports=n},{"./bindCallback":362,"./isIterateeCall":379}],369:[function(e,t){(function(n){var r=e("./SetCache"),l=e("../utility/constant"),i=e("../lang/isNative"),s=i(s=n.Set)&&s,a=i(a=Object.create)&&a,o=a&&s?function(e){return new r(e)}:l(null);t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":394,"../utility/constant":412,"./SetCache":324}],370:[function(e,t){function n(e,t,n,r,l,i,s){var a=-1,o=e.length,u=t.length,p=!0;if(o!=u&&!(l&&u>o))return!1;for(;p&&++a<o;){var c=e[a],d=t[a];if(p=void 0,r&&(p=l?r(d,c,a):r(c,d,a)),"undefined"==typeof p)if(l)for(var f=u;f--&&(d=t[f],!(p=c&&c===d||n(c,d,r,l,i,s))););else p=c&&c===d||n(c,d,r,l,i,s)}return!!p}t.exports=n},{}],371:[function(e,t){function n(e,t,n){switch(n){case r:case l:return+e==+t;case i:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case a:case o:return e==t+""}return!1}var r="[object Boolean]",l="[object Date]",i="[object Error]",s="[object Number]",a="[object RegExp]",o="[object String]";t.exports=n},{}],372:[function(e,t){function n(e,t,n,l,s,a,o){var u=r(e),p=u.length,c=r(t),d=c.length;if(p!=d&&!s)return!1;for(var f,h=-1;++h<p;){var m=u[h],g=i.call(t,m);if(g){var y=e[m],b=t[m];g=void 0,l&&(g=s?l(b,y,m):l(y,b,m)),"undefined"==typeof g&&(g=y&&y===b||n(y,b,l,s,a,o))}if(!g)return!1;f||(f="constructor"==m)}if(!f){var v=e.constructor,x=t.constructor;if(v!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x))return!1}return!0}var r=e("../object/keys"),l=Object.prototype,i=l.hasOwnProperty;t.exports=n},{"../object/keys":406}],373:[function(e,t){function n(e,t,n){for(var r=e.length,l=t+(n?0:-1);n?l--:++l<r;){var i=e[l];if(i!==i)return l}return-1}t.exports=n},{}],374:[function(e,t){function n(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&l.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var r=Object.prototype,l=r.hasOwnProperty;t.exports=n},{}],375:[function(e,t){function n(e,t,n){var x=e.constructor;switch(t){case u:return r(e);case l:case i:return new x(+e);case p:case c:case d:case f:case h:case m:case g:case y:case b:var E=e.buffer;return new x(n?r(E):E,e.byteOffset,e.length);case s:case o:return new x(e);case a:var _=new x(e.source,v.exec(e));_.lastIndex=e.lastIndex}return _}var r=e("./bufferClone"),l="[object Boolean]",i="[object Date]",s="[object Number]",a="[object RegExp]",o="[object String]",u="[object ArrayBuffer]",p="[object Float32Array]",c="[object Float64Array]",d="[object Int8Array]",f="[object Int16Array]",h="[object Int32Array]",m="[object Uint8Array]",g="[object Uint8ClampedArray]",y="[object Uint16Array]",b="[object Uint32Array]",v=/\w*$/;t.exports=n},{"./bufferClone":363}],376:[function(e,t){function n(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=n},{}],377:[function(e,t){function n(e){var t=!(i.funcNames?e.name:i.funcDecomp);if(!t){var n=o.call(e);i.funcNames||(t=!s.test(n)),t||(t=a.test(n)||l(e),r(e,t))}return t}var r=e("./baseSetData"),l=e("../lang/isNative"),i=e("../support"),s=/^\s*function[ \n\r\t]+\w/,a=/\bthis\b/,o=Function.prototype.toString;t.exports=n},{"../lang/isNative":394,"../support":411,"./baseSetData":356}],378:[function(e,t){function n(e,t){return e=+e,t=null==t?r:t,e>-1&&e%1==0&&t>e}var r=Math.pow(2,53)-1;t.exports=n},{}],379:[function(e,t){function n(e,t,n){if(!i(n))return!1;var s=typeof t;if("number"==s)var a=n.length,o=l(a)&&r(t,a);else o="string"==s&&t in n;if(o){var u=n[t];return e===e?e===u:u!==u}return!1}var r=e("./isIndex"),l=e("./isLength"),i=e("../lang/isObject");t.exports=n},{"../lang/isObject":396,"./isIndex":378,"./isLength":380}],380:[function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=Math.pow(2,53)-1;t.exports=n},{}],381:[function(e,t){function n(e){return e&&"object"==typeof e||!1}t.exports=n},{}],382:[function(e,t){function n(e){return e===e&&(0===e?1/e>0:!r(e))}var r=e("../lang/isObject");t.exports=n},{"../lang/isObject":396}],383:[function(e,t){(function(n){var r=e("../lang/isNative"),l=r(l=n.WeakMap)&&l,i=l&&new l;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":394}],384:[function(e,t){function n(e){var t;if(!l(e)||o.call(e)!=i||!a.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return r(e,function(e,t){n=t}),"undefined"==typeof n||a.call(e,n)}var r=e("./baseForIn"),l=e("./isObjectLike"),i="[object Object]",s=Object.prototype,a=s.hasOwnProperty,o=s.toString;t.exports=n},{"./baseForIn":340,"./isObjectLike":381}],385:[function(e,t){function n(e){for(var t=a(e),n=t.length,u=n&&e.length,c=u&&s(u)&&(l(e)||o.nonEnumArgs&&r(e)),d=-1,f=[];++d<n;){var h=t[d];(c&&i(h,u)||p.call(e,h))&&f.push(h)}return f}var r=e("../lang/isArguments"),l=e("../lang/isArray"),i=e("./isIndex"),s=e("./isLength"),a=e("../object/keysIn"),o=e("../support"),u=Object.prototype,p=u.hasOwnProperty;t.exports=n},{"../lang/isArguments":389,"../lang/isArray":390,"../object/keysIn":407,"../support":411,"./isIndex":378,"./isLength":380}],386:[function(e,t){function n(e,t){for(var n,r=-1,l=e.length,i=-1,s=[];++r<l;){var a=e[r],o=t?t(a,r,e):a;r&&n===o||(n=o,s[++i]=a)}return s}t.exports=n},{}],387:[function(e,t){function n(e){return r(e)?e:Object(e)}var r=e("../lang/isObject");t.exports=n},{"../lang/isObject":396}],388:[function(e,t){function n(e,t,n){return t="function"==typeof t&&l(t,n,1),r(e,!0,t)}var r=e("../internal/baseClone"),l=e("../internal/bindCallback");t.exports=n},{"../internal/baseClone":333,"../internal/bindCallback":362}],389:[function(e,t){function n(e){var t=l(e)?e.length:void 0;return r(t)&&a.call(e)==i||!1}var r=e("../internal/isLength"),l=e("../internal/isObjectLike"),i="[object Arguments]",s=Object.prototype,a=s.toString;t.exports=n},{"../internal/isLength":380,"../internal/isObjectLike":381}],390:[function(e,t){var n=e("../internal/isLength"),r=e("./isNative"),l=e("../internal/isObjectLike"),i="[object Array]",s=Object.prototype,a=s.toString,o=r(o=Array.isArray)&&o,u=o||function(e){return l(e)&&n(e.length)&&a.call(e)==i||!1};t.exports=u},{"../internal/isLength":380,"../internal/isObjectLike":381,"./isNative":394}],391:[function(e,t){function n(e){return e===!0||e===!1||r(e)&&s.call(e)==l||!1}var r=e("../internal/isObjectLike"),l="[object Boolean]",i=Object.prototype,s=i.toString;t.exports=n},{"../internal/isObjectLike":381}],392:[function(e,t){function n(e){if(null==e)return!0;var t=e.length;return s(t)&&(l(e)||o(e)||r(e)||a(e)&&i(e.splice))?!t:!u(e).length}var r=e("./isArguments"),l=e("./isArray"),i=e("./isFunction"),s=e("../internal/isLength"),a=e("../internal/isObjectLike"),o=e("./isString"),u=e("../object/keys");t.exports=n},{"../internal/isLength":380,"../internal/isObjectLike":381,"../object/keys":406,"./isArguments":389,"./isArray":390,"./isFunction":393,"./isString":399}],393:[function(e,t){(function(n){var r=e("../internal/baseIsFunction"),l=e("./isNative"),i="[object Function]",s=Object.prototype,a=s.toString,o=l(o=n.Uint8Array)&&o,u=r(/x/)||o&&!r(o)?function(e){return a.call(e)==i}:r;t.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../internal/baseIsFunction":347,"./isNative":394}],394:[function(e,t){function n(e){return null==e?!1:u.call(e)==i?p.test(o.call(e)):l(e)&&s.test(e)||!1}var r=e("../string/escapeRegExp"),l=e("../internal/isObjectLike"),i="[object Function]",s=/^\[object .+?Constructor\]$/,a=Object.prototype,o=Function.prototype.toString,u=a.toString,p=RegExp("^"+r(u).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=n},{"../internal/isObjectLike":381,"../string/escapeRegExp":410}],395:[function(e,t){function n(e){return"number"==typeof e||r(e)&&s.call(e)==l||!1}var r=e("../internal/isObjectLike"),l="[object Number]",i=Object.prototype,s=i.toString;t.exports=n},{"../internal/isObjectLike":381}],396:[function(e,t){function n(e){var t=typeof e;return"function"==t||e&&"object"==t||!1}t.exports=n},{}],397:[function(e,t){var n=e("./isNative"),r=e("../internal/shimIsPlainObject"),l="[object Object]",i=Object.prototype,s=i.toString,a=n(a=Object.getPrototypeOf)&&a,o=a?function(e){if(!e||s.call(e)!=l)return!1;var t=e.valueOf,i=n(t)&&(i=a(t))&&a(i);return i?e==i||a(e)==i:r(e)}:r;t.exports=o},{"../internal/shimIsPlainObject":384,"./isNative":394}],398:[function(e,t){function n(e){return r(e)&&s.call(e)==l||!1}var r=e("../internal/isObjectLike"),l="[object RegExp]",i=Object.prototype,s=i.toString;t.exports=n},{"../internal/isObjectLike":381}],399:[function(e,t){function n(e){return"string"==typeof e||r(e)&&s.call(e)==l||!1}var r=e("../internal/isObjectLike"),l="[object String]",i=Object.prototype,s=i.toString;t.exports=n},{"../internal/isObjectLike":381}],400:[function(e,t){function n(e){return l(e)&&r(e.length)&&C[j.call(e)]||!1}var r=e("../internal/isLength"),l=e("../internal/isObjectLike"),i="[object Arguments]",s="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",p="[object Function]",c="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",m="[object Set]",g="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",v="[object Float32Array]",x="[object Float64Array]",E="[object Int8Array]",_="[object Int16Array]",S="[object Int32Array]",I="[object Uint8Array]",w="[object Uint8ClampedArray]",k="[object Uint16Array]",A="[object Uint32Array]",C={};C[v]=C[x]=C[E]=C[_]=C[S]=C[I]=C[w]=C[k]=C[A]=!0,C[i]=C[s]=C[b]=C[a]=C[o]=C[u]=C[p]=C[c]=C[d]=C[f]=C[h]=C[m]=C[g]=C[y]=!1;var T=Object.prototype,j=T.toString;t.exports=n},{"../internal/isLength":380,"../internal/isObjectLike":381}],401:[function(e,t){function n(e){return r(e,l(e))}var r=e("../internal/baseCopy"),l=e("../object/keysIn");t.exports=n},{"../internal/baseCopy":335,"../object/keysIn":407}],402:[function(e,t){var n=e("../internal/baseAssign"),r=e("../internal/createAssigner"),l=r(n);t.exports=l},{"../internal/baseAssign":331,"../internal/createAssigner":368}],403:[function(e,t){function n(e){if(null==e)return e;var t=r(arguments);return t.push(i),l.apply(void 0,t)}var r=e("../internal/arrayCopy"),l=e("./assign"),i=e("../internal/assignDefaults");t.exports=n},{"../internal/arrayCopy":325,"../internal/assignDefaults":330,"./assign":402}],404:[function(e,t){t.exports=e("./assign")},{"./assign":402}],405:[function(e,t){function n(e,t){return e?l.call(e,t):!1}var r=Object.prototype,l=r.hasOwnProperty;t.exports=n},{}],406:[function(e,t){var n=e("../internal/isLength"),r=e("../lang/isNative"),l=e("../lang/isObject"),i=e("../internal/shimKeys"),s=r(s=Object.keys)&&s,a=s?function(e){if(e)var t=e.constructor,r=e.length;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&r&&n(r)?i(e):l(e)?s(e):[]}:i;t.exports=a},{"../internal/isLength":380,"../internal/shimKeys":385,"../lang/isNative":394,"../lang/isObject":396}],407:[function(e,t){function n(e){if(null==e)return[];a(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(l(e)||o.nonEnumArgs&&r(e))&&t||0;for(var n=e.constructor,u=-1,c="function"==typeof n&&n.prototype===e,d=Array(t),f=t>0;++u<t;)d[u]=u+"";for(var h in e)f&&i(h,t)||"constructor"==h&&(c||!p.call(e,h))||d.push(h);return d}var r=e("../lang/isArguments"),l=e("../lang/isArray"),i=e("../internal/isIndex"),s=e("../internal/isLength"),a=e("../lang/isObject"),o=e("../support"),u=Object.prototype,p=u.hasOwnProperty;t.exports=n},{"../internal/isIndex":378,"../internal/isLength":380,"../lang/isArguments":389,"../lang/isArray":390,"../lang/isObject":396,"../support":411}],408:[function(e,t){var n=e("../internal/baseMerge"),r=e("../internal/createAssigner"),l=r(n);t.exports=l},{"../internal/baseMerge":352,"../internal/createAssigner":368}],409:[function(e,t){function n(e){return r(e,l(e))}var r=e("../internal/baseValues"),l=e("./keys");t.exports=n},{"../internal/baseValues":361,"./keys":406}],410:[function(e,t){function n(e){return e=r(e),e&&i.test(e)?e.replace(l,"\\$&"):e}var r=e("../internal/baseToString"),l=/[.*+?^${}()|[\]\/\\]/g,i=RegExp(l.source);t.exports=n},{"../internal/baseToString":359}],411:[function(e,t){(function(n){var r=e("./lang/isNative"),l=/\bthis\b/,i=Object.prototype,s=(s=n.window)&&s.document,a=i.propertyIsEnumerable,o={};!function(){o.funcDecomp=!r(n.WinRTError)&&l.test(function(){return this}),o.funcNames="string"==typeof Function.name;try{o.dom=11===s.createDocumentFragment().nodeType}catch(e){o.dom=!1}try{o.nonEnumArgs=!a.call(arguments,1)}catch(e){o.nonEnumArgs=!0}}(0,0),t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lang/isNative":394}],412:[function(e,t){function n(e){return function(){return e}}t.exports=n},{}],413:[function(e,t){function n(e){return e}t.exports=n},{}],414:[function(e,t){(function(n){function r(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function l(e,t){return t=t||{},function(n){return s(n,e,t)}}function i(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function s(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),n.nocomment||"#"!==t.charAt(0)?""===t.trim()?""===e:new a(t,n).match(e):!1}function a(e,t){if(!(this instanceof a))return new a(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),g&&(e=e.split("\\").join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function o(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(I)}),this.debug(this.pattern,n),n=n.map(function(e){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,n),this.set=n}}function u(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var l=0,i=e.length;i>l&&"!"===e.charAt(l);l++)t=!t,r++;r&&(this.pattern=e.substr(r)),this.negate=t}}function p(e,t){if(t||(t=this instanceof a?this.options:{}),e="undefined"==typeof e?this.pattern:e,"undefined"==typeof e)throw new Error("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:b(e)}function c(e,t){function n(){if(i){switch(i){case"*":a+=x,o=!0;break;case"?":a+=v,o=!0;break;default:a+="\\"+i}g.debug("clearStateChar %j %j",i,a),i=!1}}var r=this.options;if(!r.noglobstar&&"**"===e)return y;if(""===e)return"";for(var l,i,s,a="",o=!!r.nocase,u=!1,p=[],c=!1,d=-1,f=-1,m="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",g=this,b=0,E=e.length;E>b&&(s=e.charAt(b));b++)if(this.debug("%s %s %s %j",e,b,a,s),u&&S[s])a+="\\"+s,u=!1;else switch(s){case"/":return!1;case"\\":n(),u=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",e,b,a,s),c){this.debug(" in class"),"!"===s&&b===f+1&&(s="^"),a+=s;continue}g.debug("call clearStateChar %j",i),n(),i=s,r.noext&&n();continue;case"(":if(c){a+="(";continue}if(!i){a+="\\(";continue}l=i,p.push({type:l,start:b-1,reStart:a.length}),a+="!"===i?"(?:(?!":"(?:",this.debug("plType %j %j",i,a),i=!1;continue;case")":if(c||!p.length){a+="\\)";continue}switch(n(),o=!0,a+=")",l=p.pop().type){case"!":a+="[^/]*?)";break;case"?":case"+":case"*":a+=l;case"@":}continue;case"|":if(c||!p.length||u){a+="\\|",u=!1;continue}n(),a+="|";continue;case"[":if(n(),c){a+="\\"+s;continue}c=!0,f=b,d=a.length,a+=s;continue;case"]":if(b===f+1||!c){a+="\\"+s,u=!1;continue}if(c){var _=e.substring(f+1,b);try{new RegExp("["+_+"]")}catch(I){var k=this.parse(_,w);a=a.substr(0,d)+"\\["+k[0]+"\\]",o=o||k[1],c=!1;continue}}o=!0,c=!1,a+=s;continue;default:n(),u?u=!1:!S[s]||"^"===s&&c||(a+="\\"),a+=s}if(c){var _=e.substr(f+1),k=this.parse(_,w);a=a.substr(0,d)+"\\["+k[0],o=o||k[1]}for(var A;A=p.pop();){var C=a.slice(A.reStart+3);C=C.replace(/((?:\\{2})*)(\\?)\|/g,function(e,t,n){return n||(n="\\"),t+t+n+"|"}),this.debug("tail=%j\n %s",C,C);var T="*"===A.type?x:"?"===A.type?v:"\\"+A.type;o=!0,a=a.slice(0,A.reStart)+T+"\\("+C}n(),u&&(a+="\\\\");var j=!1;switch(a.charAt(0)){case".":case"[":case"(":j=!0}if(""!==a&&o&&(a="(?=.)"+a),j&&(a=m+a),t===w)return[a,o];if(!o)return h(e);var M=r.nocase?"i":"",P=new RegExp("^"+a+"$",M);return P._glob=e,P._src=a,P}function d(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1;var t=this.options,n=t.noglobstar?x:t.dot?E:_,r=t.nocase?"i":"",l=e.map(function(e){return e.map(function(e){return e===y?n:"string"==typeof e?m(e):e._src}).join("\\/")}).join("|");l="^(?:"+l+")$",this.negate&&(l="^(?!"+l+").*$");try{return this.regexp=new RegExp(l,r)}catch(i){return this.regexp=!1}}function f(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;g&&(e=e.split("\\").join("/")),e=e.split(I),this.debug(this.pattern,"split",e);var r=this.set;this.debug(this.pattern,"set",r);for(var l,i=e.length-1;i>=0&&!(l=e[i]);i--);for(var i=0,s=r.length;s>i;i++){var a=r[i],o=e;n.matchBase&&1===a.length&&(o=[l]);var u=this.matchOne(o,a,t);if(u)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}function h(e){return e.replace(/\\(.)/g,"$1")}function m(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}t.exports=s,s.Minimatch=a;var g=!1;"undefined"!=typeof n&&"win32"===n.platform&&(g=!0);var y=s.GLOBSTAR=a.GLOBSTAR={},b=e("brace-expansion"),v="[^/]",x=v+"*?",E="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",_="(?:(?!(?:\\/|^)\\.).)*?",S=r("().*{}+?[]^$\\!"),I=/\/+/;s.filter=l,s.defaults=function(e){if(!e||!Object.keys(e).length)return s;var t=s,n=function(n,r,l){return t.minimatch(n,r,i(e,l)) };return n.Minimatch=function(n,r){return new t.Minimatch(n,i(e,r))},n},a.defaults=function(e){return e&&Object.keys(e).length?s.defaults(e).Minimatch:a},a.prototype.debug=function(){},a.prototype.make=o,a.prototype.parseNegate=u,s.braceExpand=function(e,t){return p(e,t)},a.prototype.braceExpand=p,a.prototype.parse=c;var w={};s.makeRe=function(e,t){return new a(e,t||{}).makeRe()},a.prototype.makeRe=d,s.match=function(e,t,n){n=n||{};var r=new a(t,n);return e=e.filter(function(e){return r.match(e)}),r.options.nonull&&!e.length&&e.push(t),e},a.prototype.match=f,a.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{"this":this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var l=0,i=0,s=e.length,a=t.length;s>l&&a>i;l++,i++){this.debug("matchOne loop");var o=t[i],u=e[l];if(this.debug(t,o,u),o===!1)return!1;if(o===y){this.debug("GLOBSTAR",[t,o,u]);var p=l,c=i+1;if(c===a){for(this.debug("** at the end");s>l;l++)if("."===e[l]||".."===e[l]||!r.dot&&"."===e[l].charAt(0))return!1;return!0}e:for(;s>p;){var d=e[p];if(this.debug("\nglobstar while",e,p,t,c,d),this.matchOne(e.slice(p),t.slice(c),n))return this.debug("globstar found match!",p,s,d),!0;if("."===d||".."===d||!r.dot&&"."===d.charAt(0)){this.debug("dot detected!",e,p,t,c);break e}this.debug("globstar swallow a segment, and continue"),p++}return n&&(this.debug("\n>>> no match, partial?",e,p,t,c),p===s)?!0:!1}var f;if("string"==typeof o?(f=r.nocase?u.toLowerCase()===o.toLowerCase():u===o,this.debug("string match",o,u,f)):(f=u.match(o),this.debug("pattern match",o,u,f)),!f)return!1}if(l===s&&i===a)return!0;if(l===s)return n;if(i===a){var h=l===s-1&&""===e[l];return h}throw new Error("wtf?")}}).call(this,e("_process"))},{_process:183,"brace-expansion":415}],415:[function(e,t){function n(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function r(e){return e.split("\\\\").join(h).split("\\{").join(m).split("\\}").join(g).split("\\,").join(y).split("\\.").join(b)}function l(e){return e.split(h).join("\\").split(m).join("{").split(g).join("}").split(y).join(",").split(b).join(".")}function i(e){if(!e)return[""];var t=[],n=f("{","}",e);if(!n)return e.split(",");var r=n.pre,l=n.body,s=n.post,a=r.split(",");a[a.length-1]+="{"+l+"}";var o=i(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}function s(e){return e?c(r(e),!0).map(l):[]}function a(e){return"{"+e+"}"}function o(e){return/^-?0\d/.test(e)}function u(e,t){return t>=e}function p(e,t){return e>=t}function c(e,t){var r=[],l=f("{","}",e);if(!l||/\$$/.test(l.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),m=s||h,y=/^(.*,)+(.+)?$/.test(l.body);if(!m&&!y)return l.post.match(/,.*}/)?(e=l.pre+"{"+l.body+g+l.post,c(e)):[e];var b;if(m)b=l.body.split(/\.\./);else if(b=i(l.body),1===b.length&&(b=c(b[0],!1).map(a),1===b.length)){var v=l.post.length?c(l.post,!1):[""];return v.map(function(e){return l.pre+b[0]+e})}var x,E=l.pre,v=l.post.length?c(l.post,!1):[""];if(m){var _=n(b[0]),S=n(b[1]),I=Math.max(b[0].length,b[1].length),w=3==b.length?Math.abs(n(b[2])):1,k=u,A=_>S;A&&(w*=-1,k=p);var C=b.some(o);x=[];for(var T=_;k(T,S);T+=w){var j;if(h)j=String.fromCharCode(T),"\\"===j&&(j="");else if(j=String(T),C){var M=I-j.length;if(M>0){var P=new Array(M+1).join("0");j=0>T?"-"+P+j.slice(1):P+j}}x.push(j)}}else x=d(b,function(e){return c(e,!1)});for(var L=0;L<x.length;L++)for(var O=0;O<v.length;O++){var D=E+x[L]+v[O];(!t||m||D)&&r.push(D)}return r}var d=e("concat-map"),f=e("balanced-match");t.exports=s;var h="\x00SLASH"+Math.random()+"\x00",m="\x00OPEN"+Math.random()+"\x00",g="\x00CLOSE"+Math.random()+"\x00",y="\x00COMMA"+Math.random()+"\x00",b="\x00PERIOD"+Math.random()+"\x00"},{"balanced-match":416,"concat-map":417}],416:[function(e,t){function n(e,t,r){for(var l=0,i={},s=!1,a=0;a<r.length;a++)if(e==r.substr(a,e.length))"start"in i||(i.start=a),l++;else if(t==r.substr(a,t.length)&&"start"in i&&(s=!0,l--,!l))return i.end=a,i.pre=r.substr(0,i.start),i.body=i.end-i.start>1?r.substring(i.start+e.length,i.end):"",i.post=r.slice(i.end+t.length),i;if(l&&s){var o=i.start+e.length;return i=n(e,t,r.substr(o)),i&&(i.start+=o,i.end+=o,i.pre=r.slice(0,o)+i.pre),i}}t.exports=n},{}],417:[function(e,t){t.exports=function(e,t){for(var r=[],l=0;l<e.length;l++){var i=t(e[l],l);n(i)?r.push.apply(r,i):r.push(i)}return r};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],418:[function(e,t){(function(e){"use strict";function n(e){return"/"===e.charAt(0)}function r(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,n=t.exec(e),r=n[1]||"",l=!!r&&":"!==r.charAt(1);return!!n[2]||l}t.exports="win32"===e.platform?r:n,t.exports.posix=n,t.exports.win32=r}).call(this,e("_process"))},{_process:183}],419:[function(e,t,n){"use strict";function r(e,t,n){if(c)try{c.call(p,e,t,{value:n})}catch(r){e[t]=n}else e[t]=n}function l(e){return e&&(r(e,"call",e.call),r(e,"apply",e.apply)),e}function i(e){return d?d.call(p,e):(g.prototype=e||null,new g)}function s(){do var e=a(m.call(h.call(y(),36),2));while(f.call(b,e));return b[e]=e}function a(e){var t={};return t[e]=!0,Object.keys(t)[0]}function o(){return i(null)}function u(e){function t(t){function n(n,r){return n===a?r?i=null:i||(i=e(t)):void 0}var i;r(t,l,n)}function n(e){return f.call(e,l)||t(e),e[l](a)}var l=s(),a=i(null);return e=e||o,n.forget=function(e){f.call(e,l)&&e[l](a,!0)},n}var p=Object,c=Object.defineProperty,d=Object.create;l(c),l(d);var f=l(Object.prototype.hasOwnProperty),h=l(Number.prototype.toString),m=l(String.prototype.slice),g=function(){},y=Math.random,b=i(null);r(n,"makeUniqueKey",s);var v=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function(e){for(var t=v(e),n=0,r=0,l=t.length;l>n;++n)f.call(b,t[n])||(n>r&&(t[r]=t[n]),++r);return t.length=r,t},r(n,"makeAccessor",u)},{}],420:[function(e,t,n){function r(e){o.ok(this instanceof r),c.Identifier.assert(e),Object.defineProperties(this,{contextId:{value:e},listing:{value:[]},marked:{value:[!0]},finalLoc:{value:l()},tryEntries:{value:[]}}),Object.defineProperties(this,{leapManager:{value:new d.LeapManager(this)}})}function l(){return p.literal(-1)}function i(e){return c.BreakStatement.check(e)||c.ContinueStatement.check(e)||c.ReturnStatement.check(e)||c.ThrowStatement.check(e)}function s(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+JSON.stringify(e))}function a(e){var t=e.type;return"normal"===t?!m.call(e,"target"):"break"===t||"continue"===t?!m.call(e,"value")&&c.Literal.check(e.target):"return"===t||"throw"===t?m.call(e,"value")&&!m.call(e,"target"):!1}var o=e("assert"),u=e("ast-types"),p=(u.builtInTypes.array,u.builders),c=u.namedTypes,d=e("./leap"),f=e("./meta"),h=e("./util"),m=Object.prototype.hasOwnProperty,g=r.prototype;n.Emitter=r,g.mark=function(e){c.Literal.assert(e);var t=this.listing.length;return-1===e.value?e.value=t:o.strictEqual(e.value,t),this.marked[t]=!0,e},g.emit=function(e){c.Expression.check(e)&&(e=p.expressionStatement(e)),c.Statement.assert(e),this.listing.push(e)},g.emitAssign=function(e,t){return this.emit(this.assign(e,t)),e},g.assign=function(e,t){return p.expressionStatement(p.assignmentExpression("=",e,t))},g.contextProperty=function(e,t){return p.memberExpression(this.contextId,t?p.literal(e):p.identifier(e),!!t)};var y={prev:!0,next:!0,sent:!0,rval:!0};g.isVolatileContextProperty=function(e){if(c.MemberExpression.check(e)){if(e.computed)return!0;if(c.Identifier.check(e.object)&&c.Identifier.check(e.property)&&e.object.name===this.contextId.name&&m.call(y,e.property.name))return!0}return!1},g.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},g.setReturnValue=function(e){c.Expression.assert(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},g.clearPendingException=function(e,t){c.Literal.assert(e);var n=p.callExpression(this.contextProperty("catch",!0),[e]);t?this.emitAssign(t,n):this.emit(n)},g.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(p.breakStatement())},g.jumpIf=function(e,t){c.Expression.assert(e),c.Literal.assert(t),this.emit(p.ifStatement(e,p.blockStatement([this.assign(this.contextProperty("next"),t),p.breakStatement()])))},g.jumpIfNot=function(e,t){c.Expression.assert(e),c.Literal.assert(t);var n;n=c.UnaryExpression.check(e)&&"!"===e.operator?e.argument:p.unaryExpression("!",e),this.emit(p.ifStatement(n,p.blockStatement([this.assign(this.contextProperty("next"),t),p.breakStatement()])))};var b=0;g.makeTempVar=function(){return this.contextProperty("t"+b++)},g.getContextFunction=function(e){var t=p.functionExpression(e||null,[this.contextId],p.blockStatement([this.getDispatchLoop()]),!1,!1);return t._aliasFunction=!0,t},g.getDispatchLoop=function(){var e,t=this,n=[],r=!1;return t.listing.forEach(function(l,s){t.marked.hasOwnProperty(s)&&(n.push(p.switchCase(p.literal(s),e=[])),r=!1),r||(e.push(l),i(l)&&(r=!0))}),this.finalLoc.value=this.listing.length,n.push(p.switchCase(this.finalLoc,[]),p.switchCase(p.literal("end"),[p.returnStatement(p.callExpression(this.contextProperty("stop"),[]))])),p.whileStatement(p.literal(1),p.switchStatement(p.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),n))},g.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return p.arrayExpression(this.tryEntries.map(function(t){var n=t.firstLoc.value;o.ok(n>=e,"try entries out of order"),e=n;var r=t.catchEntry,l=t.finallyEntry,i=[t.firstLoc,r?r.firstLoc:null];return l&&(i[2]=l.firstLoc,i[3]=l.afterLoc),p.arrayExpression(i)}))},g.explode=function(e,t){o.ok(e instanceof u.NodePath);var n=e.value,r=this;if(c.Node.assert(n),c.Statement.check(n))return r.explodeStatement(e);if(c.Expression.check(n))return r.explodeExpression(e,t);if(c.Declaration.check(n))throw s(n);switch(n.type){case"Program":return e.get("body").map(r.explodeStatement,r);case"VariableDeclarator":throw s(n);case"Property":case"SwitchCase":case"CatchClause":throw new Error(n.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(n.type))}},g.explodeStatement=function(e,t){o.ok(e instanceof u.NodePath);var n=e.value,r=this;if(c.Statement.assert(n),t?c.Identifier.assert(t):t=null,c.BlockStatement.check(n))return e.get("body").each(r.explodeStatement,r);if(!f.containsLeap(n))return void r.emit(n);switch(n.type){case"ExpressionStatement":r.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":var i=l();r.leapManager.withEntry(new d.LabeledEntry(i,n.label),function(){r.explodeStatement(e.get("body"),n.label)}),r.mark(i);break;case"WhileStatement":var s=l(),i=l();r.mark(s),r.jumpIfNot(r.explodeExpression(e.get("test")),i),r.leapManager.withEntry(new d.LoopEntry(i,s,t),function(){r.explodeStatement(e.get("body"))}),r.jump(s),r.mark(i);break;case"DoWhileStatement":var a=l(),m=l(),i=l();r.mark(a),r.leapManager.withEntry(new d.LoopEntry(i,m,t),function(){r.explode(e.get("body"))}),r.mark(m),r.jumpIf(r.explodeExpression(e.get("test")),a),r.mark(i);break;case"ForStatement":var g=l(),y=l(),i=l();n.init&&r.explode(e.get("init"),!0),r.mark(g),n.test&&r.jumpIfNot(r.explodeExpression(e.get("test")),i),r.leapManager.withEntry(new d.LoopEntry(i,y,t),function(){r.explodeStatement(e.get("body"))}),r.mark(y),n.update&&r.explode(e.get("update"),!0),r.jump(g),r.mark(i);break;case"ForInStatement":c.Identifier.assert(n.left);var g=l(),i=l(),b=r.makeTempVar();r.emitAssign(b,p.callExpression(h.runtimeProperty("keys"),[r.explodeExpression(e.get("right"))])),r.mark(g);var v=r.makeTempVar();r.jumpIf(p.memberExpression(p.assignmentExpression("=",v,p.callExpression(b,[])),p.identifier("done"),!1),i),r.emitAssign(n.left,p.memberExpression(v,p.identifier("value"),!1)),r.leapManager.withEntry(new d.LoopEntry(i,g,t),function(){r.explodeStatement(e.get("body"))}),r.jump(g),r.mark(i);break;case"BreakStatement":r.emitAbruptCompletion({type:"break",target:r.leapManager.getBreakLoc(n.label)});break;case"ContinueStatement":r.emitAbruptCompletion({type:"continue",target:r.leapManager.getContinueLoc(n.label)});break;case"SwitchStatement":for(var x=r.emitAssign(r.makeTempVar(),r.explodeExpression(e.get("discriminant"))),i=l(),E=l(),_=E,S=[],I=n.cases||[],w=I.length-1;w>=0;--w){var k=I[w];c.SwitchCase.assert(k),k.test?_=p.conditionalExpression(p.binaryExpression("===",x,k.test),S[w]=l(),_):S[w]=E}r.jump(r.explodeExpression(new u.NodePath(_,e,"discriminant"))),r.leapManager.withEntry(new d.SwitchEntry(i),function(){e.get("cases").each(function(e){var t=(e.value,e.name);r.mark(S[t]),e.get("consequent").each(r.explodeStatement,r)})}),r.mark(i),-1===E.value&&(r.mark(E),o.strictEqual(i.value,E.value));break;case"IfStatement":var A=n.alternate&&l(),i=l();r.jumpIfNot(r.explodeExpression(e.get("test")),A||i),r.explodeStatement(e.get("consequent")),A&&(r.jump(i),r.mark(A),r.explodeStatement(e.get("alternate"))),r.mark(i);break;case"ReturnStatement":r.emitAbruptCompletion({type:"return",value:r.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var i=l(),C=n.handler;!C&&n.handlers&&(C=n.handlers[0]||null);var T=C&&l(),j=T&&new d.CatchEntry(T,C.param),M=n.finalizer&&l(),P=M&&new d.FinallyEntry(M,i),L=new d.TryEntry(r.getUnmarkedCurrentLoc(),j,P);r.tryEntries.push(L),r.updateContextPrevLoc(L.firstLoc),r.leapManager.withEntry(L,function(){if(r.explodeStatement(e.get("block")),T){r.jump(M?M:i),r.updateContextPrevLoc(r.mark(T));var t=e.get("handler","body"),n=r.makeTempVar();r.clearPendingException(L.firstLoc,n);var l=t.scope,s=C.param.name;c.CatchClause.assert(l.node),o.strictEqual(l.lookup(s),l),u.visit(t,{visitIdentifier:function(e){return h.isReference(e,s)&&e.scope.lookup(s)===l?n:void this.traverse(e)},visitFunction:function(e){return e.scope.declares(s)?!1:void this.traverse(e)}}),r.leapManager.withEntry(j,function(){r.explodeStatement(t)})}M&&(r.updateContextPrevLoc(r.mark(M)),r.leapManager.withEntry(P,function(){r.explodeStatement(e.get("finalizer"))}),r.emit(p.returnStatement(p.callExpression(r.contextProperty("finish"),[P.firstLoc]))))}),r.mark(i);break;case"ThrowStatement":r.emit(p.throwStatement(r.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(n.type))}},g.emitAbruptCompletion=function(e){a(e)||o.ok(!1,"invalid completion record: "+JSON.stringify(e)),o.notStrictEqual(e.type,"normal","normal completions are not abrupt");var t=[p.literal(e.type)];"break"===e.type||"continue"===e.type?(c.Literal.assert(e.target),t[1]=e.target):("return"===e.type||"throw"===e.type)&&e.value&&(c.Expression.assert(e.value),t[1]=e.value),this.emit(p.returnStatement(p.callExpression(this.contextProperty("abrupt"),t)))},g.getUnmarkedCurrentLoc=function(){return p.literal(this.listing.length)},g.updateContextPrevLoc=function(e){e?(c.Literal.assert(e),-1===e.value?e.value=this.listing.length:o.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},g.explodeExpression=function(e,t){function n(e){return c.Expression.assert(e),t?void a.emit(e):e}function r(e,t,n){o.ok(t instanceof u.NodePath),o.ok(!n||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var r=a.explodeExpression(t,n);return n||(e||d&&(a.isVolatileContextProperty(r)||f.hasSideEffects(r)))&&(r=a.emitAssign(e||a.makeTempVar(),r)),r}o.ok(e instanceof u.NodePath);var i=e.value;if(!i)return i;c.Expression.assert(i);var s,a=this;if(!f.containsLeap(i))return n(i);var d=f.containsLeap.onlyChildren(i);switch(i.type){case"MemberExpression":return n(p.memberExpression(a.explodeExpression(e.get("object")),i.computed?r(null,e.get("property")):i.property,i.computed));case"CallExpression":var h=e.get("callee"),m=a.explodeExpression(h);return!c.MemberExpression.check(h.node)&&c.MemberExpression.check(m)&&(m=p.sequenceExpression([p.literal(0),m])),n(p.callExpression(m,e.get("arguments").map(function(e){return r(null,e)})));case"NewExpression":return n(p.newExpression(r(null,e.get("callee")),e.get("arguments").map(function(e){return r(null,e)})));case"ObjectExpression":return n(p.objectExpression(e.get("properties").map(function(e){return p.property(e.value.kind,e.value.key,r(null,e.get("value")))})));case"ArrayExpression":return n(p.arrayExpression(e.get("elements").map(function(e){return r(null,e)})));case"SequenceExpression":var g=i.expressions.length-1;return e.get("expressions").each(function(e){e.name===g?s=a.explodeExpression(e,t):a.explodeExpression(e,!0)}),s;case"LogicalExpression":var y=l();t||(s=a.makeTempVar());var b=r(s,e.get("left"));return"&&"===i.operator?a.jumpIfNot(b,y):(o.strictEqual(i.operator,"||"),a.jumpIf(b,y)),r(s,e.get("right"),t),a.mark(y),s;case"ConditionalExpression":var v=l(),y=l(),x=a.explodeExpression(e.get("test"));return a.jumpIfNot(x,v),t||(s=a.makeTempVar()),r(s,e.get("consequent"),t),a.jump(y),a.mark(v),r(s,e.get("alternate"),t),a.mark(y),s;case"UnaryExpression":return n(p.unaryExpression(i.operator,a.explodeExpression(e.get("argument")),!!i.prefix));case"BinaryExpression":return n(p.binaryExpression(i.operator,r(null,e.get("left")),r(null,e.get("right"))));case"AssignmentExpression":return n(p.assignmentExpression(i.operator,a.explodeExpression(e.get("left")),a.explodeExpression(e.get("right"))));case"UpdateExpression":return n(p.updateExpression(i.operator,a.explodeExpression(e.get("argument")),i.prefix));case"YieldExpression":var y=l(),E=i.argument&&a.explodeExpression(e.get("argument"));if(E&&i.delegate){var s=a.makeTempVar();return a.emit(p.returnStatement(p.callExpression(a.contextProperty("delegateYield"),[E,p.literal(s.property.name),y]))),a.mark(y),s}return a.emitAssign(a.contextProperty("next"),y),a.emit(p.returnStatement(E||null)),a.mark(y),a.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(i.type))}}},{"./leap":422,"./meta":423,"./util":424,assert:173,"ast-types":171}],421:[function(e,t,n){var r=e("assert"),l=e("ast-types"),i=l.namedTypes,s=l.builders,a=Object.prototype.hasOwnProperty;n.hoist=function(e){function t(e,t){i.VariableDeclaration.assert(e);var r=[];return e.declarations.forEach(function(e){n[e.id.name]=e.id,e.init?r.push(s.assignmentExpression("=",e.id,e.init)):t&&r.push(e.id)}),0===r.length?null:1===r.length?r[0]:s.sequenceExpression(r)}r.ok(e instanceof l.NodePath),i.Function.assert(e.value);var n={};l.visit(e.get("body"),{visitVariableDeclaration:function(e){var n=t(e.value,!1);return null!==n?s.expressionStatement(n):(e.replace(),!1)},visitForStatement:function(e){var n=e.value.init;i.VariableDeclaration.check(n)&&e.get("init").replace(t(n,!1)),this.traverse(e)},visitForInStatement:function(e){var n=e.value.left;i.VariableDeclaration.check(n)&&e.get("left").replace(t(n,!0)),this.traverse(e)},visitFunctionDeclaration:function(e){var t=e.value;n[t.id.name]=t.id;var r=(e.parent.node,s.expressionStatement(s.assignmentExpression("=",t.id,s.functionExpression(t.id,t.params,t.body,t.generator,t.expression))));return i.BlockStatement.check(e.parent.node)?(e.parent.get("body").unshift(r),e.replace()):e.replace(r),!1},visitFunctionExpression:function(){return!1}});var o={};e.get("params").each(function(e){var t=e.value;i.Identifier.check(t)&&(o[t.name]=t)});var u=[];return Object.keys(n).forEach(function(e){a.call(o,e)||u.push(s.variableDeclarator(n[e],null))}),0===u.length?null:s.variableDeclaration("var",u)}},{assert:173,"ast-types":171}],422:[function(e,t,n){function r(){d.ok(this instanceof r)}function l(e){r.call(this),h.Literal.assert(e),this.returnLoc=e}function i(e,t,n){r.call(this),h.Literal.assert(e),h.Literal.assert(t),n?h.Identifier.assert(n):n=null,this.breakLoc=e,this.continueLoc=t,this.label=n}function s(e){r.call(this),h.Literal.assert(e),this.breakLoc=e}function a(e,t,n){r.call(this),h.Literal.assert(e),t?d.ok(t instanceof o):t=null,n?d.ok(n instanceof u):n=null,d.ok(t||n),this.firstLoc=e,this.catchEntry=t,this.finallyEntry=n}function o(e,t){r.call(this),h.Literal.assert(e),h.Identifier.assert(t),this.firstLoc=e,this.paramId=t}function u(e,t){r.call(this),h.Literal.assert(e),h.Literal.assert(t),this.firstLoc=e,this.afterLoc=t}function p(e,t){r.call(this),h.Literal.assert(e),h.Identifier.assert(t),this.breakLoc=e,this.label=t}function c(t){d.ok(this instanceof c);var n=e("./emit").Emitter;d.ok(t instanceof n),this.emitter=t,this.entryStack=[new l(t.finalLoc)]}{var d=e("assert"),f=e("ast-types"),h=f.namedTypes,m=(f.builders,e("util").inherits);Object.prototype.hasOwnProperty}m(l,r),n.FunctionEntry=l,m(i,r),n.LoopEntry=i,m(s,r),n.SwitchEntry=s,m(a,r),n.TryEntry=a,m(o,r),n.CatchEntry=o,m(u,r),n.FinallyEntry=u,m(p,r),n.LabeledEntry=p;var g=c.prototype;n.LeapManager=c,g.withEntry=function(e,t){d.ok(e instanceof r),this.entryStack.push(e);try{t.call(this.emitter)}finally{var n=this.entryStack.pop();d.strictEqual(n,e)}},g._findLeapLocation=function(e,t){for(var n=this.entryStack.length-1;n>=0;--n){var r=this.entryStack[n],l=r[e];if(l)if(t){if(r.label&&r.label.name===t.name)return l}else if(!(r instanceof p))return l}return null},g.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},g.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},{"./emit":420,assert:173,"ast-types":171,util:199}],423:[function(e,t,n){function r(e,t){function n(e){function t(e){return n||(a.check(e)?e.some(t):o.Node.check(e)&&(l.strictEqual(n,!1),n=r(e))),n}o.Node.assert(e);var n=!1;return s.eachField(e,function(e,n){t(n)}),n}function r(r){o.Node.assert(r);var l=i(r);return u.call(l,e)?l[e]:l[e]=u.call(p,r.type)?!1:u.call(t,r.type)?!0:n(r)}return r.onlyChildren=n,r}var l=e("assert"),i=e("private").makeAccessor(),s=e("ast-types"),a=s.builtInTypes.array,o=s.namedTypes,u=Object.prototype.hasOwnProperty,p={FunctionExpression:!0},c={CallExpression:!0,ForInStatement:!0,UnaryExpression:!0,BinaryExpression:!0,AssignmentExpression:!0,UpdateExpression:!0,NewExpression:!0},d={YieldExpression:!0,BreakStatement:!0,ContinueStatement:!0,ReturnStatement:!0,ThrowStatement:!0};for(var f in d)u.call(d,f)&&(c[f]=d[f]);n.hasSideEffects=r("hasSideEffects",c),n.containsLeap=r("containsLeap",d)},{assert:173,"ast-types":171,"private":419}],424:[function(e,t,n){var r=(e("assert"),e("ast-types")),l=r.namedTypes,i=r.builders,s=Object.prototype.hasOwnProperty;n.defaults=function(e){for(var t,n=arguments.length,r=1;n>r;++r)if(t=arguments[r])for(var l in t)s.call(t,l)&&!s.call(e,l)&&(e[l]=t[l]);return e},n.runtimeProperty=function(e){return i.memberExpression(i.identifier("regeneratorRuntime"),i.identifier(e),!1)},n.isReference=function(e,t){var n=e.value;if(!l.Identifier.check(n))return!1;if(t&&n.name!==t)return!1;var r=e.parent.value;switch(r.type){case"VariableDeclarator":return"init"===e.name;case"MemberExpression":return"object"===e.name||r.computed&&"property"===e.name;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return"id"===e.name?!1:r.params===e.parentPath&&r.params[e.name]===n?!1:!0;case"ClassDeclaration":case"ClassExpression":return"id"!==e.name;case"CatchClause":return"param"!==e.name;case"Property":case"MethodDefinition":return"key"!==e.name;case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return!1;default:return!0}}},{assert:173,"ast-types":171}],425:[function(e,t,n){var r=(e("assert"),e("fs"),e("ast-types")),l=r.namedTypes,i=r.builders,s=(r.builtInTypes.array,r.builtInTypes.object,r.NodePath),a=e("./hoist").hoist,o=e("./emit").Emitter,u=e("./util").runtimeProperty;n.transform=function(e,t){t=t||{};var n=e instanceof s?e:new s(e);return p.visit(n,t),e=n.value,t.madeChanges=p.wasChangeReported(),e};var p=r.PathVisitor.fromMethodsObject({reset:function(e,t){this.options=t},visitFunction:function(e){this.traverse(e);var t=e.value,n=t.async&&!this.options.disableAsync;if(t.generator||n){this.reportChanged(),t.generator=!1,t.expression&&(t.expression=!1,t.body=i.blockStatement([i.returnStatement(t.body)])),n&&c.visit(e.get("body"));var r=t.id||(t.id=e.scope.parent.declareTemporary("callee$")),s=[],p=e.value.body;p.body=p.body.filter(function(e){return e&&null!=e._blockHoist?(s.push(e),!1):!0});var d=i.identifier(t.id.name+"$"),f=e.scope.declareTemporary("context$"),h=a(e),m=new o(f);m.explode(e.get("body")),h&&h.declarations.length>0&&s.push(h);var g=[m.getContextFunction(d),n?i.literal(null):r,i.thisExpression()],y=m.getTryLocsList();y&&g.push(y);var b=i.callExpression(u(n?"async":"wrap"),g);if(s.push(i.returnStatement(b)),t.body=i.blockStatement(s),t.body._declarations=p._declarations,n)return void(t.async=!1);if(!l.FunctionDeclaration.check(t))return l.FunctionExpression.assert(t),i.callExpression(u("mark"),[t]);for(var v=e.parent;v&&!l.BlockStatement.check(v.value)&&!l.Program.check(v.value);)v=v.parent;if(v){e.replace(),t.type="FunctionExpression";var x=i.variableDeclaration("var",[i.variableDeclarator(t.id,i.callExpression(u("mark"),[t]))]);t.comments&&(x.leadingComments=t.leadingComments,x.trailingComments=t.trailingComments,t.leadingComments=null,t.trailingComments=null),x._blockHoist=3;{var E=v.get("body");E.value.length}E.push(x)}}}}),c=r.PathVisitor.fromMethodsObject({visitFunction:function(){return!1},visitAwaitExpression:function(e){var t=e.value.argument;return e.value.all&&(t=i.callExpression(i.memberExpression(i.identifier("Promise"),i.identifier("all"),!1),[t])),i.yieldExpression(t,!1)}})},{"./emit":420,"./hoist":421,"./util":424,assert:173,"ast-types":171,fs:172}],426:[function(e,t){(function(n){function r(e,t){function n(e){l.push(e)}function r(){this.queue(compile(l.join(""),t).code),this.queue(null)}var l=[];return s(n,r)}function l(){e("./runtime")}{var i=(e("assert"),e("path")),s=(e("fs"),e("through")),a=e("./lib/visit").transform;e("./lib/util"),e("ast-types")}t.exports=r,r.runtime=l,l.path=i.join(n,"runtime.js"),r.transform=a}).call(this,"/node_modules/regenerator-babel")},{"./lib/util":424,"./lib/visit":425,"./runtime":428,assert:173,"ast-types":171,fs:172,path:182,through:427}],427:[function(e,t,n){(function(r){function l(e,t,n){function l(){for(;u.length&&!c.paused;){var e=u.shift();if(null===e)return c.emit("end");c.emit("data",e)}}function s(){c.writable=!1,t.call(c),!c.readable&&c.autoDestroy&&c.destroy()}e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var a=!1,o=!1,u=[],p=!1,c=new i;return c.readable=c.writable=!0,c.paused=!1,c.autoDestroy=!(n&&n.autoDestroy===!1),c.write=function(t){return e.call(this,t),!c.paused},c.queue=c.push=function(e){return p?c:(null==e&&(p=!0),u.push(e),l(),c)},c.on("end",function(){c.readable=!1,!c.writable&&c.autoDestroy&&r.nextTick(function(){c.destroy()})}),c.end=function(e){return a?void 0:(a=!0,arguments.length&&c.write(e),s(),c)},c.destroy=function(){return o?void 0:(o=!0,a=!0,u.length=0,c.writable=c.readable=!1,c.emit("close"),c)},c.pause=function(){return c.paused?void 0:(c.paused=!0,c)},c.resume=function(){return c.paused&&(c.paused=!1,c.emit("resume")),l(),c.paused||c.emit("drain"),c},c}var i=e("stream");n=t.exports=l,l.through=l}).call(this,e("_process"))},{_process:183,stream:195}],428:[function(e,t){(function(e){!function(e){"use strict";function n(e,t,n,r){return new s(e,t,n||null,r||[])}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}function l(){}function i(){}function s(e,t,n,l){function i(t,l){if(o===v)throw new Error("Generator is already running");if(o===x)return c();for(;;){var i=a.delegate;if(i){var s=r(i.iterator[t],i.iterator,l);if("throw"===s.type){a.delegate=null,t="throw",l=s.arg;continue}t="next",l=d;var u=s.arg;if(!u.done)return o=b,u;a[i.resultName]=u.value,a.next=i.nextLoc,a.delegate=null}if("next"===t){if(o===y&&"undefined"!=typeof l)throw new TypeError("attempt to send "+JSON.stringify(l)+" to newborn generator");o===b?a.sent=l:delete a.sent}else if("throw"===t){if(o===y)throw o=x,l;a.dispatchException(l)&&(t="next",l=d)}else"return"===t&&a.abrupt("return",l);o=v;var s=r(e,n,a);if("normal"===s.type){o=a.done?x:b;var u={value:s.arg,done:a.done};if(s.arg!==E)return u;a.delegate&&"next"===t&&(l=d)}else"throw"===s.type&&(o=x,"next"===t?a.dispatchException(s.arg):l=s.arg)}}var s=t?Object.create(t.prototype):this,a=new u(l),o=y;return s.next=i.bind(s,"next"),s["throw"]=i.bind(s,"throw"),s["return"]=i.bind(s,"return"),s}function a(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function o(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function u(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(a,this),this.reset()}function p(e){if(e){var t=e[h];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function l(){for(;++n<e.length;)if(f.call(e,n))return l.value=e[n],l.done=!1,l;return l.value=d,l.done=!0,l};return r.next=r}}return{next:c}}function c(){return{value:d,done:!0}}var d,f=Object.prototype.hasOwnProperty,h="function"==typeof Symbol&&Symbol.iterator||"@@iterator",m="object"==typeof t,g=e.regeneratorRuntime;if(g)return void(m&&(t.exports=g));g=e.regeneratorRuntime=m?t.exports:{},g.wrap=n;var y="suspendedStart",b="suspendedYield",v="executing",x="completed",E={},_=i.prototype=s.prototype;l.prototype=_.constructor=i,i.constructor=l,l.displayName="GeneratorFunction",g.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return t?t===l||"GeneratorFunction"===(t.displayName||t.name):!1},g.mark=function(e){return e.__proto__=i,e.prototype=Object.create(_),e},g.async=function(e,t,l,i){return new Promise(function(s,a){function o(e){var t=r(this,null,e);if("throw"===t.type)return void a(t.arg);var n=t.arg;n.done?s(n.value):Promise.resolve(n.value).then(p,c)}var u=n(e,t,l,i),p=o.bind(u.next),c=o.bind(u["throw"]);p()})},_[h]=function(){return this},_.toString=function(){return"[object Generator]"},g.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},g.values=p,u.prototype={constructor:u,reset:function(){this.prev=0,this.next=0,this.sent=d,this.done=!1,this.delegate=null,this.tryEntries.forEach(o);for(var e,t=0;f.call(this,e="t"+t)||20>t;++t)this[e]=null},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var l=this.tryEntries[r],i=l.completion;if("root"===l.tryLoc)return t("end");if(l.tryLoc<=this.prev){var s=f.call(l,"catchLoc"),a=f.call(l,"finallyLoc");if(s&&a){if(this.prev<l.catchLoc)return t(l.catchLoc,!0);if(this.prev<l.finallyLoc)return t(l.finallyLoc)}else if(s){if(this.prev<l.catchLoc)return t(l.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return t(l.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&f.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var l=r;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<l.finallyLoc&&(l=null);var i=l?l.completion:{};return i.type=e,i.arg=t,l?this.next=l.finallyLoc:this.complete(i),E},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=e.arg,this.next="end"):"normal"===e.type&&t&&(this.next=t),E},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc)}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t]; if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var l=r.arg;o(n)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},E}}}("object"==typeof e?e:"object"==typeof window?window:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],429:[function(e,t,n){var r=e("regenerate");n.REGULAR={d:r().addRange(48,57),D:r().addRange(0,47).addRange(58,65535),s:r(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:r().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:r(95).addRange(48,57).addRange(65,90).addRange(97,122),W:r(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)},n.UNICODE={d:r().addRange(48,57),D:r().addRange(0,47).addRange(58,1114111),s:r(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:r().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:r(95).addRange(48,57).addRange(65,90).addRange(97,122),W:r(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)},n.UNICODE_IGNORE_CASE={d:r().addRange(48,57),D:r().addRange(0,47).addRange(58,1114111),s:r(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:r().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:r(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:r(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:431}],430:[function(e,t){t.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],431:[function(t,n,r){(function(t){!function(l){var i="object"==typeof r&&r,s="object"==typeof n&&n&&n.exports==i&&n,a="object"==typeof t&&t;(a.global===a||a.window===a)&&(l=a);var o={rangeOrder:"A range’s `stop` value must be greater than or equal to the `start` value.",codePointRange:"Invalid code point value. Code points range from U+000000 to U+10FFFF."},u=55296,p=56319,c=56320,d=57343,f=/\\x00([^0123456789]|$)/g,h={},m=h.hasOwnProperty,g=function(e,t){var n;for(n in t)m.call(t,n)&&(e[n]=t[n]);return e},y=function(e,t){for(var n=-1,r=e.length;++n<r;)t(e[n],n)},b=h.toString,v=function(e){return"[object Array]"==b.call(e)},x=function(e){return"number"==typeof e||"[object Number]"==b.call(e)},E="0000",_=function(e,t){var n=String(e);return n.length<t?(E+n).slice(-t):n},S=function(e){return Number(e).toString(16).toUpperCase()},I=[].slice,w=function(e){for(var t,n=-1,r=e.length,l=r-1,i=[],s=!0,a=0;++n<r;)if(t=e[n],s)i.push(t),a=t,s=!1;else if(t==a+1){if(n!=l){a=t;continue}s=!0,i.push(t+1)}else i.push(a+1,t),a=t;return s||i.push(t+1),i},k=function(e,t){for(var n,r,l=0,i=e.length;i>l;){if(n=e[l],r=e[l+1],t>=n&&r>t)return t==n?r==n+1?(e.splice(l,2),e):(e[l]=t+1,e):t==r-1?(e[l+1]=t,e):(e.splice(l,2,n,t,t+1,r),e);l+=2}return e},A=function(e,t,n){if(t>n)throw Error(o.rangeOrder);for(var r,l,i=0;i<e.length;){if(r=e[i],l=e[i+1]-1,r>n)return e;if(r>=t&&n>=l)e.splice(i,2);else{if(t>=r&&l>n)return t==r?(e[i]=n+1,e[i+1]=l+1,e):(e.splice(i,2,r,t,n+1,l+1),e);if(t>=r&&l>=t)e[i+1]=t;else if(n>=r&&l>=n)return e[i]=n+1,e;i+=2}}return e},C=function(e,t){var n,r,l=0,i=null,s=e.length;if(0>t||t>1114111)throw RangeError(o.codePointRange);for(;s>l;){if(n=e[l],r=e[l+1],t>=n&&r>t)return e;if(t==n-1)return e[l]=t,e;if(n>t)return e.splice(null!=i?i+2:0,0,t,t+1),e;if(t==r)return t+1==e[l+2]?(e.splice(l,4,n,e[l+3]),e):(e[l+1]=t+1,e);i=l,l+=2}return e.push(t,t+1),e},T=function(e,t){for(var n,r,l=0,i=e.slice(),s=t.length;s>l;)n=t[l],r=t[l+1]-1,i=n==r?C(i,n):M(i,n,r),l+=2;return i},j=function(e,t){for(var n,r,l=0,i=e.slice(),s=t.length;s>l;)n=t[l],r=t[l+1]-1,i=n==r?k(i,n):A(i,n,r),l+=2;return i},M=function(e,t,n){if(t>n)throw Error(o.rangeOrder);if(0>t||t>1114111||0>n||n>1114111)throw RangeError(o.codePointRange);for(var r,l,i=0,s=!1,a=e.length;a>i;){if(r=e[i],l=e[i+1],s){if(r==n+1)return e.splice(i-1,2),e;if(r>n)return e;r>=t&&n>=r&&(l>t&&n>=l-1?(e.splice(i,2),i-=2):(e.splice(i-1,2),i-=2))}else{if(r==n+1)return e[i]=t,e;if(r>n)return e.splice(i,0,t,n+1),e;if(t>=r&&l>t&&l>=n+1)return e;t>=r&&l>t||l==t?(e[i+1]=n+1,s=!0):r>=t&&n+1>=l&&(e[i]=t,e[i+1]=n+1,s=!0)}i+=2}return s||e.push(t,n+1),e},P=function(e,t){var n=0,r=e.length,l=e[n],i=e[r-1];if(r>=2&&(l>t||t>i))return!1;for(;r>n;){if(l=e[n],i=e[n+1],t>=l&&i>t)return!0;n+=2}return!1},L=function(e,t){for(var n,r=0,l=t.length,i=[];l>r;)n=t[r],P(e,n)&&i.push(n),++r;return w(i)},O=function(e){return!e.length},D=function(e){return 2==e.length&&e[0]+1==e[1]},R=function(e){for(var t,n,r=0,l=[],i=e.length;i>r;){for(t=e[r],n=e[r+1];n>t;)l.push(t),++t;r+=2}return l},N=Math.floor,F=function(e){return parseInt(N((e-65536)/1024)+u,10)},B=function(e){return parseInt((e-65536)%1024+c,10)},$=String.fromCharCode,V=function(e){var t;return t=9==e?"\\t":10==e?"\\n":12==e?"\\f":13==e?"\\r":92==e?"\\\\":36==e||e>=40&&43>=e||45==e||46==e||63==e||e>=91&&94>=e||e>=123&&125>=e?"\\"+$(e):e>=32&&126>=e?$(e):255>=e?"\\x"+_(S(e),2):"\\u"+_(S(e),4)},U=function(e){var t,n=e.length,r=e.charCodeAt(0);return r>=u&&p>=r&&n>1?(t=e.charCodeAt(1),1024*(r-u)+t-c+65536):r},q=function(e){var t,n,r="",l=0,i=e.length;if(D(e))return V(e[0]);for(;i>l;)t=e[l],n=e[l+1]-1,r+=t==n?V(t):t+1==n?V(t)+V(n):V(t)+"-"+V(n),l+=2;return"["+r+"]"},G=function(e){for(var t,n,r=[],l=[],i=[],s=[],a=0,o=e.length;o>a;)t=e[a],n=e[a+1]-1,u>t?(u>n&&i.push(t,n+1),n>=u&&p>=n&&(i.push(t,u),r.push(u,n+1)),n>=c&&d>=n&&(i.push(t,u),r.push(u,p+1),l.push(c,n+1)),n>d&&(i.push(t,u),r.push(u,p+1),l.push(c,d+1),65535>=n?i.push(d+1,n+1):(i.push(d+1,65536),s.push(65536,n+1)))):t>=u&&p>=t?(n>=u&&p>=n&&r.push(t,n+1),n>=c&&d>=n&&(r.push(t,p+1),l.push(c,n+1)),n>d&&(r.push(t,p+1),l.push(c,d+1),65535>=n?i.push(d+1,n+1):(i.push(d+1,65536),s.push(65536,n+1)))):t>=c&&d>=t?(n>=c&&d>=n&&l.push(t,n+1),n>d&&(l.push(t,d+1),65535>=n?i.push(d+1,n+1):(i.push(d+1,65536),s.push(65536,n+1)))):t>d&&65535>=t?65535>=n?i.push(t,n+1):(i.push(t,65536),s.push(65536,n+1)):s.push(t,n+1),a+=2;return{loneHighSurrogates:r,loneLowSurrogates:l,bmp:i,astral:s}},W=function(e){for(var t,n,r,l,i,s,a=[],o=[],u=!1,p=-1,c=e.length;++p<c;)if(t=e[p],n=e[p+1]){for(r=t[0],l=t[1],i=n[0],s=n[1],o=l;i&&r[0]==i[0]&&r[1]==i[1];)o=D(s)?C(o,s[0]):M(o,s[0],s[1]-1),++p,t=e[p],r=t[0],l=t[1],n=e[p+1],i=n&&n[0],s=n&&n[1],u=!0;a.push([r,u?o:l]),u=!1}else a.push(t);return z(a)},z=function(e){if(1==e.length)return e;for(var t=-1,n=-1;++t<e.length;){var r=e[t],l=r[1],i=l[0],s=l[1];for(n=t;++n<e.length;){var a=e[n],o=a[1],u=o[0],p=o[1];i==u&&s==p&&(r[0]=D(a[0])?C(r[0],a[0][0]):M(r[0],a[0][0],a[0][1]-1),e.splice(n,1),--n)}}return e},H=function(e){if(!e.length)return[];for(var t,n,r,l,i,s,a=0,o=0,u=0,p=[],f=e.length;f>a;){t=e[a],n=e[a+1]-1,r=F(t),l=B(t),i=F(n),s=B(n);var h=l==c,m=s==d,g=!1;r==i||h&&m?(p.push([[r,i+1],[l,s+1]]),g=!0):p.push([[r,r+1],[l,d+1]]),!g&&i>r+1&&(m?(p.push([[r+1,i+1],[c,s+1]]),g=!0):p.push([[r+1,i],[c,d+1]])),g||p.push([[i,i+1],[c,s+1]]),o=r,u=i,a+=2}return W(p)},J=function(e){var t=[];return y(e,function(e){var n=e[0],r=e[1];t.push(q(n)+q(r))}),t.join("|")},X=function(e,t){var n=[],r=G(e),l=r.loneHighSurrogates,i=r.loneLowSurrogates,s=r.bmp,a=r.astral,o=(!O(r.astral),!O(l)),u=!O(i),p=H(a);return t&&(s=T(s,l),o=!1,s=T(s,i),u=!1),O(s)||n.push(q(s)),p.length&&n.push(J(p)),o&&n.push(q(l)+"(?![\\uDC00-\\uDFFF])"),u&&n.push("(?:[^\\uD800-\\uDBFF]|^)"+q(i)),n.join("|")},Y=function(e){return arguments.length>1&&(e=I.call(arguments)),this instanceof Y?(this.data=[],e?this.add(e):this):(new Y).add(e)};Y.version="1.2.0";var K=Y.prototype;g(K,{add:function(e){var t=this;return null==e?t:e instanceof Y?(t.data=T(t.data,e.data),t):(arguments.length>1&&(e=I.call(arguments)),v(e)?(y(e,function(e){t.add(e)}),t):(t.data=C(t.data,x(e)?e:U(e)),t))},remove:function(e){var t=this;return null==e?t:e instanceof Y?(t.data=j(t.data,e.data),t):(arguments.length>1&&(e=I.call(arguments)),v(e)?(y(e,function(e){t.remove(e)}),t):(t.data=k(t.data,x(e)?e:U(e)),t))},addRange:function(e,t){var n=this;return n.data=M(n.data,x(e)?e:U(e),x(t)?t:U(t)),n},removeRange:function(e,t){var n=this,r=x(e)?e:U(e),l=x(t)?t:U(t);return n.data=A(n.data,r,l),n},intersection:function(e){var t=this,n=e instanceof Y?R(e.data):e;return t.data=L(t.data,n),t},contains:function(e){return P(this.data,x(e)?e:U(e))},clone:function(){var e=new Y;return e.data=this.data.slice(0),e},toString:function(e){var t=X(this.data,e?e.bmpOnly:!1);return t.replace(f,"\\0$1")},toRegExp:function(e){return RegExp(this.toString(),e||"")},valueOf:function(){return R(this.data)}}),K.toArray=K.valueOf,"function"==typeof e&&"object"==typeof e.amd&&e.amd?e(function(){return Y}):i&&!i.nodeType?s?s.exports=Y:i.regenerate=Y:l.regenerate=Y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],432:[function(t,n,r){(function(t){(function(){"use strict";function l(){var e,t,n=16384,r=[],l=-1,i=arguments.length;if(!i)return"";for(var s="";++l<i;){var a=Number(arguments[l]);if(!isFinite(a)||0>a||a>1114111||A(a)!=a)throw RangeError("Invalid code point: "+a);65535>=a?r.push(a):(a-=65536,e=(a>>10)+55296,t=a%1024+56320,r.push(e,t)),(l+1==i||r.length>n)&&(s+=k.apply(null,r),r.length=0)}return s}function i(e,t){if(-1==t.indexOf("|")){if(e==t)return;throw Error("Invalid node type: "+e)}if(t=i.hasOwnProperty(t)?i[t]:i[t]=RegExp("^(?:"+t+")$"),!t.test(e))throw Error("Invalid node type: "+e)}function s(e){var t=e.type;if(s.hasOwnProperty(t)&&"function"==typeof s[t])return s[t](e);throw Error("Invalid node type: "+t)}function a(e){i(e.type,"alternative");var t=e.body,n=t?t.length:0;if(1==n)return v(t[0]);for(var r=-1,l="";++r<n;)l+=v(t[r]);return l}function o(e){switch(i(e.type,"anchor"),e.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function u(e){return i(e.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value"),s(e)}function p(e){i(e.type,"characterClass");var t=e.body,n=t?t.length:0,r=-1,l="[";for(e.negative&&(l+="^");++r<n;)l+=f(t[r]);return l+="]"}function c(e){return i(e.type,"characterClassEscape"),"\\"+e.value}function d(e){i(e.type,"characterClassRange");var t=e.min,n=e.max;if("characterClassRange"==t.type||"characterClassRange"==n.type)throw Error("Invalid character class range");return f(t)+"-"+f(n)}function f(e){return i(e.type,"anchor|characterClassEscape|characterClassRange|dot|value"),s(e)}function h(e){i(e.type,"disjunction");var t=e.body,n=t?t.length:0;if(0==n)throw Error("No body");if(1==n)return s(t[0]);for(var r=-1,l="";++r<n;)0!=r&&(l+="|"),l+=s(t[r]);return l}function m(e){return i(e.type,"dot"),"."}function g(e){i(e.type,"group");var t="(";switch(e.behavior){case"normal":break;case"ignore":t+="?:";break;case"lookahead":t+="?=";break;case"negativeLookahead":t+="?!";break;default:throw Error("Invalid behaviour: "+e.behaviour)}var n=e.body,r=n?n.length:0;if(1==r)t+=s(n[0]);else for(var l=-1;++l<r;)t+=s(n[l]);return t+=")"}function y(e){i(e.type,"quantifier");var t="",n=e.min,r=e.max;switch(r){case void 0:case null:switch(n){case 0:t="*";break;case 1:t="+";break;default:t="{"+n+",}"}break;default:t=n==r?"{"+n+"}":0==n&&1==r?"?":"{"+n+","+r+"}"}return e.greedy||(t+="?"),u(e.body[0])+t}function b(e){return i(e.type,"reference"),"\\"+e.matchIndex}function v(e){return i(e.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value"),s(e)}function x(e){i(e.type,"value");var t=e.kind,n=e.codePoint;switch(t){case"controlLetter":return"\\c"+l(n+64);case"hexadecimalEscape":return"\\x"+("00"+n.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+l(n);case"null":return"\\"+n;case"octal":return"\\"+n.toString(8);case"singleEscape":switch(n){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+n)}case"symbol":return l(n);case"unicodeEscape":return"\\u"+("0000"+n.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+n.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+t)}}var E={"function":!0,object:!0},_=E[typeof window]&&window||this,S=E[typeof r]&&r,I=E[typeof n]&&n&&!n.nodeType&&n,w=S&&I&&"object"==typeof t&&t;!w||w.global!==w&&w.window!==w&&w.self!==w||(_=w);var k=String.fromCharCode,A=Math.floor;s.alternative=a,s.anchor=o,s.characterClass=p,s.characterClassEscape=c,s.characterClassRange=d,s.disjunction=h,s.dot=m,s.group=g,s.quantifier=y,s.reference=b,s.value=x,"function"==typeof e&&"object"==typeof e.amd&&e.amd?e(function(){return{generate:s}}):S&&I?S.generate=s:_.regjsgen={generate:s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],433:[function(e,t){!function(){function e(e,t){function n(t){return t.raw=e.substring(t.range[0],t.range[1]),t}function r(e,t){return e.range[0]=t,n(e)}function l(e,t){return n({type:"anchor",kind:e,range:[Y-t,Y]})}function i(e,t,r,l){return n({type:"value",kind:e,codePoint:t,range:[r,l]})}function s(e,t,n,r){return r=r||0,i(e,t,Y-(n.length+r),Y)}function a(e){var t=e[0],n=t.charCodeAt(0);if(X){var r;if(1===t.length&&n>=55296&&56319>=n&&(r=E().charCodeAt(0),r>=56320&&57343>=r))return Y++,i("symbol",1024*(n-55296)+r-56320+65536,Y-2,Y)}return i("symbol",n,Y-1,Y)}function o(e,t,r){return n({type:"disjunction",body:e,range:[t,r]})}function u(){return n({type:"dot",range:[Y-1,Y]})}function p(e){return n({type:"characterClassEscape",value:e,range:[Y-2,Y]})}function c(e){return n({type:"reference",matchIndex:parseInt(e,10),range:[Y-1-e.length,Y]})}function d(e,t,r,l){return n({type:"group",behavior:e,body:t,range:[r,l]})}function f(e,t,r,l){return null==l&&(r=Y-1,l=Y),n({type:"quantifier",min:e,max:t,greedy:!0,body:null,range:[r,l]})}function h(e,t,r){return n({type:"alternative",body:e,range:[t,r]})}function m(e,t,r,l){return n({type:"characterClass",body:e,negative:t,range:[r,l]})}function g(e,t,r,l){if(e.codePoint>t.codePoint)throw SyntaxError("invalid range in character class");return n({type:"characterClassRange",min:e,max:t,range:[r,l]})}function y(e){return"alternative"===e.type?e.body:[e]}function b(t){t=t||1;var n=e.substring(Y,Y+t);return Y+=t||1,n}function v(e){if(!x(e))throw SyntaxError("character: "+e)}function x(t){return e.indexOf(t,Y)===Y?b(t.length):void 0}function E(){return e[Y]}function _(t){return e.indexOf(t,Y)===Y}function S(t){return e[Y+1]===t}function I(t){var n=e.substring(Y),r=n.match(t);return r&&(r.range=[],r.range[0]=Y,b(r[0].length),r.range[1]=Y),r}function w(){var e=[],t=Y;for(e.push(k());x("|");)e.push(k());return 1===e.length?e[0]:o(e,t,Y)}function k(){for(var e,t=[],n=Y;e=A();)t.push(e);return 1===t.length?t[0]:h(t,n,Y)}function A(){if(Y>=e.length||_("|")||_(")"))return null;var t=T();if(t)return t;var n=M();if(!n)throw SyntaxError("Expected atom");var l=j()||!1;return l?(l.body=y(n),r(l,n.range[0]),l):n}function C(e,t,n,r){var l=null,i=Y;if(x(e))l=t;else{if(!x(n))return!1;l=r}var s=w();if(!s)throw SyntaxError("Expected disjunction");v(")");var a=d(l,y(s),i,Y);return"normal"==l&&J&&H++,a}function T(){return x("^")?l("start",1):x("$")?l("end",1):x("\\b")?l("boundary",2):x("\\B")?l("not-boundary",2):C("(?=","lookahead","(?!","negativeLookahead")}function j(){var e,t,n,r;if(x("*"))t=f(0);else if(x("+"))t=f(1);else if(x("?"))t=f(0,1);else if(e=I(/^\{([0-9]+)\}/))n=parseInt(e[1],10),t=f(n,n,e.range[0],e.range[1]);else if(e=I(/^\{([0-9]+),\}/))n=parseInt(e[1],10),t=f(n,void 0,e.range[0],e.range[1]);else if(e=I(/^\{([0-9]+),([0-9]+)\}/)){if(n=parseInt(e[1],10),r=parseInt(e[2],10),n>r)throw SyntaxError("numbers out of order in {} quantifier");t=f(n,r,e.range[0],e.range[1])}return t&&x("?")&&(t.greedy=!1,t.range[1]+=1),t}function M(){var e;if(e=I(/^[^^$\\.*+?(){[|]/))return a(e);if(x("."))return u();if(x("\\")){if(e=O(),!e)throw SyntaxError("atomEscape");return e}return(e=B())?e:C("(?:","ignore","(","normal")}function P(e){if(X){var t,r;if("unicodeEscape"==e.kind&&(t=e.codePoint)>=55296&&56319>=t&&_("\\")&&S("u")){var l=Y;Y++;var i=L();"unicodeEscape"==i.kind&&(r=i.codePoint)>=56320&&57343>=r?(e.range[1]=i.range[1],e.codePoint=1024*(t-55296)+r-56320+65536,e.type="value",e.kind="unicodeCodePointEscape",n(e)):Y=l}}return e}function L(){return O(!0)}function O(e){var t;if(t=D())return t;if(e){if(x("b"))return s("singleEscape",8,"\\b");if(x("B"))throw SyntaxError("\\B not possible inside of CharacterClass")}return t=R()}function D(){var e,t;if(e=I(/^(?!0)\d+/)){t=e[0];var n=parseInt(e[0],10);return H>=n?c(e[0]):(z.push(n),b(-e[0].length),(e=I(/^[0-7]{1,3}/))?s("octal",parseInt(e[0],8),e[0],1):(e=a(I(/^[89]/)),r(e,e.range[0]-1)))}return(e=I(/^[0-7]{1,3}/))?(t=e[0],/^0{1,3}$/.test(t)?s("null",0,"0",t.length+1):s("octal",parseInt(t,8),t,1)):(e=I(/^[dDsSwW]/))?p(e[0]):!1}function R(){var e;if(e=I(/^[fnrtv]/)){var t=0;switch(e[0]){case"t":t=9;break;case"n":t=10;break;case"v":t=11;break;case"f":t=12;break;case"r":t=13}return s("singleEscape",t,"\\"+e[0])}return(e=I(/^c([a-zA-Z])/))?s("controlLetter",e[1].charCodeAt(0)%32,e[1],2):(e=I(/^x([0-9a-fA-F]{2})/))?s("hexadecimalEscape",parseInt(e[1],16),e[1],2):(e=I(/^u([0-9a-fA-F]{4})/))?P(s("unicodeEscape",parseInt(e[1],16),e[1],2)):X&&(e=I(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(e[1],16),e[1],4):F()}function N(e){var t=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&t.test(String.fromCharCode(e))}function F(){var e,t="‌",n="‍";return N(E())?x(t)?s("identifier",8204,t):x(n)?s("identifier",8205,n):null:(e=b(),s("identifier",e.charCodeAt(0),e,1))}function B(){var e,t=Y;return(e=I(/^\[\^/))?(e=$(),v("]"),m(e,!0,t,Y)):x("[")?(e=$(),v("]"),m(e,!1,t,Y)):null}function $(){var e;if(_("]"))return[];if(e=U(),!e)throw SyntaxError("nonEmptyClassRanges");return e}function V(e){var t,n,r;if(_("-")&&!S("]")){if(v("-"),r=G(),!r)throw SyntaxError("classAtom");n=Y;var l=$();if(!l)throw SyntaxError("classRanges");return t=e.range[0],"empty"===l.type?[g(e,r,t,n)]:[g(e,r,t,n)].concat(l)}if(r=q(),!r)throw SyntaxError("nonEmptyClassRangesNoDash");return[e].concat(r)}function U(){var e=G();if(!e)throw SyntaxError("classAtom");return _("]")?[e]:V(e)}function q(){var e=G();if(!e)throw SyntaxError("classAtom");return _("]")?e:V(e)}function G(){return x("-")?a("-"):W()}function W(){var e;if(e=I(/^[^\\\]-]/))return a(e[0]);if(x("\\")){if(e=L(),!e)throw SyntaxError("classEscape");return P(e)}}var z=[],H=0,J=!0,X=-1!==(t||"").indexOf("u"),Y=0;e=String(e),""===e&&(e="(?:)");var K=w();if(K.range[1]!==e.length)throw SyntaxError("Could not parse entire input - got stuck: "+e);for(var Q=0;Q<z.length;Q++)if(z[Q]<=H)return Y=0,J=!1,w();return K}var n={parse:e};"undefined"!=typeof t&&t.exports?t.exports=n:window.regjsparser=n}()},{}],434:[function(e,t){function n(e){return _?E?h.UNICODE_IGNORE_CASE[e]:h.UNICODE[e]:h.REGULAR[e]}function r(e,t){return g.call(e,t)}function l(e,t){for(var n in t)e[n]=t[n]}function i(e,t){if(t){var n=c(t,"");switch(n.type){case"characterClass":case"group":case"value":break;default:n=s(n,t)}l(e,n)}}function s(e,t){return{type:"group",behavior:"ignore",body:[e],raw:"(?:"+t+")"}}function a(e){return r(f,e)?f[e]:!1}function o(e){{var t=d();e.body.forEach(function(e){switch(e.type){case"value":if(t.add(e.codePoint),E&&_){var r=a(e.codePoint);r&&t.add(r)}break;case"characterClassRange":var l=e.min.codePoint,i=e.max.codePoint;t.addRange(l,i),E&&_&&t.iuAddRange(l,i);break;case"characterClassEscape":t.add(n(e.value));break;default:throw Error("Unknown term type: "+e.type)}})}return e.negative&&(t=(_?y:b).clone().remove(t)),i(e,t.toString()),e}function u(e){switch(e.type){case"dot":i(e,(_?v:x).toString());break;case"characterClass":e=o(e);break;case"characterClassEscape":i(e,n(e.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":e.body=e.body.map(u);break;case"value":var t=e.codePoint,r=d(t);if(E&&_){var l=a(t);l&&r.add(l)}i(e,r.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+e.type)}return e}var p=e("regjsgen").generate,c=e("regjsparser").parse,d=e("regenerate"),f=e("./data/iu-mappings.json"),h=e("./data/character-class-escape-sets.js"),m={},g=m.hasOwnProperty,y=d().addRange(0,1114111),b=d().addRange(0,65535),v=y.clone().remove(10,13,8232,8233),x=v.clone().intersection(b);d.prototype.iuAddRange=function(e,t){var n=this;do{var r=a(e);r&&n.add(r)}while(++e<=t);return n};var E=!1,_=!1;t.exports=function(e,t){var n=c(e,t);return E=t?t.indexOf("i")>-1:!1,_=t?t.indexOf("u")>-1:!1,l(n,u(n)),p(n)}},{"./data/character-class-escape-sets.js":429,"./data/iu-mappings.json":430,regenerate:431,regjsgen:432,regjsparser:433}],435:[function(e,t){"use strict";var n=e("is-finite");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected a string as the first argument");if(0>t||!n(t))throw new TypeError("Expected a finite positive number");var r="";do 1&t&&(r+=e),e+=e;while(t>>=1);return r}},{"is-finite":436}],436:[function(e,t,n){arguments[4][304][0].apply(n,arguments)},{dup:304}],437:[function(e,t){"use strict";t.exports=/^#!.*/},{}],438:[function(e,t){"use strict";t.exports=function(e){var t=/^\\\\\?\\/.test(e),n=/[^\x00-\x80]+/.test(e);return t||n?e:e.replace(/\\/g,"/")}},{}],439:[function(e,t,n){n.SourceMapGenerator=e("./source-map/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./source-map/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":445,"./source-map/source-map-generator":446,"./source-map/source-node":447}],440:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(){this._array=[],this._set={}}var r=e("./util");n.fromArray=function(e,t){for(var r=new n,l=0,i=e.length;i>l;l++)r.add(e[l],t);return r},n.prototype.add=function(e,t){var n=this.has(e),l=this._array.length;(!n||t)&&this._array.push(e),n||(this._set[r.toSetString(e)]=l)},n.prototype.has=function(e){return Object.prototype.hasOwnProperty.call(this._set,r.toSetString(e))},n.prototype.indexOf=function(e){if(this.has(e))return this._set[r.toSetString(e)];throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},n.prototype.toArray=function(){return this._array.slice()},t.ArraySet=n})},{"./util":448,amdefine:449}],441:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e){return 0>e?(-e<<1)+1:(e<<1)+0}function r(e){var t=1===(1&e),n=e>>1;return t?-n:n}var l=e("./base64"),i=5,s=1<<i,a=s-1,o=s;t.encode=function(e){var t,r="",s=n(e);do t=s&a,s>>>=i,s>0&&(t|=o),r+=l.encode(t);while(s>0);return r},t.decode=function(e,t,n){var s,u,p=e.length,c=0,d=0;do{if(t>=p)throw new Error("Expected more digits in base 64 VLQ value.");u=l.decode(e.charAt(t++)),s=!!(u&o),u&=a,c+=u<<d,d+=i}while(s);n.value=r(c),n.rest=t}})},{"./base64":442,amdefine:449}],442:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){var n={},r={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(e,t){n[e]=t,r[t]=e}),t.encode=function(e){if(e in r)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){if(e in n)return n[e];throw new TypeError("Not a valid base 64 digit: "+e)}})},{amdefine:449}],443:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e,r,l,i,s,a){var o=Math.floor((r-e)/2)+e,u=s(l,i[o],!0);return 0===u?o:u>0?r-o>1?n(o,r,l,i,s,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:o:o-e>1?n(e,o,l,i,s,a):a==t.LEAST_UPPER_BOUND?o:0>e?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,l,i){return 0===r.length?-1:n(-1,r.length,e,r,l,i||t.GREATEST_LOWER_BOUND)}})},{amdefine:449}],444:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,s=t.generatedColumn;return r>n||r==n&&s>=i||l.compareByGeneratedPositions(e,t)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var l=e("./util");r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(l.compareByGeneratedPositions),this._sorted=!0),this._array},t.MappingList=r})},{"./util":448,amdefine:449}],445:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new l(t):new r(t)}function r(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=i.getArg(t,"version"),r=i.getArg(t,"sources"),l=i.getArg(t,"names",[]),s=i.getArg(t,"sourceRoot",null),o=i.getArg(t,"sourcesContent",null),u=i.getArg(t,"mappings"),p=i.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);r=r.map(i.normalize),this._names=a.fromArray(l,!0),this._sources=a.fromArray(r,!0),this.sourceRoot=s,this.sourcesContent=o,this._mappings=u,this.file=p}function l(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=i.getArg(t,"version"),l=i.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);var s={line:-1,column:0};this._sections=l.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=i.getArg(e,"offset"),r=i.getArg(t,"line"),l=i.getArg(t,"column");if(r<s.line||r===s.line&&l<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=t,{generatedOffset:{generatedLine:r+1,generatedColumn:l+1},consumer:new n(i.getArg(e,"map"))}})}var i=e("./util"),s=e("./binary-search"),a=e("./array-set").ArraySet,o=e("./base64-vlq");n.fromSourceMap=function(e){return r.fromSourceMap(e)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{get:function(){return this.__originalMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__originalMappings}}),n.prototype._nextCharIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},n.prototype._parseMappings=function(){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(e,t,r){var l,s=t||null,a=r||n.GENERATED_ORDER;switch(a){case n.GENERATED_ORDER:l=this._generatedMappings;break;case n.ORIGINAL_ORDER:l=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;l.map(function(e){var t=e.source;return null!=t&&null!=o&&(t=i.join(o,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name}}).forEach(e,s)},n.prototype.allGeneratedPositionsFor=function(e){var t={source:i.getArg(e,"source"),originalLine:i.getArg(e,"line"),originalColumn:0};null!=this.sourceRoot&&(t.source=i.relative(this.sourceRoot,t.source));var n=[],r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(r>=0)for(var l=this._originalMappings[r];l&&l.originalLine===t.originalLine;)n.push({line:i.getArg(l,"generatedLine",null),column:i.getArg(l,"generatedColumn",null),lastColumn:i.getArg(l,"lastGeneratedColumn",null)}),l=this._originalMappings[++r];return n},t.SourceMapConsumer=n,r.prototype=Object.create(n.prototype),r.prototype.consumer=n,r.fromSourceMap=function(e){var t=Object.create(r.prototype); return t._names=a.fromArray(e._names.toArray(),!0),t._sources=a.fromArray(e._sources.toArray(),!0),t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file,t.__generatedMappings=e._mappings.toArray().slice(),t.__originalMappings=e._mappings.toArray().slice().sort(i.compareByOriginalPositions),t},r.prototype._version=3,Object.defineProperty(r.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?i.join(this.sourceRoot,e):e},this)}}),r.prototype._parseMappings=function(e){for(var t,n,r,l,s=1,a=0,u=0,p=0,c=0,d=0,f=e.length,h=0,m={},g={};f>h;)if(";"===e.charAt(h))s++,++h,a=0;else if(","===e.charAt(h))++h;else{for(t={},t.generatedLine=s,l=h;f>l&&!this._nextCharIsMappingSeparator(e,l);++l);if(n=e.slice(h,l),r=m[n])h+=n.length;else{for(r=[];l>h;)o.decode(e,h,g),value=g.value,h=g.rest,r.push(value);m[n]=r}if(t.generatedColumn=a+r[0],a=t.generatedColumn,r.length>1){if(t.source=this._sources.at(c+r[1]),c+=r[1],2===r.length)throw new Error("Found a source, but no line and column");if(t.originalLine=u+r[2],u=t.originalLine,t.originalLine+=1,3===r.length)throw new Error("Found a source and line, but no column");t.originalColumn=p+r[3],p=t.originalColumn,r.length>4&&(t.name=this._names.at(d+r[4]),d+=r[4])}this.__generatedMappings.push(t),"number"==typeof t.originalLine&&this.__originalMappings.push(t)}this.__generatedMappings.sort(i.compareByGeneratedPositions),this.__originalMappings.sort(i.compareByOriginalPositions)},r.prototype._findMapping=function(e,t,n,r,l,i){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return s.search(e,t,l,i)},r.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},r.prototype.originalPositionFor=function(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",i.compareByGeneratedPositions,i.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var l=this._generatedMappings[r];if(l.generatedLine===t.generatedLine){var s=i.getArg(l,"source",null);return null!=s&&null!=this.sourceRoot&&(s=i.join(this.sourceRoot,s)),{source:s,line:i.getArg(l,"originalLine",null),column:i.getArg(l,"originalColumn",null),name:i.getArg(l,"name",null)}}}return{source:null,line:null,column:null,name:null}},r.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=i.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=i.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},r.prototype.generatedPositionFor=function(e){var t={source:i.getArg(e,"source"),originalLine:i.getArg(e,"line"),originalColumn:i.getArg(e,"column")};null!=this.sourceRoot&&(t.source=i.relative(this.sourceRoot,t.source));var r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var l=this._originalMappings[r];return{line:i.getArg(l,"generatedLine",null),column:i.getArg(l,"generatedColumn",null),lastColumn:i.getArg(l,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=r,l.prototype=Object.create(n.prototype),l.prototype.constructor=n,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),l.prototype.originalPositionFor=function(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")},n=s.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n?n:e.generatedColumn-t.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},l.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],l=r.consumer.sourceContentFor(e,!0);if(l)return l}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer.sources.indexOf(i.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r){var l={line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)};return l}}}return{line:null,column:null}},l.prototype._parseMappings=function(){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var t=this._sections[e],n=t.consumer._generatedMappings,r=0;r<n.length;r++){var l=n[e],s=l.source,a=t.consumer.sourceRoot;null!=s&&null!=a&&(s=i.join(a,s));var o={source:s,generatedLine:l.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:l.column+(t.generatedOffset.generatedLine===l.generatedLine)?t.generatedOffset.generatedColumn-1:0,originalLine:l.originalLine,originalColumn:l.originalColumn,name:l.name};this.__generatedMappings.push(o),"number"==typeof o.originalLine&&this.__originalMappings.push(o)}this.__generatedMappings.sort(i.compareByGeneratedPositions),this.__originalMappings.sort(i.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l})},{"./array-set":440,"./base64-vlq":441,"./binary-search":443,"./util":448,amdefine:449}],446:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e){e||(e={}),this._file=l.getArg(e,"file",null),this._sourceRoot=l.getArg(e,"sourceRoot",null),this._skipValidation=l.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}var r=e("./base64-vlq"),l=e("./util"),i=e("./array-set").ArraySet,s=e("./mapping-list").MappingList;n.prototype._version=3,n.fromSourceMap=function(e){var t=e.sourceRoot,r=new n({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=l.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)}),r},n.prototype.addMapping=function(e){var t=l.getArg(e,"generated"),n=l.getArg(e,"original",null),r=l.getArg(e,"source",null),i=l.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null==r||this._sources.has(r)||this._sources.add(r),null==i||this._names.has(i)||this._names.add(i),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},n.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=l.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents={}),this._sourcesContents[l.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[l.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var s=this._sourceRoot;null!=s&&(r=l.relative(s,r));var a=new i,o=new i;this._mappings.unsortedForEach(function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=l.join(n,t.source)),null!=s&&(t.source=l.relative(s,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var u=t.source;null==u||a.has(u)||a.add(u);var p=t.name;null==p||o.has(p)||o.add(p)},this),this._sources=a,this._names=o,e.sources.forEach(function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=l.join(n,t)),null!=s&&(t=l.relative(s,t)),this.setSourceContent(t,r))},this)},n.prototype._validateMapping=function(e,t,n,r){if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r||e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},n.prototype._serializeMappings=function(){for(var e,t=0,n=1,i=0,s=0,a=0,o=0,u="",p=this._mappings.toArray(),c=0,d=p.length;d>c;c++){if(e=p[c],e.generatedLine!==n)for(t=0;e.generatedLine!==n;)u+=";",n++;else if(c>0){if(!l.compareByGeneratedPositions(e,p[c-1]))continue;u+=","}u+=r.encode(e.generatedColumn-t),t=e.generatedColumn,null!=e.source&&(u+=r.encode(this._sources.indexOf(e.source)-o),o=this._sources.indexOf(e.source),u+=r.encode(e.originalLine-1-s),s=e.originalLine-1,u+=r.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(u+=r.encode(this._names.indexOf(e.name)-a),a=this._names.indexOf(e.name)))}return u},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=l.relative(t,e));var n=l.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n})},{"./array-set":440,"./base64-vlq":441,"./mapping-list":444,"./util":448,amdefine:449}],447:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e,t,n,r,l){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==l?null:l,this[a]=!0,null!=r&&this.add(r)}var r=e("./source-map-generator").SourceMapGenerator,l=e("./util"),i=/(\r?\n)/,s=10,a="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function s(e,t){if(null===e||void 0===e.source)a.add(t);else{var i=r?l.join(r,e.source):e.source;a.add(new n(e.originalLine,e.originalColumn,i,t,e.name))}}var a=new n,o=e.split(i),u=function(){var e=o.shift(),t=o.shift()||"";return e+t},p=1,c=0,d=null;return t.eachMapping(function(e){if(null!==d){if(!(p<e.generatedLine)){var t=o[0],n=t.substr(0,e.generatedColumn-c);return o[0]=t.substr(e.generatedColumn-c),c=e.generatedColumn,s(d,n),void(d=e)}var n="";s(d,u()),p++,c=0}for(;p<e.generatedLine;)a.add(u()),p++;if(c<e.generatedColumn){var t=o[0];a.add(t.substr(0,e.generatedColumn)),o[0]=t.substr(e.generatedColumn),c=e.generatedColumn}d=e},this),o.length>0&&(d&&s(d,u()),a.add(o.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=l.join(r,e)),a.setSourceContent(e,n))}),a},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,n=0,r=this.children.length;r>n;n++)t=this.children[n],t[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;r-1>n;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},n.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[a]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},n.prototype.setSourceContent=function(e,t){this.sourceContents[l.toSetString(e)]=t},n.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;n>t;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),t=0,n=r.length;n>t;t++)e(l.fromSetString(r[t]),this.sourceContents[r[t]])},n.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},n.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),l=!1,i=null,a=null,o=null,u=null;return this.walk(function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?((i!==r.source||a!==r.line||o!==r.column||u!==r.name)&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,a=r.line,o=r.column,u=r.name,l=!0):l&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,l=!1);for(var p=0,c=e.length;c>p;p++)e.charCodeAt(p)===s?(t.line++,t.column=0,p+1===c?(i=null,l=!1):l&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++}),this.walkSourceContents(function(e,t){n.setSourceContent(e,t)}),{code:t.code,map:n}},t.SourceNode=n})},{"./source-map-generator":446,"./util":448,amdefine:449}],448:[function(e,t){if("function"!=typeof n)var n=e("amdefine")(t,e);n(function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(f);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function l(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function i(e){var t=e,n=r(e);if(n){if(!n.path)return e;t=n.path}for(var i,s="/"===t.charAt(0),a=t.split(/\/+/),o=0,u=a.length-1;u>=0;u--)i=a[u],"."===i?a.splice(u,1):".."===i?o++:o>0&&(""===i?(a.splice(u+1,o),o=0):(a.splice(u,2),o--));return t=a.join("/"),""===t&&(t=s?"/":"."),n?(n.path=t,l(n)):t}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),s=r(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),l(n);if(n||t.match(h))return t;if(s&&!s.host&&!s.path)return s.host=t,l(s);var a="/"===t.charAt(0)?t:i(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=a,l(s)):a}function a(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");var n=r(e);return"/"==t.charAt(0)&&n&&"/"==n.path?t.slice(1):0===t.indexOf(e+"/")?t.substr(e.length+1):t}function o(e){return"$"+e}function u(e){return e.substr(1)}function p(e,t){var n=e||"",r=t||"";return(n>r)-(r>n)}function c(e,t,n){var r;return(r=p(e.source,t.source))?r:(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,r||n?r:(r=p(e.name,t.name))?r:(r=e.generatedLine-t.generatedLine,r?r:e.generatedColumn-t.generatedColumn))}function d(e,t,n){var r;return(r=e.generatedLine-t.generatedLine)?r:(r=e.generatedColumn-t.generatedColumn,r||n?r:(r=p(e.source,t.source))?r:(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,r?r:p(e.name,t.name)))}t.getArg=n;var f=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,h=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=l,t.normalize=i,t.join=s,t.relative=a,t.toSetString=o,t.fromSetString=u,t.compareByOriginalPositions=c,t.compareByGeneratedPositions=d})},{amdefine:449}],449:[function(e,t){(function(n,r){"use strict";function l(t,l){function i(e){var t,n;for(t=0;e[t];t+=1)if(n=e[t],"."===n)e.splice(t,1),t-=1;else if(".."===n){if(1===t&&(".."===e[2]||".."===e[0]))break;t>0&&(e.splice(t-1,2),t-=2)}}function s(e,t){var n;return e&&"."===e.charAt(0)&&t&&(n=t.split("/"),n=n.slice(0,n.length-1),n=n.concat(e.split("/")),i(n),e=n.join("/")),e}function a(e){return function(t){return s(t,e)}}function o(e){function t(t){h[e]=t}return t.fromText=function(){throw new Error("amdefine does not implement load.fromText")},t}function u(e,n,i){var s,a,o,u;if(e)a=h[e]={},o={id:e,uri:r,exports:a},s=c(l,a,o,e);else{if(m)throw new Error("amdefine with no module ID cannot be called more than once per file.");m=!0,a=t.exports,o=t,s=c(l,a,o,t.id)}n&&(n=n.map(function(e){return s(e)})),u="function"==typeof i?i.apply(o.exports,n):i,void 0!==u&&(o.exports=u,e&&(h[e]=o.exports))}function p(e,t,n){Array.isArray(e)?(n=t,t=e,e=void 0):"string"!=typeof e&&(n=e,e=t=void 0),t&&!Array.isArray(t)&&(n=t,t=void 0),t||(t=["require","exports","module"]),e?f[e]=[e,t,n]:u(e,t,n)}var c,d,f={},h={},m=!1,g=e("path");return c=function(e,t,r,l){function i(i,s){return"string"==typeof i?d(e,t,r,i,l):(i=i.map(function(n){return d(e,t,r,n,l)}),void n.nextTick(function(){s.apply(null,i)}))}return i.toUrl=function(e){return 0===e.indexOf(".")?s(e,g.dirname(r.filename)):e},i},l=l||function(){return t.require.apply(t,arguments)},d=function(e,t,n,r,l){var i,p,m=r.indexOf("!"),g=r;if(-1===m){if(r=s(r,l),"require"===r)return c(e,t,n,l);if("exports"===r)return t;if("module"===r)return n;if(h.hasOwnProperty(r))return h[r];if(f[r])return u.apply(null,f[r]),h[r];if(e)return e(g);throw new Error("No module with ID: "+r)}return i=r.substring(0,m),r=r.substring(m+1,r.length),p=d(e,t,n,i,l),r=p.normalize?p.normalize(r,a(l)):s(r,l),h[r]?h[r]:(p.load(r,c(e,t,n,l),o(r),{}),h[r])},p.require=function(e){return h[e]?h[e]:f[e]?(u.apply(null,f[e]),h[e]):void 0},p.amd={},p}t.exports=l}).call(this,e("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:183,path:182}],450:[function(e,t,n){"use strict";t.exports=function r(e){function t(){}t.prototype=e,new t}},{}],451:[function(e,t){"use strict";t.exports=function(e){return e.replace(/[\s\uFEFF\xA0]+$/g,"")}},{}],452:[function(e,t){t.exports={name:"babel-core",description:"Turn ES6 code into readable vanilla ES5 with source maps",version:"5.0.2",author:"Sebastian McKenzie <sebmck@gmail.com>",homepage:"https://babeljs.io/",repository:"babel/babel",main:"lib/babel/api/node.js",browser:{"./lib/babel/api/register/node.js":"./lib/babel/api/register/browser.js"},keywords:["harmony","classes","modules","let","const","var","es6","transpile","transpiler","6to5","babel"],scripts:{bench:"make bench",test:"make test"},dependencies:{"ast-types":"~0.7.0",chalk:"^1.0.0","convert-source-map":"^0.5.0","core-js":"^0.8.0",debug:"^2.1.1","detect-indent":"^3.0.0",estraverse:"^1.9.1",esutils:"^1.1.6","fs-readdir-recursive":"^0.1.0",globals:"^6.2.0","is-integer":"^1.0.4","js-tokens":"1.0.0",leven:"^1.0.1","line-numbers":"0.2.0",lodash:"^3.2.0",minimatch:"^2.0.3","output-file-sync":"^1.1.0","path-is-absolute":"^1.0.0","private":"^0.1.6","regenerator-babel":"0.8.13-2",regexpu:"^1.1.2",repeating:"^1.1.2","shebang-regex":"^1.0.0",slash:"^1.0.0","source-map":"^0.4.0","source-map-support":"^0.2.9","to-fast-properties":"^1.0.0","trim-right":"^1.0.0"},devDependencies:{babel:"4.7.13",browserify:"^9.0.3",chai:"^2.0.0",eslint:"^0.15.1","babel-eslint":"^1.0.1",esvalid:"^1.1.0",istanbul:"^0.3.5",matcha:"^0.6.0",mocha:"^2.1.0",rimraf:"^2.2.8","uglify-js":"^2.4.16"}}},{}],453:[function(e,t){t.exports={"abstract-expression-call":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"PROPERTY",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"referenceGet",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"abstract-expression-delete":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"PROPERTY",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"referenceDelete",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"abstract-expression-get":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"PROPERTY",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"referenceGet",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"abstract-expression-set":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"PROPERTY",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"referenceSet",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"array-comprehension-container":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},init:{start:null,loc:null,range:null,elements:[],type:"ArrayExpression",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"array-from":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"from",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"array-push":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"push",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"STATEMENT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"call-instance-decorator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,type:"ThisExpression",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"INITIALIZERS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null}],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"call-static-decorator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"CONSTRUCTOR",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"INITIALIZERS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"CONSTRUCTOR",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},call:{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"CONTEXT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"class-decorator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"CLASS_REF",type:"Identifier",end:null},right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"DECORATOR",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"CLASS_REF",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},operator:"||",right:{start:null,loc:null,range:null,name:"CLASS_REF",type:"Identifier",end:null},type:"LogicalExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"class-super-constructor-call-loose":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"SUPER_NAME",type:"Identifier",end:null},operator:"!=",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"SUPER_NAME",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"apply",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null},{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"Program",end:null},"class-super-constructor-call":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"SUPER_NAME",type:"Identifier",end:null},operator:"!=",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"SUPER_NAME",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"apply",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null},{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"Program",end:null},"corejs-is-iterator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"CORE_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isIterable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"corejs-iterator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"CORE_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getIterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"default-parameter":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"VARIABLE_NAME",type:"Identifier",end:null},init:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARGUMENTS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"ARGUMENT_KEY",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,name:"DEFAULT_VALUE",type:"Identifier",end:null},alternate:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARGUMENTS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"ARGUMENT_KEY",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"ConditionalExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"let",type:"VariableDeclaration",end:null}],type:"Program",end:null},"exports-assign":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"exports-default-assign":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"module",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"VALUE",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"exports-from-assign":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"ID",type:"Identifier",end:null},{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"get",type:"Identifier",end:null},value:{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"get",type:"Identifier",end:null},generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"INIT",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"exports-module-declaration-loose":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"__esModule",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"exports-module-declaration":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},{start:null,loc:null,range:null,value:"__esModule",raw:null,type:"Literal",end:null},{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"for-of-array":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARR",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,name:"BODY",type:"Identifier",end:null},type:"ExpressionStatement",end:null,_paths:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"Program",end:null},"for-of-loose":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},init:{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"IS_ARRAY",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isArray",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},init:{loc:null,start:null,range:null,test:{start:null,loc:null,range:null,name:"IS_ARRAY",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},alternate:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ConditionalExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:null,update:null,body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ID",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"IS_ARRAY",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},operator:">=",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"BreakStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ID",type:"Identifier",end:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},property:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"LOOP_OBJECT",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"next",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"done",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"BreakStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ID",type:"Identifier",end:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"INDEX",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"Program",end:null},"for-of":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ITERATOR_COMPLETION",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:!1,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",type:"Identifier",end:null},init:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,block:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ITERATOR_KEY",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"OBJECT",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"STEP_KEY",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ITERATOR_COMPLETION",type:"Identifier",end:null},right:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"STEP_KEY",type:"Identifier",end:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ITERATOR_KEY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"next",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,parenthesizedExpression:!0,_paths:null},property:{start:null,loc:null,range:null,name:"done",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,parenthesizedExpression:!0,_paths:null},type:"UnaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ITERATOR_COMPLETION",type:"Identifier",end:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},handler:{start:null,loc:null,range:null,param:{start:null,loc:null,range:null,name:"err",type:"Identifier",end:null},guard:null,body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",type:"Identifier",end:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",type:"Identifier",end:null},right:{start:null,loc:null,range:null,name:"err",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"CatchClause",end:null,_scopeInfo:null,_paths:null},guardedHandlers:[],finalizer:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,block:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{start:null,loc:null,range:null,name:"ITERATOR_COMPLETION",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ITERATOR_KEY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"return",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ITERATOR_KEY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"return",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},handler:null,guardedHandlers:[],finalizer:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",type:"Identifier",end:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"TryStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"TryStatement",end:null,_paths:null}],type:"Program",end:null},"helper-async-to-generator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"fn",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"gen",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"fn",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"apply",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null},{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"Promise",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"resolve",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"reject",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"callNext",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"step",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"bind",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},{start:null,loc:null,range:null,value:"next",raw:null,type:"Literal",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"callThrow",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"step",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"bind",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},{start:null,loc:null,range:null,value:"throw",raw:null,type:"Literal",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"step",type:"Identifier",end:null},generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"arg",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,block:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"info",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"gen",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arg",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"info",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null}],type:"BlockStatement",end:null,_scopeInfo:null},handler:{start:null,loc:null,range:null,param:{start:null,loc:null,range:null,name:"error",type:"Identifier",end:null},guard:null,body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"reject",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"error",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:null,type:"ReturnStatement",end:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"CatchClause",end:null,_scopeInfo:null,_paths:null},guardedHandlers:[],finalizer:null,type:"TryStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"info",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"done",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"resolve",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Promise",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"resolve",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"then",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"callNext",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"callThrow",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"callNext",type:"Identifier",end:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null}],type:"NewExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-bind":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Function",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"bind",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-class-call-check":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"instance",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"instance",type:"Identifier",end:null},operator:"instanceof",right:{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},type:"BinaryExpression",end:null,parenthesizedExpression:!0,_paths:null},type:"UnaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,value:"Cannot call a class as a function",raw:null,type:"Literal",end:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-create-class":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"||",right:{start:null,loc:null,range:null,value:!1,raw:null,type:"Literal",end:null},type:"LogicalExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"configurable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"writable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-create-decorated-class":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"descriptors",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"initializers",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptors",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptors",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,operator:"delete",prefix:!0,argument:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"UnaryExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,leadingComments:null,_paths:null},{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,operator:"delete",prefix:!0,argument:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"UnaryExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"||",right:{start:null,loc:null,range:null,value:!1,raw:null,type:"Literal",end:null},type:"LogicalExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"configurable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,value:"value",raw:null,type:"Literal",end:null},operator:"in",right:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"||",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"initializer",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"writable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"f",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"f",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"f",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"decorator",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"decorators",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"f",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"decorator",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"function",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"decorator",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},operator:"||",right:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},type:"LogicalExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,value:"The decorator for method ",raw:null,type:"Literal",end:null},operator:"+",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},operator:"+",right:{start:null,loc:null,range:null,value:" is of the invalid type ",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"+",right:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"decorator",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"initializers",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"initializers",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"initializer",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"descriptor",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"protoInitializers",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticInitializers",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},{start:null,loc:null,range:null,name:"protoProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"protoInitializers",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"staticInitializers",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"Constructor",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-default-props":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"defaultProps",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"defaultProps",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,left:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"propName",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},right:{start:null,loc:null,range:null,name:"defaultProps",type:"Identifier",end:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"propName",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"undefined",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"propName",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"defaultProps",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"propName",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForInStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"props",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-defaults":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"defaults",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"keys",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getOwnPropertyNames",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"defaults",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"keys",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"keys",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getOwnPropertyDescriptor",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"defaults",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"configurable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-define-property":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},value:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},value:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},operator:"==",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"||",right:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"==",right:{start:null,loc:null,range:null,value:"undefined",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},operator:"||",right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"constructor",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"!==",right:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"configurable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"writable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-extends":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"assign",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"||",right:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:1,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"source",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,left:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},right:{start:null,loc:null,range:null,name:"source",type:"Identifier",end:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"hasOwnProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"source",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"source",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"key",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForInStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-get":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"get",type:"Identifier",end:null},generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getOwnPropertyDescriptor",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},operator:"===",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getPrototypeOf",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},operator:"===",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"get",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,value:"value",raw:null,type:"Literal",end:null},operator:"in",right:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"getter",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"get",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"getter",type:"Identifier",end:null},operator:"===",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"getter",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-has-own":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"hasOwnProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-inherits":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"subClass",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"!==",right:{start:null,loc:null,range:null,value:"function",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},operator:"!==",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,value:"Super expression must either be null or a function, not ",raw:null,type:"Literal",end:null},operator:"+",right:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"subClass",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"create",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"constructor",type:"Identifier",end:null},value:{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},value:{start:null,loc:null,range:null,name:"subClass",type:"Identifier",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"enumerable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!1,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"writable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"configurable",type:"Identifier",end:null},value:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null}],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"subClass",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"__proto__",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"superClass",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-interop-require-wildcard":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"__esModule",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},alternate:{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,value:"default",raw:null,type:"Literal",end:null},value:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null},type:"ConditionalExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-interop-require":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"__esModule",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"default",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},alternate:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},type:"ConditionalExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-object-destructuring-empty":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},operator:"==",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,value:"Cannot destructure undefined",raw:null,type:"Literal",end:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-object-without-properties":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"keys",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},init:{start:null,loc:null,range:null,properties:[],type:"ObjectExpression",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,left:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},right:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"keys",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"indexOf",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},operator:">=",right:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"ContinueStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"hasOwnProperty",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"UnaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"ContinueStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForInStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"target",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-self-global":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"global",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"undefined",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,name:"self",type:"Identifier",end:null},alternate:{start:null,loc:null,range:null,name:"global",type:"Identifier",end:null},type:"ConditionalExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-set":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"set",type:"Identifier",end:null},generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getOwnPropertyDescriptor",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},operator:"===",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"getPrototypeOf",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"object",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},operator:"!==",right:{start:null,loc:null,range:null,value:null,raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"set",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"parent",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"property",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,value:"value",raw:null,type:"Literal",end:null},operator:"in",right:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"writable",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"setter",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"desc",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"set",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"setter",type:"Identifier",end:null},operator:"!==",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"setter",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"call",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"receiver",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-slice":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"slice",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-sliced-to-array-loose":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isArray",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"in",right:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},init:{start:null,loc:null,range:null,elements:[],type:"ArrayExpression",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_iterator",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_step",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_step",type:"Identifier",end:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_iterator",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"next",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,parenthesizedExpression:!0,_paths:null},property:{start:null,loc:null,range:null,name:"done",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"UnaryExpression",end:null,_paths:null},update:null,body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"push",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_step",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"BreakStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,value:"Invalid attempt to destructure non-iterable instance",raw:null,type:"Literal",end:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-sliced-to-array":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isArray",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"in",right:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},init:{start:null,loc:null,range:null,elements:[],type:"ArrayExpression",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null,leadingComments:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_n",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_d",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:!1,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_e",type:"Identifier",end:null},init:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,block:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_i",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},property:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"iterator",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"_s",type:"Identifier",end:null},init:null,type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_n",type:"Identifier",end:null},right:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_s",type:"Identifier",end:null},right:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_i",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"next",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,parenthesizedExpression:!0,_paths:null},property:{start:null,loc:null,range:null,name:"done",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,parenthesizedExpression:!0,_paths:null},type:"UnaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_n",type:"Identifier",end:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"push",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_s",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,label:null,type:"BreakStatement",end:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},handler:{start:null,loc:null,range:null,param:{start:null,loc:null,range:null,name:"err",type:"Identifier",end:null},guard:null,body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_d",type:"Identifier",end:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{start:null,loc:null,range:null,name:"_e",type:"Identifier",end:null},right:{start:null,loc:null,range:null,name:"err",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"CatchClause",end:null,_scopeInfo:null,_paths:null},guardedHandlers:[],finalizer:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,block:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"!",prefix:!0,argument:{start:null,loc:null,range:null,name:"_n",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_i",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"return",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"_i",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"return",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},handler:null,guardedHandlers:[],finalizer:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"_d",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"_e",type:"Identifier",end:null},type:"ThrowStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"TryStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"TryStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"_arr",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"TypeError",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,value:"Invalid attempt to destructure non-iterable instance",raw:null,type:"Literal",end:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-tagged-template-literal-loose":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"strings",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"strings",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"strings",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-tagged-template-literal":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"strings",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"freeze",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"defineProperties",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"strings",type:"Identifier",end:null},{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null},value:{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"value",type:"Identifier",end:null},value:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"freeze",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"raw",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null}],type:"CallExpression",end:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-temporal-assert-defined":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"val",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"name",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"undef",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"val",type:"Identifier",end:null},operator:"===",right:{start:null,loc:null,range:null,name:"undef",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,callee:{start:null,loc:null,range:null,name:"ReferenceError",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"name",type:"Identifier",end:null},operator:"+",right:{start:null,loc:null,range:null,value:" is not defined - temporal dead zone",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null}],type:"NewExpression",end:null,_paths:null},type:"ThrowStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:null,type:"IfStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-temporal-undefined":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,properties:[],type:"ObjectExpression",end:null,parenthesizedExpression:!0},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-to-array":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isArray",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},alternate:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"from",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ConditionalExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-to-consumable-array":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"isArray",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"arr2",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},arguments:[{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},operator:"<",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr2",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"i",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"arr2",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"from",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"arr",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"helper-typeof":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},operator:"&&",right:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"constructor",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,name:"Symbol",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,value:"symbol",raw:null,type:"Literal",end:null},alternate:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"obj",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},type:"ConditionalExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"let-scoping-return":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"RETURN",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"object",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"RETURN",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"v",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null},alternate:null,type:"IfStatement",end:null,_paths:null}],type:"Program",end:null},"ludicrous-in":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"Object",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"RIGHT",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"LEFT",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},operator:"!==",right:{start:null,loc:null,range:null,name:"undefined",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"named-function":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"GET_OUTER_ID",type:"Identifier",end:null},generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"FUNCTION",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"property-method-assignment-wrapper-generator":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"FUNCTION_KEY",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},generator:!0,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,delegate:!0,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"apply",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null},{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"YieldExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"toString",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"toString",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"FUNCTION",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"property-method-assignment-wrapper":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"FUNCTION_KEY",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_KEY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"apply",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,type:"ThisExpression",end:null},{start:null,loc:null,range:null,name:"arguments",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionDeclaration",end:null,_scopeInfo:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"toString",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"toString",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[],type:"CallExpression",end:null,_paths:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"FUNCTION",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"prototype-identifier":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"CLASS_NAME",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"prototype",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"require-assign-key":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"VARIABLE_NAME",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"require",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"MODULE_NAME",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null}],type:"Program",end:null},require:{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"require",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"MODULE_NAME",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},rest:{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,init:{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"LEN",type:"Identifier",end:null},init:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARGUMENTS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"length",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"ARRAY",type:"Identifier",end:null},init:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"Array",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"ARRAY_LEN",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"VariableDeclarator",end:null,_paths:null},{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},init:{start:null,loc:null,range:null,name:"START",type:"Identifier",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},operator:"<",right:{start:null,loc:null,range:null,name:"LEN",type:"Identifier",end:null},type:"BinaryExpression",end:null,_paths:null},update:{loc:null,start:null,range:null,operator:"++",prefix:!1,argument:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},type:"UpdateExpression",end:null,_paths:null},body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARRAY",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"ARRAY_KEY",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"ARGUMENTS",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"KEY",type:"Identifier",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"ForStatement",end:null,_scopeInfo:null,_paths:null}],type:"Program",end:null},"self-contained-helpers-head":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},property:{start:null,loc:null,range:null,value:"default",raw:null,type:"Literal",end:null},computed:!0,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,name:"HELPER",type:"Identifier",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"__esModule",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},system:{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"System",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"register",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"MODULE_NAME",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"MODULE_DEPENDENCIES",type:"Identifier",end:null},{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"EXPORT_IDENTIFIER",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,argument:{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"setters",type:"Identifier",end:null},value:{start:null,loc:null,range:null,name:"SETTERS",type:"Identifier",end:null},kind:"init",type:"Property",end:null,_paths:null},{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"execute",type:"Identifier",end:null},value:{start:null,loc:null,range:null,name:"EXECUTE",type:"Identifier",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null},type:"ReturnStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"tail-call-body":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"AGAIN_ID",type:"Identifier",end:null},init:{start:null,loc:null,range:null,value:!0,raw:null,type:"Literal",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,body:{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"AGAIN_ID",type:"Identifier",end:null},body:{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,name:"BLOCK",type:"Identifier",end:null},type:"ExpressionStatement",end:null,_paths:null},type:"WhileStatement",end:null,_scopeInfo:null,_paths:null},label:{start:null,loc:null,range:null,name:"FUNCTION_ID",type:"Identifier",end:null},type:"LabeledStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null}],type:"Program",end:null},"test-exports":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"!==",right:{start:null,loc:null,range:null,value:"undefined",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"test-module":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"module",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"!==",right:{start:null,loc:null,range:null,value:"undefined",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"umd-commonjs-strict":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"root",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"function",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"amd",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"AMD_ARGUMENTS",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"object",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"COMMON_ARGUMENTS",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"BROWSER_ARGUMENTS",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},arguments:[{start:null,loc:null,range:null,name:"UMD_ROOT",type:"Identifier",end:null},{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"FACTORY_PARAMETERS",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,name:"FACTORY_BODY",type:"Identifier",end:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,_scopeInfo:null,_paths:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null},"umd-runner-body":{loc:null,start:null,range:null,body:[{start:null,loc:null,range:null,expression:{start:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{start:null,loc:null,range:null,name:"global",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null}],body:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,test:{loc:null,start:null,range:null,left:{loc:null,start:null,range:null,left:{start:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},type:"UnaryExpression",end:null,_paths:null},operator:"===",right:{start:null,loc:null,range:null,value:"function",raw:null,type:"Literal",end:null},type:"BinaryExpression",end:null,_paths:null},operator:"&&",right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"amd",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"LogicalExpression",end:null,_paths:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"define",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"AMD_ARGUMENTS",type:"Identifier",end:null},{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,test:{start:null,loc:null,range:null,name:"COMMON_TEST",type:"Identifier",end:null},consequent:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"COMMON_ARGUMENTS",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},alternate:{start:null,loc:null,range:null,body:[{start:null,loc:null,range:null,declarations:[{start:null,loc:null,range:null,id:{start:null,loc:null,range:null,name:"module",type:"Identifier",end:null},init:{start:null,loc:null,range:null,properties:[{start:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},value:{start:null,loc:null,range:null,properties:[],type:"ObjectExpression",end:null},kind:"init",type:"Property",end:null,_paths:null}],type:"ObjectExpression",end:null},type:"VariableDeclarator",end:null,_paths:null}],kind:"var",type:"VariableDeclaration",end:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,callee:{start:null,loc:null,range:null,name:"factory",type:"Identifier",end:null},arguments:[{start:null,loc:null,range:null,name:"BROWSER_ARGUMENTS",type:"Identifier",end:null}],type:"CallExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null},{start:null,loc:null,range:null,expression:{loc:null,start:null,range:null,operator:"=",left:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"global",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"GLOBAL_ARG",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},right:{loc:null,start:null,range:null,object:{start:null,loc:null,range:null,name:"module",type:"Identifier",end:null},property:{start:null,loc:null,range:null,name:"exports",type:"Identifier",end:null},computed:!1,type:"MemberExpression",end:null,_paths:null},type:"AssignmentExpression",end:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"BlockStatement",end:null,_scopeInfo:null},type:"IfStatement",end:null,_paths:null},type:"IfStatement",end:null,_paths:null}],type:"BlockStatement",end:null},type:"FunctionExpression",end:null,parenthesizedExpression:!0,_scopeInfo:null,_paths:null},type:"ExpressionStatement",end:null,_paths:null}],type:"Program",end:null}} },{}]},{},[19])(19)});
node_modules/bs-recipes/recipes/webpack.react-hot-loader/app/js/main.js
quanzhiyuan/myGruntProject
import React from 'react'; import { render } from 'react-dom'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; render(<HelloWorld />, document.getElementById('react-root'));
src/parser/priest/holy/modules/checklist/Component.js
FaideWW/WoWAnalyzer
import React from 'react'; import PropTypes from 'prop-types'; import SPELLS from 'common/SPELLS'; // import ITEMS from 'common/ITEMS'; import SpellLink from 'common/SpellLink'; // import ItemLink from 'common/ItemLink'; import ResourceLink from 'common/ResourceLink'; import RESOURCE_TYPES from 'game/RESOURCE_TYPES'; import Checklist from 'parser/shared/modules/features/Checklist2'; import Rule from 'parser/shared/modules/features/Checklist2/Rule'; import Requirement from 'parser/shared/modules/features/Checklist2/Requirement'; import PreparationRule from 'parser/shared/modules/features/Checklist2/PreparationRule'; import GenericCastEfficiencyRequirement from 'parser/shared/modules/features/Checklist2/GenericCastEfficiencyRequirement'; class HolyPriestChecklist extends React.PureComponent { static propTypes = { castEfficiency: PropTypes.object.isRequired, combatant: PropTypes.shape({ hasTalent: PropTypes.func.isRequired, hasTrinket: PropTypes.func.isRequired, }).isRequired, thresholds: PropTypes.object.isRequired, }; render() { const { combatant, castEfficiency, thresholds } = this.props; const AbilityRequirement = props => ( <GenericCastEfficiencyRequirement castEfficiency={castEfficiency.getCastEfficiencyForSpellId(props.spell)} {...props} /> ); return ( <Checklist> <Rule name="Use core abilities as often as possible" description={( <> Using your core abilities as often as possible will typically result in better performance, remember to <SpellLink id={SPELLS.SMITE.id} /> as often as you can! </> )} > <AbilityRequirement spell={SPELLS.HOLY_WORD_SERENITY.id} /> <AbilityRequirement spell={SPELLS.HOLY_WORD_SANCTIFY.id} /> <AbilityRequirement spell={SPELLS.PRAYER_OF_MENDING_CAST.id} /> {combatant.hasTalent(SPELLS.DIVINE_STAR_TALENT.id) && ( <AbilityRequirement spell={SPELLS.DIVINE_STAR_TALENT.id} /> )} {combatant.hasTalent(SPELLS.HALO_TALENT.id) && ( <AbilityRequirement spell={SPELLS.HALO_TALENT.id} /> )} {combatant.hasTalent(SPELLS.CIRCLE_OF_HEALING_TALENT.id) && ( <AbilityRequirement spell={SPELLS.CIRCLE_OF_HEALING_TALENT.id} /> )} </Rule> <Rule name="Use cooldowns effectively" description={( <> Cooldowns are an important part of healing, try to use them to counter fight mechanics. For example if a boss has burst damage every 3 minutes, <SpellLink id={SPELLS.DIVINE_HYMN_CAST.id} /> should be used to counter it. </> )} > <AbilityRequirement spell={SPELLS.GUARDIAN_SPIRIT.id} /> <AbilityRequirement spell={SPELLS.DIVINE_HYMN_CAST.id} /> <AbilityRequirement spell={SPELLS.DESPERATE_PRAYER.id} /> <AbilityRequirement spell={SPELLS.SYMBOL_OF_HOPE.id} /> {combatant.hasTalent(SPELLS.HOLY_WORD_SALVATION_TALENT.id) && ( <AbilityRequirement spell={SPELLS.HOLY_WORD_SALVATION_TALENT.id} /> )} {combatant.hasTalent(SPELLS.APOTHEOSIS_TALENT.id) && ( <AbilityRequirement spell={SPELLS.APOTHEOSIS_TALENT.id} /> )} {/* We can't detect race, so disable this when it has never been cast. */} {castEfficiency.getCastEfficiencyForSpellId(SPELLS.ARCANE_TORRENT_MANA1.id) && ( <AbilityRequirement spell={SPELLS.ARCANE_TORRENT_MANA1.id} /> )} </Rule> <Rule name="Try to avoid being inactive for a large portion of the fight" description={( <> High downtime is inexcusable, while it may be tempting to not cast and save mana, Holy's damage filler <SpellLink id={SPELLS.SMITE.id} /> is free. You can reduce your downtime by reducing the delay between casting spells, anticipating movement, moving during the GCD, and <dfn data-tip="You can ignore this while learning Holy, but contributing DPS whilst healing is a major part of becoming a better than average player.">when you're not healing try to contribute some damage.*</dfn>. </> )} > <Requirement name="Non healing time" thresholds={thresholds.nonHealingTimeSuggestionThresholds} /> <Requirement name="Downtime" thresholds={thresholds.downtimeSuggestionThresholds} /> </Rule> <Rule name={<>Use all of your <ResourceLink id={RESOURCE_TYPES.MANA.id} /> effectively</>} description="If you have a large amount of mana left at the end of the fight that's mana you could have turned into healing. Try to use all your mana during a fight. A good rule of thumb is to try to match your mana level with the boss's health." > <Requirement name="Mana left" thresholds={thresholds.manaLeft} /> </Rule> <PreparationRule thresholds={thresholds} /> </Checklist> ); } } export default HolyPriestChecklist;
Demo/index.ios.js
githubdelegate/RNDemo
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, PixelRatio } from 'react-native'; var IndexView = require('./code/indexview'); var Navi = require('./code/navigator/navigatorDemo'); var Search = require('./code/textinput/textinput'); var Touch = require('./code/touchable/touchable'); var Tabbar = require('./code/tabbar/tabbar'); var app = React.createClass({ render:function(){ // 基本 // return (<IndexView></IndexView>); // 导航 // return (<Navi></Navi>); // textinput // return (<Search></Search>); // touchable // return (<Touch></Touch>); return (<Tabbar></Tabbar>); } }); AppRegistry.registerComponent('Demo',() => app);
project/project/public/static-root/admin/js/jquery.js
waterdotorg/power.Water
/*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function( window, undefined ) { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // Use the correct document accordingly with window argument (sandbox) document = window.document, // A central reference to the root jQuery(document) rootjQuery, // A simple way to check for HTML strings or ID strings // (both of which we optimize for) quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, // Is it a simple selector isSimple = /^.[^:#\[\.,]*$/, // Check if a string has a non-whitespace character in it rnotwhite = /\S/, // Used for trimming whitespace rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, // Keep a UserAgent string for use with jQuery.browser userAgent = navigator.userAgent, // For matching the engine and version of the browser browserMatch, // Has the ready events already been bound? readyBound = false, // The functions to execute on DOM ready readyList = [], // The ready event handler DOMContentLoaded, // Save a reference to some core methods toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, push = Array.prototype.push, slice = Array.prototype.slice, indexOf = Array.prototype.indexOf; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) if ( !selector ) { return this; } // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; } // The body element only exists once, optimize finding it if ( selector === "body" && !context ) { this.context = document; this[0] = document.body; this.selector = "body"; this.length = 1; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? match = quickExpr.exec( selector ); // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { doc = (context ? context.ownerDocument || context : document); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest ret = rsingleTag.exec( selector ); if ( ret ) { if ( jQuery.isPlainObject( context ) ) { selector = [ document.createElement( ret[1] ) ]; jQuery.fn.attr.call( selector, context, true ); } else { selector = [ doc.createElement( ret[1] ) ]; } } else { ret = buildFragment( [ match[1] ], [ doc ] ); selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; } return jQuery.merge( this, selector ); // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); if ( elem ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $("TAG") } else if ( !context && /^\w+$/.test( selector ) ) { this.selector = selector; this.context = document; selector = document.getElementsByTagName( selector ); return jQuery.merge( this, selector ); // 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 jQuery( context ).find( selector ); } // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.4.2", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return slice.call( this, 0 ); }, // 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 a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery(); if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); } else { jQuery.merge( ret, elems ); } // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) { ret.selector = this.selector + (this.selector ? " " : "") + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } // 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 ); }, ready: function( fn ) { // Attach the listeners jQuery.bindReady(); // If the DOM is already ready if ( jQuery.isReady ) { // Execute the function immediately fn.call( document, jQuery ); // Otherwise, remember the function for later } else if ( readyList ) { // Add the function to the wait list readyList.push( fn ); } return this; }, eq: function( i ) { return i === -1 ? this.slice( i ) : this.slice( i, +i + 1 ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ), "slice", slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || jQuery(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // 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 ( length === i ) { 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 object literal values or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src : jQuery.isArray(copy) ? [] : {}; // 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({ noConflict: function( deep ) { window.$ = _$; if ( deep ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // Handle when the DOM is ready ready: function() { // Make sure that the DOM is not already loaded if ( !jQuery.isReady ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready, 13 ); } // Remember that the DOM is ready jQuery.isReady = true; // If there are functions bound, to execute if ( readyList ) { // Execute all of them var fn, i = 0; while ( (fn = readyList[ i++ ]) ) { fn.call( document, jQuery ); } // Reset the list of functions readyList = null; } // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); } } }, bindReady: function() { if ( readyBound ) { return; } readyBound = true; // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { return jQuery.ready(); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); // If IE and not a frame // continually check to see if the document is ready var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); } } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return toString.call(obj) === "[object Function]"; }, isArray: function( obj ) { return toString.call(obj) === "[object Array]"; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { return false; } // Not own constructor property must be Object if ( obj.constructor && !hasOwnProperty.call(obj, "constructor") && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || hasOwnProperty.call( obj, key ); }, isEmptyObject: function( obj ) { for ( var name in obj ) { return false; } return true; }, error: function( msg ) { throw msg; }, parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { // Try to use the native JSON parser first return window.JSON && window.JSON.parse ? window.JSON.parse( data ) : (new Function("return " + data))(); } else { jQuery.error( "Invalid JSON: " + data ); } }, noop: function() {}, // Evalulates a script in a global context globalEval: function( data ) { if ( data && rnotwhite.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; if ( jQuery.support.scriptEval ) { script.appendChild( document.createTextNode( data ) ); } else { script.text = data; } // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction(object); if ( args ) { if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.apply( object[ i++ ], args ) === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isObj ) { for ( name in object ) { if ( callback.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} } } return object; }, trim: function( text ) { return (text || "").replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // The extra typeof function check is to prevent crashes // in Safari 2 (See: #3039) if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, inArray: function( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; }, merge: function( first, second ) { var i = first.length, j = 0; if ( typeof second.length === "number" ) { for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var ret = []; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) { if ( !inv !== !callback( elems[ i ], i ) ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var ret = [], value; // Go through the array, translating each of the items to their // new value (or values). for ( var i = 0, length = elems.length; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } return ret.concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, proxy: function( fn, proxy, thisObject ) { if ( arguments.length === 2 ) { if ( typeof proxy === "string" ) { thisObject = fn; fn = thisObject[ proxy ]; proxy = undefined; } else if ( proxy && !jQuery.isFunction( proxy ) ) { thisObject = proxy; proxy = undefined; } } if ( !proxy && fn ) { proxy = function() { return fn.apply( thisObject || this, arguments ); }; } // Set the guid of unique handler to the same of original handler, so it can be removed if ( fn ) { proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; } // So proxy can be declared as an argument return proxy; }, // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser uaMatch: function( ua ) { ua = ua.toLowerCase(); var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }, browser: {} }); browserMatch = jQuery.uaMatch( userAgent ); if ( browserMatch.browser ) { jQuery.browser[ browserMatch.browser ] = true; jQuery.browser.version = browserMatch.version; } // Deprecated, use jQuery.browser.webkit instead if ( jQuery.browser.webkit ) { jQuery.browser.safari = true; } if ( indexOf ) { jQuery.inArray = function( elem, array ) { return indexOf.call( array, elem ); }; } // All jQuery objects should point back to these rootjQuery = jQuery(document); // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); jQuery.ready(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); jQuery.ready(); } }; } // The DOM ready check for Internet Explorer function doScrollCheck() { if ( jQuery.isReady ) { return; } try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( doScrollCheck, 1 ); return; } // and execute any waiting functions jQuery.ready(); } function evalScript( i, elem ) { if ( elem.src ) { jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); } else { jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } // Mutifunctional method to get and set values to a collection // The value/s can be optionally by executed if its a function function access( elems, key, value, exec, fn, pass ) { var length = elems.length; // Setting many attributes if ( typeof key === "object" ) { for ( var k in key ) { access( elems, k, key[k], exec, fn, value ); } return elems; } // Setting one attribute if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = !pass && exec && jQuery.isFunction(value); for ( var i = 0; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } return elems; } // Getting an attribute return length ? fn( elems[0], key ) : undefined; } function now() { return (new Date).getTime(); } (function() { jQuery.support = {}; var root = document.documentElement, script = document.createElement("script"), div = document.createElement("div"), id = "script" + now(); div.style.display = "none"; div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; var all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0]; // Can't get basic test support if ( !all || !all.length || !a ) { return; } jQuery.support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText insted) style: /red/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.55$/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Make sure that if no value is specified for a checkbox // that it defaults to "on". // (WebKit defaults to "" instead) checkOn: div.getElementsByTagName("input")[0].value === "on", // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null, // Will be defined later deleteExpando: true, checkClone: false, scriptEval: false, noCloneEvent: true, boxModel: null }; script.type = "text/javascript"; try { script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); } catch(e) {} root.insertBefore( script, root.firstChild ); // Make sure that the execution of code works by injecting a script // tag with appendChild/createTextNode // (IE doesn't support this, fails, and uses .text instead) if ( window[ id ] ) { jQuery.support.scriptEval = true; delete window[ id ]; } // Test to see if it's possible to delete an expando from an element // Fails in Internet Explorer try { delete script.test; } catch(e) { jQuery.support.deleteExpando = false; } root.removeChild( script ); if ( div.attachEvent && div.fireEvent ) { div.attachEvent("onclick", function click() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; div.detachEvent("onclick", click); }); div.cloneNode(true).fireEvent("onclick"); } div = document.createElement("div"); div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>"; var fragment = document.createDocumentFragment(); fragment.appendChild( div.firstChild ); // WebKit doesn't clone checked state correctly in fragments jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; // Figure out if the W3C box model works as expected // document.body must exist before we can do this jQuery(function() { var div = document.createElement("div"); div.style.width = div.style.paddingLeft = "1px"; document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; document.body.removeChild( div ).style.display = 'none'; div = null; }); // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ var eventSupported = function( eventName ) { var el = document.createElement("div"); eventName = "on" + eventName; var isSupported = (eventName in el); if ( !isSupported ) { el.setAttribute(eventName, "return;"); isSupported = typeof el[eventName] === "function"; } el = null; return isSupported; }; jQuery.support.submitBubbles = eventSupported("submit"); jQuery.support.changeBubbles = eventSupported("change"); // release memory in IE root = script = div = all = a = null; })(); jQuery.props = { "for": "htmlFor", "class": "className", readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", colspan: "colSpan", tabindex: "tabIndex", usemap: "useMap", frameborder: "frameBorder" }; var expando = "jQuery" + now(), uuid = 0, windowData = {}; jQuery.extend({ cache: {}, expando:expando, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, "object": true, "applet": true }, data: function( elem, name, data ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { return; } elem = elem == window ? windowData : elem; var id = elem[ expando ], cache = jQuery.cache, thisCache; if ( !id && typeof name === "string" && data === undefined ) { return null; } // Compute a unique ID for the element if ( !id ) { id = ++uuid; } // Avoid generating a new cache unless none exists and we // want to manipulate it. if ( typeof name === "object" ) { elem[ expando ] = id; thisCache = cache[ id ] = jQuery.extend(true, {}, name); } else if ( !cache[ id ] ) { elem[ expando ] = id; cache[ id ] = {}; } thisCache = cache[ id ]; // Prevent overriding the named cache with undefined values if ( data !== undefined ) { thisCache[ name ] = data; } return typeof name === "string" ? thisCache[ name ] : thisCache; }, removeData: function( elem, name ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { return; } elem = elem == window ? windowData : elem; var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; // If we want to remove a specific section of the element's data if ( name ) { if ( thisCache ) { // Remove the section of cache data delete thisCache[ name ]; // If we've removed all the data, remove the element's cache if ( jQuery.isEmptyObject(thisCache) ) { jQuery.removeData( elem ); } } // Otherwise, we want to remove all of the element's data } else { if ( jQuery.support.deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } // Completely remove the data cache delete cache[ id ]; } } }); jQuery.fn.extend({ data: function( key, value ) { if ( typeof key === "undefined" && this.length ) { return jQuery.data( this[0] ); } else if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); if ( data === undefined && this.length ) { data = jQuery.data( this[0], key ); } return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else { return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { jQuery.data( this, key, value ); }); } }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); jQuery.extend({ queue: function( elem, type, data ) { if ( !elem ) { return; } type = (type || "fx") + "queue"; var q = jQuery.data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( !data ) { return q || []; } if ( !q || jQuery.isArray(data) ) { q = jQuery.data( elem, type, jQuery.makeArray(data) ); } else { q.push( data ); } return q; }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), fn = queue.shift(); // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift("inprogress"); } fn.call(elem, function() { jQuery.dequeue(elem, type); }); } } }); jQuery.fn.extend({ queue: function( type, data ) { if ( typeof type !== "string" ) { data = type; type = "fx"; } if ( data === undefined ) { return jQuery.queue( this[0], type ); } return this.each(function( i, elem ) { var queue = jQuery.queue( this, type, data ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx"; return this.queue( type, function() { var elem = this; setTimeout(function() { jQuery.dequeue( elem, type ); }, time ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); } }); var rclass = /[\n\t]/g, rspace = /\s+/, rreturn = /\r/g, rspecialurl = /href|src|style/, rtype = /(button|input)/i, rfocusable = /(button|input|object|select|textarea)/i, rclickable = /^(a|area)$/i, rradiocheck = /radio|checkbox/; jQuery.fn.extend({ attr: function( name, value ) { return access( this, name, value, true, jQuery.attr ); }, removeAttr: function( name, fn ) { return this.each(function(){ jQuery.attr( this, name, "" ); if ( this.nodeType === 1 ) { this.removeAttribute( name ); } }); }, addClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.addClass( value.call(this, i, self.attr("class")) ); }); } if ( value && typeof value === "string" ) { var classNames = (value || "").split( rspace ); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 ) { if ( !elem.className ) { elem.className = value; } else { var className = " " + elem.className + " ", setClass = elem.className; for ( var c = 0, cl = classNames.length; c < cl; c++ ) { if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { setClass += " " + classNames[c]; } } elem.className = jQuery.trim( setClass ); } } } } return this; }, removeClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.removeClass( value.call(this, i, self.attr("class")) ); }); } if ( (value && typeof value === "string") || value === undefined ) { var classNames = (value || "").split(rspace); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 && elem.className ) { if ( value ) { var className = (" " + elem.className + " ").replace(rclass, " "); for ( var c = 0, cl = classNames.length; c < cl; c++ ) { className = className.replace(" " + classNames[c] + " ", " "); } elem.className = jQuery.trim( className ); } else { elem.className = ""; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this); self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery(this), state = stateVal, classNames = value.split( rspace ); while ( (className = classNames[ i++ ]) ) { // check each className given, space seperated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } } else if ( type === "undefined" || type === "boolean" ) { if ( this.className ) { // store className if set jQuery.data( this, "__className__", this.className ); } // toggle whole className this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " "; for ( var i = 0, l = this.length; i < l; i++ ) { if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { return true; } } return false; }, val: function( value ) { if ( value === undefined ) { var elem = this[0]; if ( elem ) { if ( jQuery.nodeName( elem, "option" ) ) { return (elem.attributes.value || {}).specified ? elem.value : elem.text; } // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; // Nothing was selected if ( index < 0 ) { return null; } // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // Get the specifc value for the option value = jQuery(option).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; } // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { return elem.getAttribute("value") === null ? "on" : elem.value; } // Everything else, we just grab the value return (elem.value || "").replace(rreturn, ""); } return undefined; } var isFunction = jQuery.isFunction(value); return this.each(function(i) { var self = jQuery(this), val = value; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call(this, i, self.val()); } // Typecast each time if the value is a Function and the appended // value is therefore different each time. if ( typeof val === "number" ) { val += ""; } if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { this.checked = jQuery.inArray( self.val(), val ) >= 0; } else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(val); jQuery( "option", this ).each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { this.selectedIndex = -1; } } else { this.value = val; } }); } }); jQuery.extend({ attrFn: { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true }, attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); } var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), // Whether we are setting (or getting) set = value !== undefined; // Try to normalize/fix the name name = notxml && jQuery.props[ name ] || name; // Only do all the following if this is a node (faster for style) if ( elem.nodeType === 1 ) { // These attributes require special treatment var special = rspecialurl.test( name ); // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( name === "selected" && !jQuery.support.optSelected ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } // If applicable, access the attribute via the DOM 0 way if ( name in elem && notxml && !special ) { if ( set ) { // We can't allow the type property to be changed (since it causes problems in IE) if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { jQuery.error( "type property can't be changed" ); } elem[ name ] = value; } // browsers index elements by id/name on forms, give priority to attributes. if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { return elem.getAttributeNode( name ).nodeValue; } // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ if ( name === "tabIndex" ) { var attributeNode = elem.getAttributeNode( "tabIndex" ); return attributeNode && attributeNode.specified ? attributeNode.value : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } return elem[ name ]; } if ( !jQuery.support.style && notxml && name === "style" ) { if ( set ) { elem.style.cssText = "" + value; } return elem.style.cssText; } if ( set ) { // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); } var attr = !jQuery.support.hrefNormalized && notxml && special ? // Some attributes require a special call on IE elem.getAttribute( name, 2 ) : elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return attr === null ? undefined : attr; } // elem is actually elem.style ... set the style // Using attr for specific style information is now deprecated. Use style instead. return jQuery.style( elem, name, value ); } }); var rnamespaces = /\.(.*)$/, fcleanup = function( nm ) { return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { return "\\" + ch; }); }; /* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { // Bind an event to an element // Original by Dean Edwards add: function( elem, types, handler, data ) { if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { elem = window; } var handleObjIn, handleObj; if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; } // Make sure that the function being executed has a unique ID if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure var elemData = jQuery.data( elem ); // If no elemData is found then we must be trying to bind to one of the // banned noData elements if ( !elemData ) { return; } var events = elemData.events = elemData.events || {}, eventHandle = elemData.handle, eventHandle; if ( !eventHandle ) { elemData.handle = eventHandle = function() { // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply( eventHandle.elem, arguments ) : undefined; }; } // Add elem as a property of the handle function // This is to prevent a memory leak with non-native events in IE. eventHandle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = types.split(" "); var type, i = 0, namespaces; while ( (type = types[ i++ ]) ) { handleObj = handleObjIn ? jQuery.extend({}, handleObjIn) : { handler: handler, data: data }; // Namespaced event handlers if ( type.indexOf(".") > -1 ) { namespaces = type.split("."); type = namespaces.shift(); handleObj.namespace = namespaces.slice(0).sort().join("."); } else { namespaces = []; handleObj.namespace = ""; } handleObj.type = type; handleObj.guid = handler.guid; // Get the current list of functions bound to this event var handlers = events[ type ], special = jQuery.event.special[ type ] || {}; // Init the event handler queue if ( !handlers ) { handlers = events[ type ] = []; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add the function to the element's handler list handlers.push( handleObj ); // Keep track of which events have been used, for global triggering jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, global: {}, // Detach an event or set of events from an element remove: function( elem, types, handler, pos ) { // don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, elemData = jQuery.data( elem ), events = elemData && elemData.events; if ( !elemData || !events ) { return; } // types is actually an event object here if ( types && types.type ) { handler = types.handler; types = types.type; } // Unbind all events for the element if ( !types || typeof types === "string" && types.charAt(0) === "." ) { types = types || ""; for ( type in events ) { jQuery.event.remove( elem, type + types ); } return; } // Handle multiple events separated by a space // jQuery(...).unbind("mouseover mouseout", fn); types = types.split(" "); while ( (type = types[ i++ ]) ) { origType = type; handleObj = null; all = type.indexOf(".") < 0; namespaces = []; if ( !all ) { // Namespaced event handlers namespaces = type.split("."); type = namespaces.shift(); namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") } eventType = events[ type ]; if ( !eventType ) { continue; } if ( !handler ) { for ( var j = 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( all || namespace.test( handleObj.namespace ) ) { jQuery.event.remove( elem, origType, handleObj.handler, j ); eventType.splice( j--, 1 ); } } continue; } special = jQuery.event.special[ type ] || {}; for ( var j = pos || 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( handler.guid === handleObj.guid ) { // remove the given handler for the given type if ( all || namespace.test( handleObj.namespace ) ) { if ( pos == null ) { eventType.splice( j--, 1 ); } if ( special.remove ) { special.remove.call( elem, handleObj ); } } if ( pos != null ) { break; } } } // remove generic event handler if no more handlers exist if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { removeEvent( elem, type, elemData.handle ); } ret = null; delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { var handle = elemData.handle; if ( handle ) { handle.elem = null; } delete elemData.events; delete elemData.handle; if ( jQuery.isEmptyObject( elemData ) ) { jQuery.removeData( elem ); } } }, // bubbling is internal trigger: function( event, data, elem /*, bubbling */ ) { // Event object or event type var type = event.type || event, bubbling = arguments[3]; if ( !bubbling ) { event = typeof event === "object" ? // jQuery.Event object event[expando] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type (string) jQuery.Event(type); if ( type.indexOf("!") >= 0 ) { event.type = type = type.slice(0, -1); event.exclusive = true; } // Handle a global trigger if ( !elem ) { // Don't bubble custom events when global (to avoid too much overhead) event.stopPropagation(); // Only trigger if we've ever bound an event for it if ( jQuery.event.global[ type ] ) { jQuery.each( jQuery.cache, function() { if ( this.events && this.events[type] ) { jQuery.event.trigger( event, data, this.handle.elem ); } }); } } // Handle triggering a single element // don't do events on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } // Clean up in case it is reused event.result = undefined; event.target = elem; // Clone the incoming data, if any data = jQuery.makeArray( data ); data.unshift( event ); } event.currentTarget = elem; // Trigger the event, it is assumed that "handle" is a function var handle = jQuery.data( elem, "handle" ); if ( handle ) { handle.apply( elem, data ); } var parent = elem.parentNode || elem.ownerDocument; // Trigger an inline bound script try { if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { event.result = false; } } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (e) {} if ( !event.isPropagationStopped() && parent ) { jQuery.event.trigger( event, data, parent, true ); } else if ( !event.isDefaultPrevented() ) { var target = event.target, old, isClick = jQuery.nodeName(target, "a") && type === "click", special = jQuery.event.special[ type ] || {}; if ( (!special._default || special._default.call( elem, event ) === false) && !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { try { if ( target[ type ] ) { // Make sure that we don't accidentally re-trigger the onFOO events old = target[ "on" + type ]; if ( old ) { target[ "on" + type ] = null; } jQuery.event.triggered = true; target[ type ](); } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (e) {} if ( old ) { target[ "on" + type ] = old; } jQuery.event.triggered = false; } } }, handle: function( event ) { var all, handlers, namespaces, namespace, events; event = arguments[0] = jQuery.event.fix( event || window.event ); event.currentTarget = this; // Namespaced event handlers all = event.type.indexOf(".") < 0 && !event.exclusive; if ( !all ) { namespaces = event.type.split("."); event.type = namespaces.shift(); namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); } var events = jQuery.data(this, "events"), handlers = events[ event.type ]; if ( events && handlers ) { // Clone the handlers to prevent manipulation handlers = handlers.slice(0); for ( var j = 0, l = handlers.length; j < l; j++ ) { var handleObj = handlers[ j ]; // Filter the functions by class if ( all || namespace.test( handleObj.namespace ) ) { // Pass in a reference to the handler function itself // So that we can later remove it event.handler = handleObj.handler; event.data = handleObj.data; event.handleObj = handleObj; var ret = handleObj.handler.apply( this, arguments ); if ( ret !== undefined ) { event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } if ( event.isImmediatePropagationStopped() ) { break; } } } } return event.result; }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function( event ) { if ( event[ expando ] ) { return event; } // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; event = jQuery.Event( originalEvent ); for ( var i = this.props.length, prop; i; ) { prop = this.props[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary if ( !event.target ) { event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either } // check if target is a textnode (safari) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Add relatedTarget, if necessary if ( !event.relatedTarget && event.fromElement ) { event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; } // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } // Add which for key events if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { event.which = event.charCode || event.keyCode; } // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) if ( !event.metaKey && event.ctrlKey ) { event.metaKey = event.ctrlKey; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && event.button !== undefined ) { event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); } return event; }, // Deprecated, use jQuery.guid instead guid: 1E8, // Deprecated, use jQuery.proxy instead proxy: jQuery.proxy, special: { ready: { // Make sure the ready event is setup setup: jQuery.bindReady, teardown: jQuery.noop }, live: { add: function( handleObj ) { jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); }, remove: function( handleObj ) { var remove = true, type = handleObj.origType.replace(rnamespaces, ""); jQuery.each( jQuery.data(this, "events").live || [], function() { if ( type === this.origType.replace(rnamespaces, "") ) { remove = false; return false; } }); if ( remove ) { jQuery.event.remove( this, handleObj.origType, liveHandler ); } } }, beforeunload: { setup: function( data, namespaces, eventHandle ) { // We only want to do this special case on windows if ( this.setInterval ) { this.onbeforeunload = eventHandle; } return false; }, teardown: function( namespaces, eventHandle ) { if ( this.onbeforeunload === eventHandle ) { this.onbeforeunload = null; } } } } }; var removeEvent = document.removeEventListener ? function( elem, type, handle ) { elem.removeEventListener( type, handle, false ); } : function( elem, type, handle ) { elem.detachEvent( "on" + type, handle ); }; jQuery.Event = function( src ) { // Allow instantiation without the 'new' keyword if ( !this.preventDefault ) { return new jQuery.Event( src ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Event type } else { this.type = src; } // timeStamp is buggy for some events on Firefox(#3843) // So we won't rely on the native value this.timeStamp = now(); // Mark it as fixed this[ expando ] = true; }; function returnFalse() { return false; } function returnTrue() { return 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 = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); } // otherwise set the returnValue property of the original event to false (IE) e.returnValue = false; }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if stopPropagation exists run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function( event ) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Firefox sometimes assigns relatedTarget a XUL element // which we cannot access the parentNode property of try { // Traverse up the tree while ( parent && parent !== this ) { parent = parent.parentNode; } if ( parent !== this ) { // set the correct event type event.type = event.data; // handle event if we actually just moused on to a non sub-element jQuery.event.handle.apply( this, arguments ); } // assuming we've left the element since we most likely mousedover a xul element } catch(e) { } }, // In case of event delegation, we only need to rename the event.type, // liveHandler will take care of the rest. delegate = function( event ) { event.type = event.data; jQuery.event.handle.apply( this, arguments ); }; // Create mouseenter and mouseleave events jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { setup: function( data ) { jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); }, teardown: function( data ) { jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); } }; }); // submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function( data, namespaces ) { if ( this.nodeName.toLowerCase() !== "form" ) { jQuery.event.add(this, "click.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { return trigger( "submit", this, arguments ); } }); jQuery.event.add(this, "keypress.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { return trigger( "submit", this, arguments ); } }); } else { return false; } }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialSubmit" ); } }; } // change delegation, happens here so we have bind. if ( !jQuery.support.changeBubbles ) { var formElems = /textarea|input|select/i, changeFilters, getVal = function( elem ) { var type = elem.type, val = elem.value; if ( type === "radio" || type === "checkbox" ) { val = elem.checked; } else if ( type === "select-multiple" ) { val = elem.selectedIndex > -1 ? jQuery.map( elem.options, function( elem ) { return elem.selected; }).join("-") : ""; } else if ( elem.nodeName.toLowerCase() === "select" ) { val = elem.selectedIndex; } return val; }, testChange = function testChange( e ) { var elem = e.target, data, val; if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { return; } data = jQuery.data( elem, "_change_data" ); val = getVal(elem); // the current data will be also retrieved by beforeactivate if ( e.type !== "focusout" || elem.type !== "radio" ) { jQuery.data( elem, "_change_data", val ); } if ( data === undefined || val === data ) { return; } if ( data != null || val ) { e.type = "change"; return jQuery.event.trigger( e, arguments[1], elem ); } }; jQuery.event.special.change = { filters: { focusout: testChange, click: function( e ) { var elem = e.target, type = elem.type; if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { return testChange.call( this, e ); } }, // Change has to be called before submit // Keydown will be called before keypress, which is used in submit-event delegation keydown: function( e ) { var elem = e.target, type = elem.type; if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || type === "select-multiple" ) { return testChange.call( this, e ); } }, // Beforeactivate happens also before the previous element is blurred // with this event you can't trigger a change event, but you can store // information/focus[in] is not needed anymore beforeactivate: function( e ) { var elem = e.target; jQuery.data( elem, "_change_data", getVal(elem) ); } }, setup: function( data, namespaces ) { if ( this.type === "file" ) { return false; } for ( var type in changeFilters ) { jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); } return formElems.test( this.nodeName ); }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialChange" ); return formElems.test( this.nodeName ); } }; changeFilters = jQuery.event.special.change.filters; } function trigger( type, elem, args ) { args[0].type = type; return jQuery.event.handle.apply( elem, args ); } // Create "bubbling" focus and blur events if ( document.addEventListener ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { jQuery.event.special[ fix ] = { setup: function() { this.addEventListener( orig, handler, true ); }, teardown: function() { this.removeEventListener( orig, handler, true ); } }; function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; return jQuery.event.handle.call( this, e ); } }); } jQuery.each(["bind", "one"], function( i, name ) { jQuery.fn[ name ] = function( type, data, fn ) { // Handle object literals if ( typeof type === "object" ) { for ( var key in type ) { this[ name ](key, data, type[key], fn); } return this; } if ( jQuery.isFunction( data ) ) { fn = data; data = undefined; } var handler = name === "one" ? jQuery.proxy( fn, function( event ) { jQuery( this ).unbind( event, handler ); return fn.apply( this, arguments ); }) : fn; if ( type === "unload" && name !== "one" ) { this.one( type, data, fn ); } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.add( this[i], type, handler, data ); } } return this; }; }); jQuery.fn.extend({ unbind: function( type, fn ) { // Handle object literals if ( typeof type === "object" && !type.preventDefault ) { for ( var key in type ) { this.unbind(key, type[key]); } } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.remove( this[i], type, fn ); } } return this; }, delegate: function( selector, types, data, fn ) { return this.live( types, data, fn, selector ); }, undelegate: function( selector, types, fn ) { if ( arguments.length === 0 ) { return this.unbind( "live" ); } else { return this.die( types, null, fn, selector ); } }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if ( this[0] ) { var event = jQuery.Event( type ); event.preventDefault(); event.stopPropagation(); jQuery.event.trigger( event, data, this[0] ); return event.result; } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, i = 1; // link all the functions, so any of them can unbind this click handler while ( i < args.length ) { jQuery.proxy( fn, args[ i++ ] ); } return this.click( jQuery.proxy( fn, function( event ) { // Figure out which function to execute var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; })); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } }); var liveMap = { focus: "focusin", blur: "focusout", mouseenter: "mouseover", mouseleave: "mouseout" }; jQuery.each(["live", "die"], function( i, name ) { jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { var type, i = 0, match, namespaces, preType, selector = origSelector || this.selector, context = origSelector ? this : jQuery( this.context ); if ( jQuery.isFunction( data ) ) { fn = data; data = undefined; } types = (types || "").split(" "); while ( (type = types[ i++ ]) != null ) { match = rnamespaces.exec( type ); namespaces = ""; if ( match ) { namespaces = match[0]; type = type.replace( rnamespaces, "" ); } if ( type === "hover" ) { types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); continue; } preType = type; if ( type === "focus" || type === "blur" ) { types.push( liveMap[ type ] + namespaces ); type = type + namespaces; } else { type = (liveMap[ type ] || type) + namespaces; } if ( name === "live" ) { // bind live handler context.each(function(){ jQuery.event.add( this, liveConvert( type, selector ), { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); }); } else { // unbind live handler context.unbind( liveConvert( type, selector ), fn ); } } return this; } }); function liveHandler( event ) { var stop, elems = [], selectors = [], args = arguments, related, match, handleObj, elem, j, i, l, data, events = jQuery.data( this, "events" ); // Make sure we avoid non-left-click bubbling in Firefox (#3861) if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { return; } event.liveFired = this; var live = events.live.slice(0); for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { selectors.push( handleObj.selector ); } else { live.splice( j--, 1 ); } } match = jQuery( event.target ).closest( selectors, event.currentTarget ); for ( i = 0, l = match.length; i < l; i++ ) { for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( match[i].selector === handleObj.selector ) { elem = match[i].elem; related = null; // Those two events require additional checking if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; } if ( !related || related !== elem ) { elems.push({ elem: elem, handleObj: handleObj }); } } } } for ( i = 0, l = elems.length; i < l; i++ ) { match = elems[i]; event.currentTarget = match.elem; event.data = match.handleObj.data; event.handleObj = match.handleObj; if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) { stop = false; break; } } return stop; } function liveConvert( type, selector ) { return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( fn ) { return fn ? this.bind( name, fn ) : this.trigger( name ); }; if ( jQuery.attrFn ) { jQuery.attrFn[ name ] = true; } }); // Prevent memory leaks in IE // Window isn't included so as not to unbind existing unload events // More info: // - http://isaacschlueter.com/2006/10/msie-memory-leaks/ if ( window.attachEvent && !window.addEventListener ) { window.attachEvent("onunload", function() { for ( var id in jQuery.cache ) { if ( jQuery.cache[ id ].handle ) { // Try/Catch is to handle iframes being unloaded, see #4280 try { jQuery.event.remove( jQuery.cache[ id ].handle.elem ); } catch(e) {} } } }); } /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true; // Here we check if the JavaScript engine is using some sort of // optimization where it does not always call our comparision // function. If that is the case, discard the hasDuplicate value. // Thus far that includes Google Chrome. [0, 0].sort(function(){ baseHasDuplicate = false; return 0; }); var Sizzle = function(selector, context, results, seed) { results = results || []; var origContext = context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), soFar = selector; // Reset the position of the chunker regexp (start from head) while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set ); } } } else { // Take a shortcut and set the context if the root selector is an ID // (but not if it'll be faster if the inner selector is an ID) if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { var ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function(results){ if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[i-1] ) { results.splice(i--, 1); } } } } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context, isXML){ var set, match; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { var filter = Expr.filter[ type ], found, item, left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw "Syntax error, unrecognized expression: " + msg; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test(part), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function(checkSet, part){ var isPartStr = typeof part === "string"; if ( isPartStr && !/\W/.test(part) ) { part = part.toLowerCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = part.toLowerCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = part.toLowerCase(); checkFn = dirNodeCheck; } checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context){ if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName(match[1]); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not, isXML){ match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ return match[1].toLowerCase(); }, CHILD: function(match){ if ( match[1] === "nth" ) { // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ // Accessing this property makes selected-by-default // options in Safari work properly elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0; }, nth: function(elem, i, match){ return match[3] - 0 === i; }, eq: function(elem, i, match){ return match[3] - 0 === i; } }, filter: { PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } else { Sizzle.error( "Syntax error, unrecognized expression: " + name ); } }, CHILD: function(elem, match){ var type = match[1], node = elem; switch (type) { case 'only': case 'first': while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; case 'last': while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case 'nth': var first = match[2], last = match[3]; if ( first === 1 && last === 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, CLASS: function(elem, match){ return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function(elem, match){ var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ return "\\" + (num - 0 + 1); })); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. // Also verifies that the returned array holds DOM nodes // (which is not the case in the Blackberry browser) try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Provide a fallback method if it does not work } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { if ( a == b ) { hasDuplicate = true; } return a.compareDocumentPosition ? -1 : 1; } var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( "sourceIndex" in document.documentElement ) { sortOrder = function( a, b ) { if ( !a.sourceIndex || !b.sourceIndex ) { if ( a == b ) { hasDuplicate = true; } return a.sourceIndex ? -1 : 1; } var ret = a.sourceIndex - b.sourceIndex; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( document.createRange ) { sortOrder = function( a, b ) { if ( !a.ownerDocument || !b.ownerDocument ) { if ( a == b ) { hasDuplicate = true; } return a.ownerDocument ? -1 : 1; } var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); aRange.setStart(a, 0); aRange.setEnd(a, 0); bRange.setStart(b, 0); bRange.setEnd(b, 0); var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } // Utility function for retreiving the text value of an array of DOM nodes function getText( elems ) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; // Get the text from text nodes and CDATA nodes if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; // Traverse everything else, except comment nodes } else if ( elem.nodeType !== 8 ) { ret += getText( elem.childNodes ); } } return ret; } // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("div"), id = "script" + (new Date).getTime(); form.innerHTML = "<a name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly var root = document.documentElement; root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( document.getElementById( id ) ) { Expr.find.ID = function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); root = form = null; // release memory in IE })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } div = null; // release memory in IE })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"); div.innerHTML = "<p class='TEST'></p>"; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function(query, context, extra, seed){ context = context || document; // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && context.nodeType === 9 && !isXML(context) ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } div = null; // release memory in IE })(); } (function(){ var div = document.createElement("div"); div.innerHTML = "<div class='test e'></div><div class='test'></div>"; // Opera can't find a second classname (in 9.6) // Also, make sure that getElementsByClassName actually exists if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; div = null; // release memory in IE })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return !!(a.compareDocumentPosition(b) & 16); } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var 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 : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function(selector, context){ var tmpSet = [], later = "", match, root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; // EXPOSE jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uniqueSort; jQuery.text = getText; jQuery.isXMLDoc = isXML; jQuery.contains = contains; return; window.Sizzle = Sizzle; })(); var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, slice = Array.prototype.slice; // Implement the identical functionality for filter and not var winnow = function( elements, qualifier, keep ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { return !!qualifier.call( elem, i, elem ) === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return (elem === qualifier) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return (jQuery.inArray( elem, qualifier ) >= 0) === keep; }); }; jQuery.fn.extend({ find: function( selector ) { var ret = this.pushStack( "", "find", selector ), length = 0; for ( var i = 0, l = this.length; i < l; i++ ) { length = ret.length; jQuery.find( selector, this[i], ret ); if ( i > 0 ) { // Make sure that the results are unique for ( var n = length; n < ret.length; n++ ) { for ( var r = 0; r < length; r++ ) { if ( ret[r] === ret[n] ) { ret.splice(n--, 1); break; } } } } } return ret; }, has: function( target ) { var targets = jQuery( target ); return this.filter(function() { for ( var i = 0, l = targets.length; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false), "not", selector); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, is: function( selector ) { return !!selector && jQuery.filter( selector, this ).length > 0; }, closest: function( selectors, context ) { if ( jQuery.isArray( selectors ) ) { var ret = [], cur = this[0], match, matches = {}, selector; if ( cur && selectors.length ) { for ( var i = 0, l = selectors.length; i < l; i++ ) { selector = selectors[i]; if ( !matches[selector] ) { matches[selector] = jQuery.expr.match.POS.test( selector ) ? jQuery( selector, context || this.context ) : selector; } } while ( cur && cur.ownerDocument && cur !== context ) { for ( selector in matches ) { match = matches[selector]; if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { ret.push({ selector: selector, elem: cur }); delete matches[selector]; } } cur = cur.parentNode; } } return ret; } var pos = jQuery.expr.match.POS.test( selectors ) ? jQuery( selectors, context || this.context ) : null; return this.map(function( i, cur ) { while ( cur && cur.ownerDocument && cur !== context ) { if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { return cur; } cur = cur.parentNode; } return null; }); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { if ( !elem || typeof elem === "string" ) { return jQuery.inArray( this[0], // If it receives a string, the selector is used // If it receives nothing, the siblings are used elem ? jQuery( elem ) : this.parent().children() ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context || this.context ) : jQuery.makeArray( selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? all : jQuery.unique( all ) ); }, andSelf: function() { return this.add( this.prevObject ); } }); // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } 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 jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "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 jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray( elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 ? jQuery.unique( ret ) : ret; if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret, name, slice.call(arguments).join(",") ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[dir]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, nth: function( cur, result, dir, elem ) { result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) { if ( cur.nodeType === 1 && ++num === result ) { break; } } return cur; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnocache = /<script|<object|<embed|<option|<style/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5) fcloseTag = function( all, front, tag ) { return rselfClosing.test( tag ) ? all : front + "></" + tag + ">"; }, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }; wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // IE can't serialize <link> and <script> tags normally if ( !jQuery.support.htmlSerialize ) { wrapMap._default = [ 1, "div<div>", "</div>" ]; } jQuery.fn.extend({ text: function( text ) { if ( jQuery.isFunction(text) ) { return this.each(function(i) { var self = jQuery(this); self.text( text.call(this, i, self.text()) ); }); } if ( typeof text !== "object" && text !== undefined ) { return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); } return jQuery.text( this ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append(this); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { return this.each(function() { jQuery( this ).wrapAll( html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { var set = jQuery(arguments[0]); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } }, after: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); set.push.apply( set, jQuery(arguments[0]).toArray() ); return set; } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); jQuery.cleanData( [ elem ] ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } } return this; }, clone: function( events ) { // Do the clone var ret = this.map(function() { if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal // In order to get around this, we use innerHTML. // Unfortunately, this means some modifications to // attributes in IE that are actually only stored // as properties will not be copied (such as the // the name attribute on an input). var html = this.outerHTML, ownerDocument = this.ownerDocument; if ( !html ) { var div = ownerDocument.createElement("div"); div.appendChild( this.cloneNode(true) ); html = div.innerHTML; } return jQuery.clean([html.replace(rinlinejQuery, "") // Handle the case in IE 8 where action=/test/> self-closes a tag .replace(/=([^="'>\s]+\/)>/g, '="$1">') .replace(rleadingWhitespace, "")], ownerDocument)[0]; } else { return this.cloneNode(true); } }); // Copy the events from the original to the clone if ( events === true ) { cloneCopyEvent( this, ret ); cloneCopyEvent( this.find("*"), ret.find("*") ); } // Return the cloned set return ret; }, html: function( value ) { if ( value === undefined ) { return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(rinlinejQuery, "") : null; // See if we can take a shortcut and just use innerHTML } else if ( typeof value === "string" && !rnocache.test( value ) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { value = value.replace(rxhtmlTag, fcloseTag); try { for ( var i = 0, l = this.length; i < l; i++ ) { // Remove element nodes and prevent memory leaks if ( this[i].nodeType === 1 ) { jQuery.cleanData( this[i].getElementsByTagName("*") ); this[i].innerHTML = value; } } // If using innerHTML throws an exception, use the fallback method } catch(e) { this.empty().append( value ); } } else if ( jQuery.isFunction( value ) ) { this.each(function(i){ var self = jQuery(this), old = self.html(); self.empty().append(function(){ return value.call( this, i, old ); }); }); } else { this.empty().append( value ); } return this; }, replaceWith: function( value ) { if ( this[0] && this[0].parentNode ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this), old = self.html(); self.replaceWith( value.call( this, i, old ) ); }); } if ( typeof value !== "string" ) { value = jQuery(value).detach(); } return this.each(function() { var next = this.nextSibling, parent = this.parentNode; jQuery(this).remove(); if ( next ) { jQuery(next).before( value ); } else { jQuery(parent).append( value ); } }); } else { return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); } }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { var results, first, value = args[0], scripts = [], fragment, parent; // We can't cloneNode fragments that contain checked, in WebKit if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { jQuery(this).domManip( args, table, callback, true ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip( args, table, callback ); }); } if ( this[0] ) { parent = value && value.parentNode; // If we're in a fragment, just use that instead of building a new one if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { results = { fragment: parent }; } else { results = buildFragment( args, this, scripts ); } fragment = results.fragment; if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { first = fragment.firstChild; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); for ( var i = 0, l = this.length; i < l; i++ ) { callback.call( table ? root(this[i], first) : this[i], i > 0 || results.cacheable || this.length > 1 ? fragment.cloneNode(true) : fragment ); } } if ( scripts.length ) { jQuery.each( scripts, evalScript ); } } return this; function root( elem, cur ) { return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } } }); function cloneCopyEvent(orig, ret) { var i = 0; ret.each(function() { if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) { return; } var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( var type in events ) { for ( var handler in events[ type ] ) { jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); } } } }); } function buildFragment( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); // Only cache "small" (1/2 KB) strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { cacheable = true; cacheresults = jQuery.fragments[ args[0] ]; if ( cacheresults ) { if ( cacheresults !== 1 ) { fragment = cacheresults; } } } if ( !fragment ) { fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, scripts ); } if ( cacheable ) { jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; } return { fragment: fragment, cacheable: cacheable }; } jQuery.fragments = {}; jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = (i > 0 ? this.clone(true) : this).get(); jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, insert.selector ); } }; }); jQuery.extend({ clean: function( elems, context, fragment, scripts ) { context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) { context = context.ownerDocument || context[0] && context[0].ownerDocument || document; } var ret = []; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } if ( !elem ) { continue; } // Convert html string into DOM nodes if ( typeof elem === "string" && !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, fcloseTag); // Trim whitespace, otherwise indexOf won't work as expected var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"); // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( depth-- ) { div = div.lastChild; } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var hasBody = rtbody.test(elem), tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !hasBody ? div.childNodes : []; for ( var j = tbody.length - 1; j >= 0 ; --j ) { if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { tbody[ j ].parentNode.removeChild( tbody[ j ] ); } } } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); } elem = div.childNodes; } if ( elem.nodeType ) { ret.push( elem ); } else { ret = jQuery.merge( ret, elem ); } } if ( fragment ) { for ( var i = 0; ret[i]; i++ ) { if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); } else { if ( ret[i].nodeType === 1 ) { ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); } fragment.appendChild( ret[i] ); } } } return ret; }, cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { id = elem[ jQuery.expando ]; if ( id ) { data = cache[ id ]; if ( data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); } else { removeEvent( elem, type, data.handle ); } } } if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } delete cache[ id ]; } } } }); // exclude the following css properties to add px var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, ralpha = /alpha\([^)]*\)/, ropacity = /opacity=([^)]*)/, rfloat = /float/i, rdashAlpha = /-([a-z])/ig, rupper = /([A-Z])/g, rnumpx = /^-?\d+(?:px)?$/i, rnum = /^-?\d/, cssShow = { position: "absolute", visibility: "hidden", display:"block" }, cssWidth = [ "Left", "Right" ], cssHeight = [ "Top", "Bottom" ], // cache check for defaultView.getComputedStyle getComputedStyle = document.defaultView && document.defaultView.getComputedStyle, // normalize float css property styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat", fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn.css = function( name, value ) { return access( this, name, value, true, function( elem, name, value ) { if ( value === undefined ) { return jQuery.curCSS( elem, name ); } if ( typeof value === "number" && !rexclude.test(name) ) { value += "px"; } jQuery.style( elem, name, value ); }); }; jQuery.extend({ style: function( elem, name, value ) { // don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } // ignore negative width and height values #1599 if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) { value = undefined; } var style = elem.style || elem, set = value !== undefined; // IE uses filters for opacity if ( !jQuery.support.opacity && name === "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // Set the alpha filter to set the opacity var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"; var filter = style.filter || jQuery.curCSS( elem, "filter" ) || ""; style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity; } return style.filter && style.filter.indexOf("opacity=") >= 0 ? (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "": ""; } // Make sure we're using the right name for getting the float value if ( rfloat.test( name ) ) { name = styleFloat; } name = name.replace(rdashAlpha, fcamelCase); if ( set ) { style[ name ] = value; } return style[ name ]; }, css: function( elem, name, force, extra ) { if ( name === "width" || name === "height" ) { var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight; function getWH() { val = name === "width" ? elem.offsetWidth : elem.offsetHeight; if ( extra === "border" ) { return; } jQuery.each( which, function() { if ( !extra ) { val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; } if ( extra === "margin" ) { val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; } else { val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; } }); } if ( elem.offsetWidth !== 0 ) { getWH(); } else { jQuery.swap( elem, props, getWH ); } return Math.max(0, Math.round(val)); } return jQuery.curCSS( elem, name, force ); }, curCSS: function( elem, name, force ) { var ret, style = elem.style, filter; // IE uses filters for opacity if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) { ret = ropacity.test(elem.currentStyle.filter || "") ? (parseFloat(RegExp.$1) / 100) + "" : ""; return ret === "" ? "1" : ret; } // Make sure we're using the right name for getting the float value if ( rfloat.test( name ) ) { name = styleFloat; } if ( !force && style && style[ name ] ) { ret = style[ name ]; } else if ( getComputedStyle ) { // Only "float" is needed here if ( rfloat.test( name ) ) { name = "float"; } name = name.replace( rupper, "-$1" ).toLowerCase(); var defaultView = elem.ownerDocument.defaultView; if ( !defaultView ) { return null; } var computedStyle = defaultView.getComputedStyle( elem, null ); if ( computedStyle ) { ret = computedStyle.getPropertyValue( name ); } // We should always get a number back from opacity if ( name === "opacity" && ret === "" ) { ret = "1"; } } else if ( elem.currentStyle ) { var camelCase = name.replace(rdashAlpha, fcamelCase); ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { // Remember the original values var left = style.left, rsLeft = elem.runtimeStyle.left; // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; style.left = camelCase === "fontSize" ? "1em" : (ret || 0); ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; elem.runtimeStyle.left = rsLeft; } } return ret; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // Remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( var name in options ) { elem.style[ name ] = old[ name ]; } } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { var width = elem.offsetWidth, height = elem.offsetHeight, skip = elem.nodeName.toLowerCase() === "tr"; return width === 0 && height === 0 && !skip ? true : width > 0 && height > 0 && !skip ? false : jQuery.curCSS(elem, "display") === "none"; }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } var jsc = now(), rscript = /<script(.|\s)*?\/script>/gi, rselectTextarea = /select|textarea/i, rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i, jsre = /=\?(&|$)/, rquery = /\?/, rts = /(\?|&)_=.*?(&|$)/, rurl = /^(\w+:)?\/\/([^\/?#]+)/, r20 = /%20/g, // Keep a copy of the old load method _load = jQuery.fn.load; jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" ) { return _load.call( this, url ); // Don't do a request if no elements are being requested } else if ( !this.length ) { return this; } var off = url.indexOf(" "); if ( off >= 0 ) { var selector = url.slice(off, url.length); url = url.slice(0, off); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) { // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = null; // Otherwise, build a param string } else if ( typeof params === "object" ) { params = jQuery.param( params, jQuery.ajaxSettings.traditional ); type = "POST"; } } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, complete: function( res, status ) { // If successful, inject the HTML into all the matched elements if ( status === "success" || status === "notmodified" ) { // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div />") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(res.responseText.replace(rscript, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result res.responseText ); } if ( callback ) { self.each( callback, [res.responseText, status, res] ); } } }); return this; }, serialize: function() { return jQuery.param(this.serializeArray()); }, serializeArray: function() { return this.map(function() { return this.elements ? jQuery.makeArray(this.elements) : this; }) .filter(function() { return this.name && !this.disabled && (this.checked || rselectTextarea.test(this.nodeName) || rinput.test(this.type)); }) .map(function( i, elem ) { var val = jQuery(this).val(); return val == null ? null : jQuery.isArray(val) ? jQuery.map( val, function( val, i ) { return { name: elem.name, value: val }; }) : { name: elem.name, value: val }; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) { jQuery.fn[o] = function( f ) { return this.bind(o, f); }; }); jQuery.extend({ get: function( url, data, callback, type ) { // shift arguments if data argument was omited if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = null; } return jQuery.ajax({ type: "GET", url: url, data: data, success: callback, dataType: type }); }, getScript: function( url, callback ) { return jQuery.get(url, null, callback, "script"); }, getJSON: function( url, data, callback ) { return jQuery.get(url, data, callback, "json"); }, post: function( url, data, callback, type ) { // shift arguments if data argument was omited if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = {}; } return jQuery.ajax({ type: "POST", url: url, data: data, success: callback, dataType: type }); }, ajaxSetup: function( settings ) { jQuery.extend( jQuery.ajaxSettings, settings ); }, ajaxSettings: { url: location.href, global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, /* timeout: 0, data: null, username: null, password: null, traditional: false, */ // Create the request object; Microsoft failed to properly // implement the XMLHttpRequest in IE7 (can't request local files), // so we use the ActiveXObject when it is available // This function can be overriden by calling jQuery.ajaxSetup xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ? function() { return new window.XMLHttpRequest(); } : function() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} }, accepts: { xml: "application/xml, text/xml", html: "text/html", script: "text/javascript, application/javascript", json: "application/json, text/javascript", text: "text/plain", _default: "*/*" } }, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajax: function( origSettings ) { var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings); var jsonp, status, data, callbackContext = origSettings && origSettings.context || s, type = s.type.toUpperCase(); // convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Handle JSONP Parameter Callbacks if ( s.dataType === "jsonp" ) { if ( type === "GET" ) { if ( !jsre.test( s.url ) ) { s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?"; } } else if ( !s.data || !jsre.test(s.data) ) { s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; } s.dataType = "json"; } // Build temporary JSONP function if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) { jsonp = s.jsonpCallback || ("jsonp" + jsc++); // Replace the =? sequence both in the query string and the data if ( s.data ) { s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); } s.url = s.url.replace(jsre, "=" + jsonp + "$1"); // We need to make sure // that a JSONP style response is executed properly s.dataType = "script"; // Handle JSONP-style loading window[ jsonp ] = window[ jsonp ] || function( tmp ) { data = tmp; success(); complete(); // Garbage collect window[ jsonp ] = undefined; try { delete window[ jsonp ]; } catch(e) {} if ( head ) { head.removeChild( script ); } }; } if ( s.dataType === "script" && s.cache === null ) { s.cache = false; } if ( s.cache === false && type === "GET" ) { var ts = now(); // try replacing _= if it is there var ret = s.url.replace(rts, "$1_=" + ts + "$2"); // if nothing was replaced, add timestamp to the end s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); } // If data is available, append data to url for get requests if ( s.data && type === "GET" ) { s.url += (rquery.test(s.url) ? "&" : "?") + s.data; } // Watch for a new set of requests if ( s.global && ! jQuery.active++ ) { jQuery.event.trigger( "ajaxStart" ); } // Matches an absolute URL, and saves the domain var parts = rurl.exec( s.url ), remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host); // If we're requesting a remote document // and trying to load JSON or Script with a GET if ( s.dataType === "script" && type === "GET" && remote ) { var head = document.getElementsByTagName("head")[0] || document.documentElement; var script = document.createElement("script"); script.src = s.url; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } // Handle Script loading if ( !jsonp ) { var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { done = true; success(); complete(); // Handle memory leak in IE script.onload = script.onreadystatechange = null; if ( head && script.parentNode ) { head.removeChild( script ); } } }; } // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head.insertBefore( script, head.firstChild ); // We handle everything using the script element injection return undefined; } var requestDone = false; // Create the request object var xhr = s.xhr(); if ( !xhr ) { return; } // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open(type, s.url, s.async, s.username, s.password); } else { xhr.open(type, s.url, s.async); } // Need an extra try/catch for cross domain requests in Firefox 3 try { // Set the correct header, if data is being sent if ( s.data || origSettings && origSettings.contentType ) { xhr.setRequestHeader("Content-Type", s.contentType); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[s.url] ) { xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]); } if ( jQuery.etag[s.url] ) { xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]); } } // Set header so the called script knows that it's an XMLHttpRequest // Only send the header if it's not a remote XHR if ( !remote ) { xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); } // Set the Accepts header for the server, depending on the dataType xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? s.accepts[ s.dataType ] + ", */*" : s.accepts._default ); } catch(e) {} // Allow custom headers/mimetypes and early abort if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) { // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) { jQuery.event.trigger( "ajaxStop" ); } // close opended socket xhr.abort(); return false; } if ( s.global ) { trigger("ajaxSend", [xhr, s]); } // Wait for a response to come back var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) { // The request was aborted if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) { // Opera doesn't call onreadystatechange before this point // so we simulate the call if ( !requestDone ) { complete(); } requestDone = true; if ( xhr ) { xhr.onreadystatechange = jQuery.noop; } // The transfer is complete and the data is available, or the request timed out } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) { requestDone = true; xhr.onreadystatechange = jQuery.noop; status = isTimeout === "timeout" ? "timeout" : !jQuery.httpSuccess( xhr ) ? "error" : s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : "success"; var errMsg; if ( status === "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) data = jQuery.httpData( xhr, s.dataType, s ); } catch(err) { status = "parsererror"; errMsg = err; } } // Make sure that the request was successful or notmodified if ( status === "success" || status === "notmodified" ) { // JSONP handles its own success callback if ( !jsonp ) { success(); } } else { jQuery.handleError(s, xhr, status, errMsg); } // Fire the complete handlers complete(); if ( isTimeout === "timeout" ) { xhr.abort(); } // Stop memory leaks if ( s.async ) { xhr = null; } } }; // Override the abort handler, if we can (IE doesn't allow it, but that's OK) // Opera doesn't fire onreadystatechange at all on abort try { var oldAbort = xhr.abort; xhr.abort = function() { if ( xhr ) { oldAbort.call( xhr ); } onreadystatechange( "abort" ); }; } catch(e) { } // Timeout checker if ( s.async && s.timeout > 0 ) { setTimeout(function() { // Check to see if the request is still happening if ( xhr && !requestDone ) { onreadystatechange( "timeout" ); } }, s.timeout); } // Send the data try { xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null ); } catch(e) { jQuery.handleError(s, xhr, null, e); // Fire the complete handlers complete(); } // firefox 1.5 doesn't fire statechange for sync requests if ( !s.async ) { onreadystatechange(); } function success() { // If a local callback was specified, fire it and pass it the data if ( s.success ) { s.success.call( callbackContext, data, status, xhr ); } // Fire the global callback if ( s.global ) { trigger( "ajaxSuccess", [xhr, s] ); } } function complete() { // Process result if ( s.complete ) { s.complete.call( callbackContext, xhr, status); } // The request was completed if ( s.global ) { trigger( "ajaxComplete", [xhr, s] ); } // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) { jQuery.event.trigger( "ajaxStop" ); } } function trigger(type, args) { (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args); } // return XMLHttpRequest to allow aborting the request etc. return xhr; }, handleError: function( s, xhr, status, e ) { // If a local callback was specified, fire it if ( s.error ) { s.error.call( s.context || s, xhr, status, e ); } // Fire the global callback if ( s.global ) { (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] ); } }, // Counter for holding the number of active queries active: 0, // Determines if an XMLHttpRequest was successful or not httpSuccess: function( xhr ) { try { // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 return !xhr.status && location.protocol === "file:" || // Opera returns 0 when status is 304 ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status === 304 || xhr.status === 1223 || xhr.status === 0; } catch(e) {} return false; }, // Determines if an XMLHttpRequest returns NotModified httpNotModified: function( xhr, url ) { var lastModified = xhr.getResponseHeader("Last-Modified"), etag = xhr.getResponseHeader("Etag"); if ( lastModified ) { jQuery.lastModified[url] = lastModified; } if ( etag ) { jQuery.etag[url] = etag; } // Opera returns 0 when status is 304 return xhr.status === 304 || xhr.status === 0; }, httpData: function( xhr, type, s ) { var ct = xhr.getResponseHeader("content-type") || "", xml = type === "xml" || !type && ct.indexOf("xml") >= 0, data = xml ? xhr.responseXML : xhr.responseText; if ( xml && data.documentElement.nodeName === "parsererror" ) { jQuery.error( "parsererror" ); } // Allow a pre-filtering function to sanitize the response // s is checked to keep backwards compatibility if ( s && s.dataFilter ) { data = s.dataFilter( data, type ); } // The filter can actually parse the response if ( typeof data === "string" ) { // Get the JavaScript object, if JSON is used. if ( type === "json" || !type && ct.indexOf("json") >= 0 ) { data = jQuery.parseJSON( data ); // If the type is "script", eval it in global context } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) { jQuery.globalEval( data ); } } return data; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a, traditional ) { var s = []; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray(a) || a.jquery ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( var prefix in a ) { buildParams( prefix, a[prefix] ); } } // Return the resulting serialization return s.join("&").replace(r20, "+"); function buildParams( prefix, obj ) { if ( jQuery.isArray(obj) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || /\[\]$/.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // If array item is non-scalar (array or object), encode its // numeric index to resolve deserialization ambiguity issues. // Note that rack (as of 1.0.0) can't currently deserialize // nested arrays properly, and attempting to do so may cause // a server error. Possible fixes are to modify rack's // deserialization algorithm or to provide an option or flag // to force array serialization to be shallow. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v ); } }); } else if ( !traditional && obj != null && typeof obj === "object" ) { // Serialize object item. jQuery.each( obj, function( k, v ) { buildParams( prefix + "[" + k + "]", v ); }); } else { // Serialize scalar item. add( prefix, obj ); } } function add( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction(value) ? value() : value; s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); } } }); var elemdisplay = {}, rfxtypes = /toggle|show|hide/, rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/, timerId, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ]; jQuery.fn.extend({ show: function( speed, callback ) { if ( speed || speed === 0) { return this.animate( genFx("show", 3), speed, callback); } else { for ( var i = 0, l = this.length; i < l; i++ ) { var old = jQuery.data(this[i], "olddisplay"); this[i].style.display = old || ""; if ( jQuery.css(this[i], "display") === "none" ) { var nodeName = this[i].nodeName, display; if ( elemdisplay[ nodeName ] ) { display = elemdisplay[ nodeName ]; } else { var elem = jQuery("<" + nodeName + " />").appendTo("body"); display = elem.css("display"); if ( display === "none" ) { display = "block"; } elem.remove(); elemdisplay[ nodeName ] = display; } jQuery.data(this[i], "olddisplay", display); } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( var j = 0, k = this.length; j < k; j++ ) { this[j].style.display = jQuery.data(this[j], "olddisplay") || ""; } return this; } }, hide: function( speed, callback ) { if ( speed || speed === 0 ) { return this.animate( genFx("hide", 3), speed, callback); } else { for ( var i = 0, l = this.length; i < l; i++ ) { var old = jQuery.data(this[i], "olddisplay"); if ( !old && old !== "none" ) { jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( var j = 0, k = this.length; j < k; j++ ) { this[j].style.display = "none"; } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2 ) { var bool = typeof fn === "boolean"; if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { this._toggle.apply( this, arguments ); } else if ( fn == null || bool ) { this.each(function() { var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }); } else { this.animate(genFx("toggle", 3), fn, fn2); } return this; }, fadeTo: function( speed, to, callback ) { return this.filter(":hidden").css("opacity", 0).show().end() .animate({opacity: to}, speed, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed(speed, easing, callback); if ( jQuery.isEmptyObject( prop ) ) { return this.each( optall.complete ); } return this[ optall.queue === false ? "each" : "queue" ](function() { var opt = jQuery.extend({}, optall), p, hidden = this.nodeType === 1 && jQuery(this).is(":hidden"), self = this; for ( p in prop ) { var name = p.replace(rdashAlpha, fcamelCase); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; p = name; } if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) { return opt.complete.call(this); } if ( ( p === "height" || p === "width" ) && this.style ) { // Store display property opt.display = jQuery.css(this, "display"); // Make sure that nothing sneaks out opt.overflow = this.style.overflow; } if ( jQuery.isArray( prop[p] ) ) { // Create (if needed) and add to specialEasing (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1]; prop[p] = prop[p][0]; } } if ( opt.overflow != null ) { this.style.overflow = "hidden"; } opt.curAnim = jQuery.extend({}, prop); jQuery.each( prop, function( name, val ) { var e = new jQuery.fx( self, opt, name ); if ( rfxtypes.test(val) ) { e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop ); } else { var parts = rfxnum.exec(val), start = e.cur(true) || 0; if ( parts ) { var end = parseFloat( parts[2] ), unit = parts[3] || "px"; // We need to compute starting value if ( unit !== "px" ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) { end = ((parts[1] === "-=" ? -1 : 1) * end) + start; } e.custom( start, end, unit ); } else { e.custom( start, val, "" ); } } }); // For JS strict compliance return true; }); }, stop: function( clearQueue, gotoEnd ) { var timers = jQuery.timers; if ( clearQueue ) { this.queue([]); } this.each(function() { // go in reverse order so anything added to the queue during the loop is ignored for ( var i = timers.length - 1; i >= 0; i-- ) { if ( timers[i].elem === this ) { if (gotoEnd) { // force the next step to be the last timers[i](true); } timers.splice(i, 1); } } }); // start the next in the queue if the last step wasn't forced if ( !gotoEnd ) { this.dequeue(); } return this; } }); // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show", 1), slideUp: genFx("hide", 1), slideToggle: genFx("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, callback ) { return this.animate( props, speed, callback ); }; }); jQuery.extend({ speed: function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? speed : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; opt.complete = function() { if ( opt.queue !== false ) { jQuery(this).dequeue(); } if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } }; return opt; }, easing: { linear: function( p, n, firstNum, diff ) { return firstNum + diff * p; }, swing: function( p, n, firstNum, diff ) { return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; } }, timers: [], fx: function( elem, options, prop ) { this.options = options; this.elem = elem; this.prop = prop; if ( !options.orig ) { options.orig = {}; } } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) { this.elem.style.display = "block"; } }, // Get the current size cur: function( force ) { if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { return this.elem[ this.prop ]; } var r = parseFloat(jQuery.css(this.elem, this.prop, force)); return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; }, // Start an animation from one number to another custom: function( from, to, unit ) { this.startTime = now(); this.start = from; this.end = to; this.unit = unit || this.unit || "px"; this.now = this.start; this.pos = this.state = 0; var self = this; function t( gotoEnd ) { return self.step(gotoEnd); } t.elem = this.elem; if ( t() && jQuery.timers.push(t) && !timerId ) { timerId = setInterval(jQuery.fx.tick, 13); } }, // Simple 'show' function show: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any // flash of content this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); // Start by showing the element jQuery( this.elem ).show(); }, // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.hide = true; // Begin the animation this.custom(this.cur(), 0); }, // Each step of an animation step: function( gotoEnd ) { var t = now(), done = true; if ( gotoEnd || t >= this.options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[ this.prop ] = true; for ( var i in this.options.curAnim ) { if ( this.options.curAnim[i] !== true ) { done = false; } } if ( done ) { if ( this.options.display != null ) { // Reset the overflow this.elem.style.overflow = this.options.overflow; // Reset the display var old = jQuery.data(this.elem, "olddisplay"); this.elem.style.display = old ? old : this.options.display; if ( jQuery.css(this.elem, "display") === "none" ) { this.elem.style.display = "block"; } } // Hide the element if the "hide" operation was done if ( this.options.hide ) { jQuery(this.elem).hide(); } // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) { for ( var p in this.options.curAnim ) { jQuery.style(this.elem, p, this.options.orig[p]); } } // Execute the complete function this.options.complete.call( this.elem ); } return false; } else { var n = t - this.startTime; this.state = n / this.options.duration; // Perform the easing function, defaults to swing var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop]; var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear"); this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos); // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { tick: function() { var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) { if ( !timers[i]() ) { timers.splice(i--, 1); } } if ( !timers.length ) { jQuery.fx.stop(); } }, stop: function() { clearInterval( timerId ); timerId = null; }, speeds: { slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function( fx ) { jQuery.style(fx.elem, "opacity", fx.now); }, _default: function( fx ) { if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; } else { fx.elem[ fx.prop ] = fx.now; } } } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } function genFx( type, num ) { var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { obj[ this ] = type; }); return obj; } if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0]; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement, clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; return { top: top, left: left }; }; } else { jQuery.fn.offset = function( options ) { var elem = this[0]; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } jQuery.offset.initialize(); var offsetParent = elem.offsetParent, prevOffsetParent = elem, doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; } computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop; left += elem.offsetLeft; if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; } if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { top += body.offsetTop; left += body.offsetLeft; } if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { top += Math.max( docElem.scrollTop, body.scrollTop ); left += Math.max( docElem.scrollLeft, body.scrollLeft ); } return { top: top, left: left }; }; } jQuery.offset = { initialize: function() { var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0, html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); container.innerHTML = html; body.insertBefore( container, body.firstChild ); innerDiv = container.firstChild; checkDiv = innerDiv.firstChild; td = innerDiv.nextSibling.firstChild.firstChild; this.doesNotAddBorder = (checkDiv.offsetTop !== 5); this.doesAddBorderForTableAndCells = (td.offsetTop === 5); checkDiv.style.position = "fixed", checkDiv.style.top = "20px"; // safari subtracts parent border width here which is 5px this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); checkDiv.style.position = checkDiv.style.top = ""; innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative"; this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); body.removeChild( container ); body = container = innerDiv = checkDiv = table = td = null; jQuery.offset.initialize = jQuery.noop; }, bodyOffset: function( body ) { var top = body.offsetTop, left = body.offsetLeft; jQuery.offset.initialize(); if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0; left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { // set position first, in-case top/left are set even on static elem if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0, curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0; if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } var props = { top: (options.top - curOffset.top) + curTop, left: (options.left - curOffset.left) + curLeft }; if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[0] ) { return null; } var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0; offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0; // Add offsetParent borders parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0; parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0; // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.body; while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } return offsetParent; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( ["Left", "Top"], function( i, name ) { var method = "scroll" + name; jQuery.fn[ method ] = function(val) { var elem = this[0], win; if ( !elem ) { return null; } if ( val !== undefined ) { // Set the scroll offset return this.each(function() { win = getWindow( this ); if ( win ) { win.scrollTo( !i ? val : jQuery(win).scrollLeft(), i ? val : jQuery(win).scrollTop() ); } else { this[ method ] = val; } }); } else { win = getWindow( elem ); // Return the scroll offset return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : jQuery.support.boxModel && win.document.documentElement[ method ] || win.document.body[ method ] : elem[ method ]; } }; }); function getWindow( elem ) { return ("scrollTo" in elem && elem.document) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function( i, name ) { var type = name.toLowerCase(); // innerHeight and innerWidth jQuery.fn["inner" + name] = function() { return this[0] ? jQuery.css( this[0], type, false, "padding" ) : null; }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function( margin ) { return this[0] ? jQuery.css( this[0], type, false, margin ? "margin" : "border" ) : null; }; jQuery.fn[ type ] = function( size ) { // Get window width or height var elem = this[0]; if ( !elem ) { return size == null ? null : this; } if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); self[ type ]( size.call( this, i, self[ type ]() ) ); }); } return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window? // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || elem.document.body[ "client" + name ] : // Get document width or height (elem.nodeType === 9) ? // is it a document // Either scroll[Width/Height] or offset[Width/Height], whichever is greater Math.max( elem.documentElement["client" + name], elem.body["scroll" + name], elem.documentElement["scroll" + name], elem.body["offset" + name], elem.documentElement["offset" + name] ) : // Get or set width or height on the element size === undefined ? // Get width or height on the element jQuery.css( elem, type ) : // Set the width or height on the element (default to pixels if value is unitless) this.css( type, typeof size === "string" ? size : size + "px" ); }; }); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; })(window);
example/src/index.js
mattzeunert/glasswing
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; ReactDOM.render(<App />, document.getElementById('root')); registerServiceWorker();
ajax/libs/soundplayer-widget/0.3.4/soundplayer-widget.js
tonytomov/cdnjs
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; 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; } } __webpack_require__(1); var _widget = __webpack_require__(5); var SPWidget = _interopRequireWildcard(_widget); var elements = document.querySelectorAll('.sb-soundplayer-widget'); for (var i = 0, len = elements.length; i < len; i++) { var el = elements[i]; var url = el.getAttribute('data-url'); var layout = el.getAttribute('data-layout'); SPWidget.create(el, { url: url, layout: layout }); } /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(2); if(typeof content === 'string') content = [[module.id, content, '']]; // add the styles to the DOM var update = __webpack_require__(4)(content, {"singleton":true}); if(content.locals) module.exports = content.locals; // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/cssnext-loader/index.js!./index.css", function() { var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/cssnext-loader/index.js!./index.css"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); } // When the module is disposed, remove the <style> tags module.hot.dispose(function() { update(); }); } /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(3)(); exports.push([module.id, ".sb-soundplayer-widget {\n color: #fff;\n font-family: 'Avenir Next', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;\n background-color: #f5f5f5;\n background-image: url('https://w.soundcloud.com/player/assets/images/logo-200x120-177df3dd.png');\n background-repeat: no-repeat;\n background-position: center center;\n background-size: 100px 60px;\n min-height: 240px;\n overflow: hidden;\n position: relative;\n box-sizing: border-box;\n border-radius: 3px;\n}\n.sb-soundplayer-widget *,\n.sb-soundplayer-widget *:before,\n.sb-soundplayer-widget *:after {\n box-sizing: inherit;\n margin: 0;\n padding: 0;\n}\n.sb-soundplayer-widget-track-info {\n color: #fff;\n position: relative;\n z-index: 1;\n text-align: center;\n padding-top: 80px;\n padding-bottom: 53px;\n text-transform: uppercase;\n letter-spacing: .1em;\n}\n.sb-soundplayer-widget-user,\n.sb-soundplayer-widget-title {\n margin: 2px 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}\n.sb-soundplayer-widget-user {\n font-size: 14px;\n}\n.sb-soundplayer-widget-title {\n font-size: 20px;\n}\n.sb-soundplayer-widget-controls {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 10px 15px;\n position: relative;\n z-index: 1;\n}\n.sb-soundplayer-progress-container {\n background-color: #000000;\n background-color: rgba(0, 0, 0, .25);\n width: 100%;\n height: 8px;\n overflow: hidden;\n cursor: pointer;\n border-radius: 3px;\n}\n.sb-soundplayer-progress-inner {\n background-color: #fff;\n height: 100%;\n -webkit-transition: width .2s ease-in;\n transition: width .2s ease-in;\n}\n.sb-soundplayer-cover {\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 3px;\n position: relative;\n min-height: 240px;\n}\n.sb-soundplayer-widget-overlay {\n background-color: #000000;\n background-color: rgba(0, 0, 0, .3);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 3px;\n}\n.sb-soundplayer-play-btn {\n display: inline-block;\n border: 1px solid transparent;\n color: #fff;\n font-size: 20px;\n text-decoration: none;\n line-height: 1;\n padding: 8px 16px;\n height: auto;\n vertical-align: middle;\n -webkit-box-flex: 0;\n -webkit-flex: none;\n -ms-flex: none;\n flex: none;\n margin-right: 12px;\n position: relative;\n z-index: 2;\n background-color: transparent;\n -webkit-transition-duration: .1s;\n transition-duration: .1s;\n -webkit-transition-timing-function: ease-out;\n transition-timing-function: ease-out;\n -webkit-transition-property: box-shadow;\n transition-property: box-shadow;\n -webkit-appearance: none;\n border-radius: 3px;\n cursor: pointer;\n}\n.sb-soundplayer-play-btn:before {\n content: '';\n display: block;\n border: 1px solid transparent;\n background-color: currentcolor;\n position: absolute;\n z-index: -1;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n -webkit-transition-duration: .1s;\n transition-duration: .1s;\n -webkit-transition-timing-function: ease-out;\n transition-timing-function: ease-out;\n -webkit-transition-property: opacity;\n transition-property: opacity;\n opacity: 0;\n border-radius: 3px;\n}\n.sb-soundplayer-play-btn:hover,\n.sb-soundplayer-play-btn:active {\n box-shadow: none;\n}\n.sb-soundplayer-play-btn:hover:before,\n.sb-soundplayer-play-btn:focus:before {\n opacity: .09375;\n}\n.sb-soundplayer-play-btn:focus {\n outline: none;\n border-color: transparent;\n box-shadow: 0 0 0 2px;\n}\n.sb-soundplayer-button-icon {\n width: 1em;\n height: 1em;\n position: relative;\n vertical-align: middle;\n}\n.sb-soundplayer-cover-logo {\n color: #fff;\n width: 100px;\n height: 14px;\n position: absolute;\n top: 10px;\n right: 10px;\n z-index: 1;\n}\n.sb-soundplayer-timer {\n -webkit-box-flex: 0;\n -webkit-flex: none;\n -ms-flex: none;\n flex: none;\n color: #fff;\n font-size: 12px;\n padding: 0 3px 0 15px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}\n.sb-soundplayer-widget-message {\n color: #999;\n font-size: 12px;\n text-align: center;\n position: absolute;\n right: 0;\n left: 0;\n bottom: 10px;\n}\n.sb-soundplayer-widget-message a {\n color: #666;\n}\n", ""]); /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function() { var list = []; // return the list of modules as css string list.toString = function toString() { var result = []; for(var i = 0; i < this.length; i++) { var item = this[i]; if(item[2]) { result.push("@media " + item[2] + "{" + item[1] + "}"); } else { result.push(item[1]); } } return result.join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}, memoize = function(fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }, isOldIE = memoize(function() { return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase()); }), getHeadElement = memoize(function () { return document.head || document.getElementsByTagName("head")[0]; }), singletonElement = null, singletonCounter = 0; module.exports = function(list, options) { if(false) { if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page if (typeof options.singleton === "undefined") options.singleton = isOldIE(); var styles = listToStyles(list); addStylesToDom(styles, options); return function update(newList) { var mayRemove = []; for(var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; domStyle.refs--; mayRemove.push(domStyle); } if(newList) { var newStyles = listToStyles(newList); addStylesToDom(newStyles, options); } for(var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if(domStyle.refs === 0) { for(var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; } function addStylesToDom(styles, options) { for(var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; if(domStyle) { domStyle.refs++; for(var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]); } for(; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j], options)); } } else { var parts = []; for(var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j], options)); } stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; } } } function listToStyles(list) { var styles = []; var newStyles = {}; for(var i = 0; i < list.length; i++) { var item = list[i]; var id = item[0]; var css = item[1]; var media = item[2]; var sourceMap = item[3]; var part = {css: css, media: media, sourceMap: sourceMap}; if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); else newStyles[id].parts.push(part); } return styles; } function createStyleElement() { var styleElement = document.createElement("style"); var head = getHeadElement(); styleElement.type = "text/css"; head.appendChild(styleElement); return styleElement; } function createLinkElement() { var linkElement = document.createElement("link"); var head = getHeadElement(); linkElement.rel = "stylesheet"; head.appendChild(linkElement); return linkElement; } function addStyle(obj, options) { var styleElement, update, remove; if (options.singleton) { var styleIndex = singletonCounter++; styleElement = singletonElement || (singletonElement = createStyleElement()); update = applyToSingletonTag.bind(null, styleElement, styleIndex, false); remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true); } else if(obj.sourceMap && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" && typeof Blob === "function" && typeof btoa === "function") { styleElement = createLinkElement(); update = updateLink.bind(null, styleElement); remove = function() { styleElement.parentNode.removeChild(styleElement); if(styleElement.href) URL.revokeObjectURL(styleElement.href); }; } else { styleElement = createStyleElement(); update = applyToTag.bind(null, styleElement); remove = function() { styleElement.parentNode.removeChild(styleElement); }; } update(obj); return function updateStyle(newObj) { if(newObj) { if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return; update(obj = newObj); } else { remove(); } }; } var replaceText = (function () { var textStore = []; return function (index, replacement) { textStore[index] = replacement; return textStore.filter(Boolean).join('\n'); }; })(); function applyToSingletonTag(styleElement, index, remove, obj) { var css = remove ? "" : obj.css; if (styleElement.styleSheet) { styleElement.styleSheet.cssText = replaceText(index, css); } else { var cssNode = document.createTextNode(css); var childNodes = styleElement.childNodes; if (childNodes[index]) styleElement.removeChild(childNodes[index]); if (childNodes.length) { styleElement.insertBefore(cssNode, childNodes[index]); } else { styleElement.appendChild(cssNode); } } } function applyToTag(styleElement, obj) { var css = obj.css; var media = obj.media; var sourceMap = obj.sourceMap; if(media) { styleElement.setAttribute("media", media) } if(styleElement.styleSheet) { styleElement.styleSheet.cssText = css; } else { while(styleElement.firstChild) { styleElement.removeChild(styleElement.firstChild); } styleElement.appendChild(document.createTextNode(css)); } } function updateLink(linkElement, obj) { var css = obj.css; var media = obj.media; var sourceMap = obj.sourceMap; if(sourceMap) { // http://stackoverflow.com/a/26603875 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; } var blob = new Blob([css], { type: "text/css" }); var oldSrc = linkElement.href; linkElement.href = URL.createObjectURL(blob); if(oldSrc) URL.revokeObjectURL(oldSrc); } /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @jsx deku.dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.create = create; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); var _deku2 = _interopRequireDefault(_deku); var _Player = __webpack_require__(37); var _Player2 = _interopRequireDefault(_Player); var env = process.env.NODE_ENV || 'development'; function create(el, opts) { var clientId = opts.clientId || window.sb_soundplayer_client_id; if (!clientId) { console.error(['You must provide SoundCloud clientId for SoundPlayer widget', '', 'Example:', '<script>', 'var sb_soundplayer_client_id = "YOUR_CLIENT_ID";', '</script>', '', 'Register for an app and get clientId at https://developers.soundcloud.com/'].join('\n')); return; } var app = _deku2['default'].tree(_deku2['default'].dom(_Player2['default'], { resolveUrl: opts.url, clientId: clientId })); if (env === 'development') { app.option('validateProps', true); } _deku2['default'].render(app, el); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { // shim for using process in browser var process = module.exports = {}; var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = setTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { currentQueue[queueIndex].run(); } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; clearTimeout(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) { setTimeout(drainQueue, 0); } }; // 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.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'); }; process.umask = function() { return 0; }; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { /** * Create the application. */ exports.tree = exports.scene = exports.deku = __webpack_require__(8) /** * Render scenes to the DOM. */ if (typeof document !== 'undefined') { exports.render = __webpack_require__(10) } /** * Render scenes to a string */ exports.renderString = __webpack_require__(32) /** * Create virtual elements. */ exports.element = exports.createElement = exports.dom = __webpack_require__(33) /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { /** * Module dependencies. */ var Emitter = __webpack_require__(9) /** * Expose `scene`. */ module.exports = Application /** * Create a new `Application`. * * @param {Object} element Optional initial element */ function Application (element) { if (!(this instanceof Application)) return new Application(element) this.options = {} this.sources = {} this.element = element } /** * Mixin `Emitter`. */ Emitter(Application.prototype) /** * Add a plugin * * @param {Function} plugin */ Application.prototype.use = function (plugin) { plugin(this) return this } /** * Set an option * * @param {String} name */ Application.prototype.option = function (name, val) { this.options[name] = val return this } /** * Set value used somewhere in the IO network. */ Application.prototype.set = function (name, data) { this.sources[name] = data this.emit('source', name, data) return this } /** * Mount a virtual element. * * @param {VirtualElement} element */ Application.prototype.mount = function (element) { this.element = element this.emit('mount', element) return this } /** * Remove the world. Unmount everything. */ Application.prototype.unmount = function () { if (!this.element) return this.element = null this.emit('unmount') return this } /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { /** * Expose `Emitter`. */ module.exports = Emitter; /** * Initialize a new `Emitter`. * * @api public */ function Emitter(obj) { if (obj) return mixin(obj); }; /** * Mixin the emitter properties. * * @param {Object} obj * @return {Object} * @api private */ function mixin(obj) { for (var key in Emitter.prototype) { obj[key] = Emitter.prototype[key]; } return obj; } /** * Listen on the given `event` with `fn`. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; (this._callbacks['$' + event] = this._callbacks['$' + event] || []) .push(fn); return this; }; /** * Adds an `event` listener that will be invoked a single * time then automatically removed. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.once = function(event, fn){ function on() { this.off(event, on); fn.apply(this, arguments); } on.fn = fn; this.on(event, on); return this; }; /** * Remove the given callback for `event` or all * registered callbacks. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; // all if (0 == arguments.length) { this._callbacks = {}; return this; } // specific event var callbacks = this._callbacks['$' + event]; if (!callbacks) return this; // remove all handlers if (1 == arguments.length) { delete this._callbacks['$' + event]; return this; } // remove specific handler var cb; for (var i = 0; i < callbacks.length; i++) { cb = callbacks[i]; if (cb === fn || cb.fn === fn) { callbacks.splice(i, 1); break; } } return this; }; /** * Emit `event` with the given args. * * @param {String} event * @param {Mixed} ... * @return {Emitter} */ Emitter.prototype.emit = function(event){ this._callbacks = this._callbacks || {}; var args = [].slice.call(arguments, 1) , callbacks = this._callbacks['$' + event]; if (callbacks) { callbacks = callbacks.slice(0); for (var i = 0, len = callbacks.length; i < len; ++i) { callbacks[i].apply(this, args); } } return this; }; /** * Return array of callbacks for `event`. * * @param {String} event * @return {Array} * @api public */ Emitter.prototype.listeners = function(event){ this._callbacks = this._callbacks || {}; return this._callbacks['$' + event] || []; }; /** * Check if this emitter has `event` handlers. * * @param {String} event * @return {Boolean} * @api public */ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { /** * Dependencies. */ var raf = __webpack_require__(12) var Pool = __webpack_require__(13) var walk = __webpack_require__(14) var isDom = __webpack_require__(15) var uid = __webpack_require__(16) var keypath = __webpack_require__(17) var type = __webpack_require__(18) var utils = __webpack_require__(11) var svg = __webpack_require__(19) var events = __webpack_require__(21) var defaults = utils.defaults var forEach = __webpack_require__(22) var assign = __webpack_require__(26) var reduce = __webpack_require__(27) var isPromise = __webpack_require__(31) /** * These elements won't be pooled */ var avoidPooling = ['input', 'textarea', 'select', 'option']; /** * Expose `dom`. */ module.exports = render /** * Render an app to the DOM * * @param {Application} app * @param {HTMLElement} container * @param {Object} opts * * @return {Object} */ function render (app, container, opts) { var frameId var isRendering var rootId = 'root' var currentElement var currentNativeElement var connections = {} var components = {} var entities = {} var pools = {} var handlers = {} var mountQueue = [] var children = {} children[rootId] = {} if (!isDom(container)) { throw new Error('Container element must be a DOM element') } /** * Rendering options. Batching is only ever really disabled * when running tests, and pooling can be disabled if the user * is doing something stupid with the DOM in their components. */ var options = defaults(assign({}, app.options || {}, opts || {}), { pooling: true, batching: true, validateProps: false }) /** * Listen to DOM events */ addNativeEventListeners() /** * Watch for changes to the app so that we can update * the DOM as needed. */ app.on('unmount', onunmount) app.on('mount', onmount) app.on('source', onupdate) /** * If the app has already mounted an element, we can just * render that straight away. */ if (app.element) render() /** * Teardown the DOM rendering so that it stops * rendering and everything can be garbage collected. */ function teardown () { removeNativeEventListeners() removeNativeElement() app.off('unmount', onunmount) app.off('mount', onmount) app.off('source', onupdate) } /** * Swap the current rendered node with a new one that is rendered * from the new virtual element mounted on the app. * * @param {VirtualElement} element */ function onmount () { invalidate() } /** * If the app unmounts an element, we should clear out the current * rendered element. This will remove all the entities. */ function onunmount () { removeNativeElement() currentElement = null } /** * Update all components that are bound to the source * * @param {String} name * @param {*} data */ function onupdate (name, data) { if (!connections[name]) return; connections[name].forEach(function(update) { update(data) }) } /** * Render and mount a component to the native dom. * * @param {Entity} entity * @return {HTMLElement} */ function mountEntity (entity) { register(entity) setSources(entity) children[entity.id] = {} entities[entity.id] = entity // commit initial state and props. commit(entity) // callback before mounting. trigger('beforeMount', entity, [entity.context]) trigger('beforeRender', entity, [entity.context]) // render virtual element. var virtualElement = renderEntity(entity) // create native element. var nativeElement = toNative(entity.id, '0', virtualElement) entity.virtualElement = virtualElement entity.nativeElement = nativeElement // Fire afterRender and afterMount hooks at the end // of the render cycle mountQueue.push(entity.id) return nativeElement } /** * Remove a component from the native dom. * * @param {Entity} entity */ function unmountEntity (entityId) { var entity = entities[entityId] if (!entity) return trigger('beforeUnmount', entity, [entity.context, entity.nativeElement]) unmountChildren(entityId) removeAllEvents(entityId) var componentEntities = components[entityId].entities; delete componentEntities[entityId] delete components[entityId] delete entities[entityId] delete children[entityId] } /** * Render the entity and make sure it returns a node * * @param {Entity} entity * * @return {VirtualTree} */ function renderEntity (entity) { var component = entity.component if (!component.render) throw new Error('Component needs a render function') var result = component.render(entity.context, setState(entity)) if (!result) throw new Error('Render function must return an element.') return result } /** * Whenever setState or setProps is called, we mark the entity * as dirty in the renderer. This lets us optimize the re-rendering * and skip components that definitely haven't changed. * * @param {Entity} entity * * @return {Function} A curried function for updating the state of an entity */ function setState (entity) { return function (nextState) { updateEntityStateAsync(entity, nextState) } } /** * Tell the app it's dirty and needs to re-render. If batching is disabled * we can just trigger a render immediately, otherwise we'll wait until * the next available frame. */ function invalidate () { if (!options.batching) { if (!isRendering) render() } else { if (!frameId) frameId = raf(render) } } /** * Update the DOM. If the update fails we stop the loop * so we don't get errors on every frame. * * @api public */ function render () { // If this is called synchronously we need to // cancel any pending future updates clearFrame() // If the rendering from the previous frame is still going, // we'll just wait until the next frame. Ideally renders should // not take over 16ms to stay within a single frame, but this should // catch it if it does. if (isRendering) { frameId = raf(render) return } else { isRendering = true } // 1. If there isn't a native element rendered for the current mounted element // then we need to create it from scratch. // 2. If a new element has been mounted, we should diff them. // 3. We should update check all child components for changes. if (!currentNativeElement) { currentElement = app.element currentNativeElement = toNative(rootId, '0', currentElement) if (container.children.length > 0) { console.info('deku: The container element is not empty. These elements will be removed. Read more: http://cl.ly/b0Sr') } if (container === document.body) { console.warn('deku: Using document.body is allowed but it can cause some issues. Read more: http://cl.ly/b0SC') } removeAllChildren(container); container.appendChild(currentNativeElement) } else if (currentElement !== app.element) { currentNativeElement = patch(rootId, currentElement, app.element, currentNativeElement) currentElement = app.element updateChildren(rootId) } else { updateChildren(rootId) } // Call mount events on all new entities flushMountQueue() // Allow rendering again. isRendering = false } /** * Call hooks for all new entities that have been created in * the last render from the bottom up. */ function flushMountQueue () { var entityId while (entityId = mountQueue.pop()) { var entity = entities[entityId] trigger('afterRender', entity, [entity.context, entity.nativeElement]) triggerUpdate('afterMount', entity, [entity.context, entity.nativeElement, setState(entity)]) } } /** * Clear the current scheduled frame */ function clearFrame () { if (!frameId) return raf.cancel(frameId) frameId = 0 } /** * Update a component. * * The entity is just the data object for a component instance. * * @param {String} id Component instance id. */ function updateEntity (entityId) { var entity = entities[entityId] setSources(entity) if (!shouldUpdate(entity)) { commit(entity) return updateChildren(entityId) } var currentTree = entity.virtualElement var nextProps = entity.pendingProps var nextState = entity.pendingState var previousState = entity.context.state var previousProps = entity.context.props // hook before rendering. could modify state just before the render occurs. trigger('beforeUpdate', entity, [entity.context, nextProps, nextState]) trigger('beforeRender', entity, [entity.context]) // commit state and props. commit(entity) // re-render. var nextTree = renderEntity(entity) // if the tree is the same we can just skip this component // but we should still check the children to see if they're dirty. // This allows us to memoize the render function of components. if (nextTree === currentTree) return updateChildren(entityId) // apply new virtual tree to native dom. entity.nativeElement = patch(entityId, currentTree, nextTree, entity.nativeElement) entity.virtualElement = nextTree updateChildren(entityId) // trigger render hook trigger('afterRender', entity, [entity.context, entity.nativeElement]) // trigger afterUpdate after all children have updated. triggerUpdate('afterUpdate', entity, [entity.context, previousProps, previousState]) } /** * Update all the children of an entity. * * @param {String} id Component instance id. */ function updateChildren (entityId) { forEach(children[entityId], function (childId) { updateEntity(childId) }) } /** * Remove all of the child entities of an entity * * @param {Entity} entity */ function unmountChildren (entityId) { forEach(children[entityId], function (childId) { unmountEntity(childId) }) } /** * Remove the root element. If this is called synchronously we need to * cancel any pending future updates. */ function removeNativeElement () { clearFrame() removeElement(rootId, '0', currentNativeElement) currentNativeElement = null } /** * Create a native element from a virtual element. * * @param {String} entityId * @param {String} path * @param {Object} vnode * * @return {HTMLDocumentFragment} */ function toNative (entityId, path, vnode) { switch (vnode.type) { case 'text': return toNativeText(vnode) case 'element': return toNativeElement(entityId, path, vnode) case 'component': return toNativeComponent(entityId, path, vnode) } } /** * Create a native text element from a virtual element. * * @param {Object} vnode */ function toNativeText (vnode) { return document.createTextNode(vnode.data) } /** * Create a native element from a virtual element. */ function toNativeElement (entityId, path, vnode) { var attributes = vnode.attributes var children = vnode.children var tagName = vnode.tagName var el // create element either from pool or fresh. if (!options.pooling || !canPool(tagName)) { if (svg.isElement(tagName)) { el = document.createElementNS(svg.namespace, tagName) } else { el = document.createElement(tagName) } } else { var pool = getPool(tagName) el = cleanup(pool.pop()) if (el.parentNode) el.parentNode.removeChild(el) } // set attributes. forEach(attributes, function (value, name) { setAttribute(entityId, path, el, name, value) }) // store keys on the native element for fast event handling. el.__entity__ = entityId el.__path__ = path // add children. forEach(children, function (child, i) { var childEl = toNative(entityId, path + '.' + i, child) if (!childEl.parentNode) el.appendChild(childEl) }) return el } /** * Create a native element from a component. */ function toNativeComponent (entityId, path, vnode) { var child = new Entity(vnode.component, vnode.props, entityId) children[entityId][path] = child.id return mountEntity(child) } /** * Patch an element with the diff from two trees. */ function patch (entityId, prev, next, el) { return diffNode('0', entityId, prev, next, el) } /** * Create a diff between two trees of nodes. */ function diffNode (path, entityId, prev, next, el) { // Type changed. This could be from element->text, text->ComponentA, // ComponentA->ComponentB etc. But NOT div->span. These are the same type // (ElementNode) but different tag name. if (prev.type !== next.type) return replaceElement(entityId, path, el, next) switch (next.type) { case 'text': return diffText(prev, next, el) case 'element': return diffElement(path, entityId, prev, next, el) case 'component': return diffComponent(path, entityId, prev, next, el) } } /** * Diff two text nodes and update the element. */ function diffText (previous, current, el) { if (current.data !== previous.data) el.data = current.data return el } /** * Diff the children of an ElementNode. */ function diffChildren (path, entityId, prev, next, el) { var positions = [] var hasKeys = false var childNodes = Array.prototype.slice.apply(el.childNodes) var leftKeys = reduce(prev.children, keyMapReducer, {}) var rightKeys = reduce(next.children, keyMapReducer, {}) var currentChildren = assign({}, children[entityId]) function keyMapReducer (acc, child) { if (child.key != null) { acc[child.key] = child hasKeys = true } return acc } // Diff all of the nodes that have keys. This lets us re-used elements // instead of overriding them and lets us move them around. if (hasKeys) { // Removals forEach(leftKeys, function (leftNode, key) { if (rightKeys[key] == null) { var leftPath = path + '.' + leftNode.index removeElement( entityId, leftPath, childNodes[leftNode.index] ) } }) // Update nodes forEach(rightKeys, function (rightNode, key) { var leftNode = leftKeys[key] // We only want updates for now if (leftNode == null) return var leftPath = path + '.' + leftNode.index // Updated positions[rightNode.index] = diffNode( leftPath, entityId, leftNode, rightNode, childNodes[leftNode.index] ) }) // Update the positions of all child components and event handlers forEach(rightKeys, function (rightNode, key) { var leftNode = leftKeys[key] // We just want elements that have moved around if (leftNode == null || leftNode.index === rightNode.index) return var rightPath = path + '.' + rightNode.index var leftPath = path + '.' + leftNode.index // Update all the child component path positions to match // the latest positions if they've changed. This is a bit hacky. forEach(currentChildren, function (childId, childPath) { if (leftPath === childPath) { delete children[entityId][childPath] children[entityId][rightPath] = childId } }) }) // Now add all of the new nodes last in case their path // would have conflicted with one of the previous paths. forEach(rightKeys, function (rightNode, key) { var rightPath = path + '.' + rightNode.index if (leftKeys[key] == null) { positions[rightNode.index] = toNative( entityId, rightPath, rightNode ) } }) } else { var maxLength = Math.max(prev.children.length, next.children.length) // Now diff all of the nodes that don't have keys for (var i = 0; i < maxLength; i++) { var leftNode = prev.children[i] var rightNode = next.children[i] // Removals if (rightNode == null) { removeElement( entityId, path + '.' + leftNode.index, childNodes[leftNode.index] ) } // New Node if (leftNode == null) { positions[rightNode.index] = toNative( entityId, path + '.' + rightNode.index, rightNode ) } // Updated if (leftNode && rightNode) { positions[leftNode.index] = diffNode( path + '.' + leftNode.index, entityId, leftNode, rightNode, childNodes[leftNode.index] ) } } } // Reposition all the elements forEach(positions, function (childEl, newPosition) { var target = el.childNodes[newPosition] if (childEl !== target) { if (target) { el.insertBefore(childEl, target) } else { el.appendChild(childEl) } } }) } /** * Diff the attributes and add/remove them. */ function diffAttributes (prev, next, el, entityId, path) { var nextAttrs = next.attributes var prevAttrs = prev.attributes // add new attrs forEach(nextAttrs, function (value, name) { if (events[name] || !(name in prevAttrs) || prevAttrs[name] !== value) { setAttribute(entityId, path, el, name, value) } }) // remove old attrs forEach(prevAttrs, function (value, name) { if (!(name in nextAttrs)) { removeAttribute(entityId, path, el, name) } }) } /** * Update a component with the props from the next node. If * the component type has changed, we'll just remove the old one * and replace it with the new component. */ function diffComponent (path, entityId, prev, next, el) { if (next.component !== prev.component) { return replaceElement(entityId, path, el, next) } else { var targetId = children[entityId][path] // This is a hack for now if (targetId) { updateEntityProps(targetId, next.props) } return el } } /** * Diff two element nodes. */ function diffElement (path, entityId, prev, next, el) { if (next.tagName !== prev.tagName) return replaceElement(entityId, path, el, next) diffAttributes(prev, next, el, entityId, path) diffChildren(path, entityId, prev, next, el) return el } /** * Removes an element from the DOM and unmounts and components * that are within that branch * * side effects: * - removes element from the DOM * - removes internal references * * @param {String} entityId * @param {String} path * @param {HTMLElement} el */ function removeElement (entityId, path, el) { var childrenByPath = children[entityId] var childId = childrenByPath[path] var entityHandlers = handlers[entityId] || {} var removals = [] // If the path points to a component we should use that // components element instead, because it might have moved it. if (childId) { var child = entities[childId] el = child.nativeElement unmountEntity(childId) removals.push(path) } else { // Just remove the text node if (!isElement(el)) return el && el.parentNode.removeChild(el) // Then we need to find any components within this // branch and unmount them. forEach(childrenByPath, function (childId, childPath) { if (childPath === path || isWithinPath(path, childPath)) { unmountEntity(childId) removals.push(childPath) } }) // Remove all events at this path or below it forEach(entityHandlers, function (fn, handlerPath) { if (handlerPath === path || isWithinPath(path, handlerPath)) { removeEvent(entityId, handlerPath) } }) } // Remove the paths from the object without touching the // old object. This keeps the object using fast properties. forEach(removals, function (path) { delete children[entityId][path] }) // Remove it from the DOM el.parentNode.removeChild(el) // Return all of the elements in this node tree to the pool // so that the elements can be re-used. if (options.pooling) { walk(el, function (node) { if (!isElement(node) || !canPool(node.tagName)) return getPool(node.tagName.toLowerCase()).push(node) }) } } /** * Replace an element in the DOM. Removing all components * within that element and re-rendering the new virtual node. * * @param {Entity} entity * @param {String} path * @param {HTMLElement} el * @param {Object} vnode * * @return {void} */ function replaceElement (entityId, path, el, vnode) { var parent = el.parentNode var index = Array.prototype.indexOf.call(parent.childNodes, el) // remove the previous element and all nested components. This // needs to happen before we create the new element so we don't // get clashes on the component paths. removeElement(entityId, path, el) // then add the new element in there var newEl = toNative(entityId, path, vnode) var target = parent.childNodes[index] if (target) { parent.insertBefore(newEl, target) } else { parent.appendChild(newEl) } // walk up the tree and update all `entity.nativeElement` references. if (entityId !== 'root' && path === '0') { updateNativeElement(entityId, newEl) } return newEl } /** * Update all entities in a branch that have the same nativeElement. This * happens when a component has another component as it's root node. * * @param {String} entityId * @param {HTMLElement} newEl * * @return {void} */ function updateNativeElement (entityId, newEl) { var target = entities[entityId] if (target.ownerId === 'root') return if (children[target.ownerId]['0'] === entityId) { entities[target.ownerId].nativeElement = newEl updateNativeElement(target.ownerId, newEl) } } /** * Set the attribute of an element, performing additional transformations * dependning on the attribute name * * @param {HTMLElement} el * @param {String} name * @param {String} value */ function setAttribute (entityId, path, el, name, value) { if (events[name]) { addEvent(entityId, path, events[name], value) return } switch (name) { case 'checked': case 'disabled': case 'selected': el[name] = true break case 'innerHTML': case 'value': el[name] = value break case svg.isAttribute(name): el.setAttributeNS(svg.namespace, name, value) break default: el.setAttribute(name, value) break } } /** * Remove an attribute, performing additional transformations * dependning on the attribute name * * @param {HTMLElement} el * @param {String} name */ function removeAttribute (entityId, path, el, name) { if (events[name]) { removeEvent(entityId, path, events[name]) return } switch (name) { case 'checked': case 'disabled': case 'selected': el[name] = false break case 'innerHTML': case 'value': el[name] = "" break default: el.removeAttribute(name) break } } /** * Checks to see if one tree path is within * another tree path. Example: * * 0.1 vs 0.1.1 = true * 0.2 vs 0.3.5 = false * * @param {String} target * @param {String} path * * @return {Boolean} */ function isWithinPath (target, path) { return path.indexOf(target + '.') === 0 } /** * Is the DOM node an element node * * @param {HTMLElement} el * * @return {Boolean} */ function isElement (el) { return !!(el && el.tagName) } /** * Get the pool for a tagName, creating it if it * doesn't exist. * * @param {String} tagName * * @return {Pool} */ function getPool (tagName) { var pool = pools[tagName] if (!pool) { var poolOpts = svg.isElement(tagName) ? { namespace: svg.namespace, tagName: tagName } : { tagName: tagName } pool = pools[tagName] = new Pool(poolOpts) } return pool } /** * Clean up previously used native element for reuse. * * @param {HTMLElement} el */ function cleanup (el) { removeAllChildren(el) removeAllAttributes(el) return el } /** * Remove all the attributes from a node * * @param {HTMLElement} el */ function removeAllAttributes (el) { for (var i = el.attributes.length - 1; i >= 0; i--) { var name = el.attributes[i].name el.removeAttribute(name) } } /** * Remove all the child nodes from an element * * @param {HTMLElement} el */ function removeAllChildren (el) { while (el.firstChild) el.removeChild(el.firstChild) } /** * Trigger a hook on a component. * * @param {String} name Name of hook. * @param {Entity} entity The component instance. * @param {Array} args To pass along to hook. */ function trigger (name, entity, args) { if (typeof entity.component[name] !== 'function') return return entity.component[name].apply(null, args) } /** * Trigger a hook on the component and allow state to be * updated too. * * @param {String} name * @param {Object} entity * @param {Array} args * * @return {void} */ function triggerUpdate (name, entity, args) { var update = setState(entity) args.push(update) var result = trigger(name, entity, args) if (result) { updateEntityStateAsync(entity, result) } } /** * Update the entity state using a promise * * @param {Entity} entity * @param {Promise} promise */ function updateEntityStateAsync (entity, value) { if (isPromise(value)) { value.then(function (newState) { updateEntityState(entity, newState) }) } else { updateEntityState(entity, value) } } /** * Update an entity to match the latest rendered vode. We always * replace the props on the component when composing them. This * will trigger a re-render on all children below this point. * * @param {Entity} entity * @param {String} path * @param {Object} vnode * * @return {void} */ function updateEntityProps (entityId, nextProps) { var entity = entities[entityId] entity.pendingProps = nextProps entity.dirty = true invalidate() } /** * Update component instance state. */ function updateEntityState (entity, nextState) { entity.pendingState = assign(entity.pendingState, nextState) entity.dirty = true invalidate() } /** * Commit props and state changes to an entity. */ function commit (entity) { entity.context = { state: entity.pendingState, props: entity.pendingProps, id: entity.id } entity.pendingState = assign({}, entity.context.state) entity.pendingProps = assign({}, entity.context.props) validateProps(entity.context.props, entity.propTypes) entity.dirty = false } /** * Try to avoid creating new virtual dom if possible. * * Later we may expose this so you can override, but not there yet. */ function shouldUpdate (entity) { if (!entity.dirty) return false if (!entity.component.shouldUpdate) return true var nextProps = entity.pendingProps var nextState = entity.pendingState var bool = entity.component.shouldUpdate(entity.context, nextProps, nextState) return bool } /** * Register an entity. * * This is mostly to pre-preprocess component properties and values chains. * * The end result is for every component that gets mounted, * you create a set of IO nodes in the network from the `value` definitions. * * @param {Component} component */ function register (entity) { registerEntity(entity) var component = entity.component if (component.registered) return // initialize sources once for a component type. registerSources(entity) component.registered = true } /** * Add entity to data-structures related to components/entities. * * @param {Entity} entity */ function registerEntity(entity) { var component = entity.component // all entities for this component type. var entities = component.entities = component.entities || {} // add entity to component list entities[entity.id] = entity // map to component so you can remove later. components[entity.id] = component } /** * Initialize sources for a component by type. * * @param {Entity} entity */ function registerSources(entity) { var component = components[entity.id] // get 'class-level' sources. // if we've already hooked it up, then we're good. var sources = component.sources if (sources) return var entities = component.entities // hook up sources. var map = component.sourceToPropertyName = {} component.sources = sources = [] var propTypes = component.propTypes for (var name in propTypes) { var data = propTypes[name] if (!data) continue if (!data.source) continue sources.push(data.source) map[data.source] = name } // send value updates to all component instances. sources.forEach(function (source) { connections[source] = connections[source] || [] connections[source].push(update) function update (data) { var prop = map[source] for (var entityId in entities) { var entity = entities[entityId] var changes = {} changes[prop] = data updateEntityProps(entityId, assign(entity.pendingProps, changes)) } } }) } /** * Set the initial source value on the entity * * @param {Entity} entity */ function setSources (entity) { var component = entity.component var map = component.sourceToPropertyName var sources = component.sources sources.forEach(function (source) { var name = map[source] if (entity.pendingProps[name] != null) return entity.pendingProps[name] = app.sources[source] // get latest value plugged into global store }) } /** * Add all of the DOM event listeners */ function addNativeEventListeners () { forEach(events, function (eventType) { document.body.addEventListener(eventType, handleEvent, true) }) } /** * Add all of the DOM event listeners */ function removeNativeEventListeners () { forEach(events, function (eventType) { document.body.removeEventListener(eventType, handleEvent, true) }) } /** * Handle an event that has occured within the container * * @param {Event} event */ function handleEvent (event) { var target = event.target var eventType = event.type // Walk up the DOM tree and see if there is a handler // for this event type higher up. while (target) { var fn = keypath.get(handlers, [target.__entity__, target.__path__, eventType]) if (fn) { event.delegateTarget = target fn(event) break } target = target.parentNode } } /** * Bind events for an element, and all it's rendered child elements. * * @param {String} path * @param {String} event * @param {Function} fn */ function addEvent (entityId, path, eventType, fn) { keypath.set(handlers, [entityId, path, eventType], function (e) { var entity = entities[entityId] if (entity) { var update = setState(entity) var result = fn.call(null, e, entity.context, update) if (result) { updateEntityStateAsync(entity, result) } } else { fn.call(null, e) } }) } /** * Unbind events for a entityId * * @param {String} entityId */ function removeEvent (entityId, path, eventType) { var args = [entityId] if (path) args.push(path) if (eventType) args.push(eventType) keypath.del(handlers, args) } /** * Unbind all events from an entity * * @param {Entity} entity */ function removeAllEvents (entityId) { keypath.del(handlers, [entityId]) } /** * Validate the current properties. These simple validations * make it easier to ensure the correct props are passed in. * * Available rules include: * * type: {String} string | array | object | boolean | number | date | function * {Array} An array of types mentioned above * {Function} fn(value) should return `true` to pass in * expects: [] An array of values this prop could equal * optional: Boolean */ function validateProps (props, rules, optPrefix) { var prefix = optPrefix || '' if (!options.validateProps) return forEach(rules, function (options, name) { if (!options) { throw new Error('deku: propTypes should have an options object for each type') } var propName = prefix ? prefix + '.' + name : name var value = keypath.get(props, name) var valueType = type(value) var typeFormat = type(options.type) var optional = (options.optional === true) // If it's optional and doesn't exist if (optional && value == null) { return } // If it's required and doesn't exist if (!optional && value == null) { throw new TypeError('Missing property: ' + propName) } // It's a nested type if (typeFormat === 'object') { validateProps(value, options.type, propName) return } // If it's the incorrect type if (typeFormat === 'string' && valueType !== options.type) { throw new TypeError('Invalid property type: ' + propName) } // If type is validate function if (typeFormat === 'function' && !options.type(value)) { throw new TypeError('Invalid property type: ' + propName) } // if type is array of possible types if (typeFormat === 'array' && options.type.indexOf(valueType) < 0) { throw new TypeError('Invalid property type: ' + propName) } // If it's an invalid value if (options.expects && options.expects.indexOf(value) < 0) { throw new TypeError('Invalid property value: ' + propName) } }) // Now check for props that haven't been defined forEach(props, function (value, key) { // props.children is always passed in, even if it's not defined if (key === 'children') return if (!rules[key]) throw new Error('Unexpected property: ' + key) }) } /** * Used for debugging to inspect the current state without * us needing to explicitly manage storing/updating references. * * @return {Object} */ function inspect () { return { entities: entities, pools: pools, handlers: handlers, connections: connections, currentElement: currentElement, options: options, app: app, container: container, children: children } } /** * Return an object that lets us completely remove the automatic * DOM rendering and export debugging tools. */ return { remove: teardown, inspect: inspect } } /** * A rendered component instance. * * This manages the lifecycle, props and state of the component. * It's basically just a data object for more straightfoward lookup. * * @param {Component} component * @param {Object} props */ function Entity (component, props, ownerId) { this.id = uid() this.ownerId = ownerId this.component = component this.propTypes = component.propTypes || {} this.context = {} this.context.id = this.id; this.context.props = defaults(props || {}, component.defaultProps || {}) this.context.state = this.component.initialState ? this.component.initialState(this.context.props) : {} this.pendingProps = assign({}, this.context.props) this.pendingState = assign({}, this.context.state) this.dirty = false this.virtualElement = null this.nativeElement = null this.displayName = component.name || 'Component' } /** * Should we pool an element? */ function canPool(tagName) { return avoidPooling.indexOf(tagName) < 0 } /** * Get a nested node using a path * * @param {HTMLElement} el The root node '0' * @param {String} path The path string eg. '0.2.43' */ function getNodeAtPath(el, path) { var parts = path.split('.') parts.shift() while (parts.length) { el = el.childNodes[parts.pop()] } return el } /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { /** * The npm 'defaults' module but without clone because * it was requiring the 'Buffer' module which is huge. * * @param {Object} options * @param {Object} defaults * * @return {Object} */ exports.defaults = function(options, defaults) { Object.keys(defaults).forEach(function(key) { if (typeof options[key] === 'undefined') { options[key] = defaults[key] } }) return options } /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { /** * Expose `requestAnimationFrame()`. */ exports = module.exports = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || fallback; /** * Fallback implementation. */ var prev = new Date().getTime(); function fallback(fn) { var curr = new Date().getTime(); var ms = Math.max(0, 16 - (curr - prev)); var req = setTimeout(fn, ms); prev = curr; return req; } /** * Cancel. */ var cancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.clearTimeout; exports.cancel = function(id){ cancel.call(window, id); }; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { function Pool(params) { if (typeof params !== 'object') { throw new Error("Please pass parameters. Example -> new Pool({ tagName: \"div\" })"); } if (typeof params.tagName !== 'string') { throw new Error("Please specify a tagName. Example -> new Pool({ tagName: \"div\" })"); } this.storage = []; this.tagName = params.tagName.toLowerCase(); this.namespace = params.namespace; } Pool.prototype.push = function(el) { if (el.tagName.toLowerCase() !== this.tagName) { return; } this.storage.push(el); }; Pool.prototype.pop = function(argument) { if (this.storage.length === 0) { return this.create(); } else { return this.storage.pop(); } }; Pool.prototype.create = function() { if (this.namespace) { return document.createElementNS(this.namespace, this.tagName); } else { return document.createElement(this.tagName); } }; Pool.prototype.allocate = function(size) { if (this.storage.length >= size) { return; } var difference = size - this.storage.length; for (var poolAllocIter = 0; poolAllocIter < difference; poolAllocIter++) { this.storage.push(this.create()); } }; if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = Pool; } /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { var slice = Array.prototype.slice module.exports = iterativelyWalk function iterativelyWalk(nodes, cb) { if (!('length' in nodes)) { nodes = [nodes] } nodes = slice.call(nodes) while(nodes.length) { var node = nodes.shift(), ret = cb(node) if (ret) { return ret } if (node.childNodes && node.childNodes.length) { nodes = slice.call(node.childNodes).concat(nodes) } } } /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { /*global window*/ /** * Check if object is dom node. * * @param {Object} val * @return {Boolean} * @api public */ module.exports = function isNode(val){ if (!val || typeof val !== 'object') return false; if (window && 'object' == typeof window.Node) return val instanceof window.Node; return 'number' == typeof val.nodeType && 'string' == typeof val.nodeName; } /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { /** generate unique id for selector */ var counter = Date.now() % 1e9; module.exports = function getUid(){ return (Math.random() * 1e9 >>> 0) + (counter++); }; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){ 'use strict'; /*istanbul ignore next:cant test*/ if (typeof module === 'object' && typeof module.exports === 'object') { module.exports = factory(); } else if (true) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { // Browser globals root.objectPath = factory(); } })(this, function(){ 'use strict'; var toStr = Object.prototype.toString, _hasOwnProperty = Object.prototype.hasOwnProperty; function isEmpty(value){ if (!value) { return true; } if (isArray(value) && value.length === 0) { return true; } else { for (var i in value) { if (_hasOwnProperty.call(value, i)) { return false; } } return true; } } function toString(type){ return toStr.call(type); } function isNumber(value){ return typeof value === 'number' || toString(value) === "[object Number]"; } function isString(obj){ return typeof obj === 'string' || toString(obj) === "[object String]"; } function isObject(obj){ return typeof obj === 'object' && toString(obj) === "[object Object]"; } function isArray(obj){ return typeof obj === 'object' && typeof obj.length === 'number' && toString(obj) === '[object Array]'; } function isBoolean(obj){ return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'; } function getKey(key){ var intKey = parseInt(key); if (intKey.toString() === key) { return intKey; } return key; } function set(obj, path, value, doNotReplace){ if (isNumber(path)) { path = [path]; } if (isEmpty(path)) { return obj; } if (isString(path)) { return set(obj, path.split('.').map(getKey), value, doNotReplace); } var currentPath = path[0]; if (path.length === 1) { var oldVal = obj[currentPath]; if (oldVal === void 0 || !doNotReplace) { obj[currentPath] = value; } return oldVal; } if (obj[currentPath] === void 0) { //check if we assume an array if(isNumber(path[1])) { obj[currentPath] = []; } else { obj[currentPath] = {}; } } return set(obj[currentPath], path.slice(1), value, doNotReplace); } function del(obj, path) { if (isNumber(path)) { path = [path]; } if (isEmpty(obj)) { return void 0; } if (isEmpty(path)) { return obj; } if(isString(path)) { return del(obj, path.split('.')); } var currentPath = getKey(path[0]); var oldVal = obj[currentPath]; if(path.length === 1) { if (oldVal !== void 0) { if (isArray(obj)) { obj.splice(currentPath, 1); } else { delete obj[currentPath]; } } } else { if (obj[currentPath] !== void 0) { return del(obj[currentPath], path.slice(1)); } } return obj; } var objectPath = {}; objectPath.has = function (obj, path) { if (isEmpty(obj)) { return false; } if (isNumber(path)) { path = [path]; } else if (isString(path)) { path = path.split('.'); } if (isEmpty(path) || path.length === 0) { return false; } for (var i = 0; i < path.length; i++) { var j = path[i]; if ((isObject(obj) || isArray(obj)) && _hasOwnProperty.call(obj, j)) { obj = obj[j]; } else { return false; } } return true; }; objectPath.ensureExists = function (obj, path, value){ return set(obj, path, value, true); }; objectPath.set = function (obj, path, value, doNotReplace){ return set(obj, path, value, doNotReplace); }; objectPath.insert = function (obj, path, value, at){ var arr = objectPath.get(obj, path); at = ~~at; if (!isArray(arr)) { arr = []; objectPath.set(obj, path, arr); } arr.splice(at, 0, value); }; objectPath.empty = function(obj, path) { if (isEmpty(path)) { return obj; } if (isEmpty(obj)) { return void 0; } var value, i; if (!(value = objectPath.get(obj, path))) { return obj; } if (isString(value)) { return objectPath.set(obj, path, ''); } else if (isBoolean(value)) { return objectPath.set(obj, path, false); } else if (isNumber(value)) { return objectPath.set(obj, path, 0); } else if (isArray(value)) { value.length = 0; } else if (isObject(value)) { for (i in value) { if (_hasOwnProperty.call(value, i)) { delete value[i]; } } } else { return objectPath.set(obj, path, null); } }; objectPath.push = function (obj, path /*, values */){ var arr = objectPath.get(obj, path); if (!isArray(arr)) { arr = []; objectPath.set(obj, path, arr); } arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); }; objectPath.coalesce = function (obj, paths, defaultValue) { var value; for (var i = 0, len = paths.length; i < len; i++) { if ((value = objectPath.get(obj, paths[i])) !== void 0) { return value; } } return defaultValue; }; objectPath.get = function (obj, path, defaultValue){ if (isNumber(path)) { path = [path]; } if (isEmpty(path)) { return obj; } if (isEmpty(obj)) { return defaultValue; } if (isString(path)) { return objectPath.get(obj, path.split('.'), defaultValue); } var currentPath = getKey(path[0]); if (path.length === 1) { if (obj[currentPath] === void 0) { return defaultValue; } return obj[currentPath]; } return objectPath.get(obj[currentPath], path.slice(1), defaultValue); }; objectPath.del = function(obj, path) { return del(obj, path); }; return objectPath; }); /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { /** * toString ref. */ var toString = Object.prototype.toString; /** * Return the type of `val`. * * @param {Mixed} val * @return {String} * @api public */ module.exports = function(val){ switch (toString.call(val)) { case '[object Date]': return 'date'; case '[object RegExp]': return 'regexp'; case '[object Arguments]': return 'arguments'; case '[object Array]': return 'array'; case '[object Error]': return 'error'; } if (val === null) return 'null'; if (val === undefined) return 'undefined'; if (val !== val) return 'nan'; if (val && val.nodeType === 1) return 'element'; val = val.valueOf ? val.valueOf() : Object.prototype.valueOf.apply(val) return typeof val; }; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { var indexOf = __webpack_require__(20) /** * This file lists the supported SVG elements used by the * renderer. We may add better SVG support in the future * that doesn't require whitelisting elements. */ exports.namespace = 'http://www.w3.org/2000/svg' /** * Supported SVG elements * * @type {Array} */ exports.elements = [ 'animate', 'circle', 'defs', 'ellipse', 'g', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan' ] /** * Supported SVG attributes */ exports.attributes = [ 'cx', 'cy', 'd', 'dx', 'dy', 'fill', 'fillOpacity', 'fontFamily', 'fontSize', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'markerEnd', 'markerMid', 'markerStart', 'offset', 'opacity', 'patternContentUnits', 'patternUnits', 'points', 'preserveAspectRatio', 'r', 'rx', 'ry', 'spreadMethod', 'stopColor', 'stopOpacity', 'stroke', 'strokeDasharray', 'strokeLinecap', 'strokeOpacity', 'strokeWidth', 'textAnchor', 'transform', 'version', 'viewBox', 'x1', 'x2', 'x', 'y1', 'y2', 'y' ] /** * Is element's namespace SVG? * * @param {String} name */ exports.isElement = function (name) { return indexOf(exports.elements, name) !== -1 } /** * Are element's attributes SVG? * * @param {String} attr */ exports.isAttribute = function (attr) { return indexOf(exports.attributes, attr) !== -1 } /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * # Index Of * * A faster `Array.prototype.indexOf()` implementation. * * @param {Array} subject The array (or array-like) to search within. * @param {mixed} target The target item to search for. * @param {Number} fromIndex The position to start searching from, if known. * @return {Number} The position of the target in the subject, or -1 if it does not exist. */ module.exports = function fastIndexOf (subject, target, fromIndex) { var length = subject.length, i = 0; if (typeof fromIndex === 'number') { i = fromIndex; if (i < 0) { i += length; if (i < 0) { i = 0; } } } for (; i < length; i++) { if (subject[i] === target) { return i; } } return -1; }; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { /** * All of the events can bind to */ module.exports = { onBlur: 'blur', onChange: 'change', onClick: 'click', onContextMenu: 'contextmenu', onCopy: 'copy', onCut: 'cut', onDoubleClick: 'dblclick', onDrag: 'drag', onDragEnd: 'dragend', onDragEnter: 'dragenter', onDragExit: 'dragexit', onDragLeave: 'dragleave', onDragOver: 'dragover', onDragStart: 'dragstart', onDrop: 'drop', onFocus: 'focus', onInput: 'input', onKeyDown: 'keydown', onKeyPress: 'keypress', onKeyUp: 'keyup', onMouseDown: 'mousedown', onMouseEnter: 'mouseenter', onMouseLeave: 'mouseleave', onMouseMove: 'mousemove', onMouseOut: 'mouseout', onMouseOver: 'mouseover', onMouseUp: 'mouseup', onPaste: 'paste', onScroll: 'scroll', onSubmit: 'submit', onTouchCancel: 'touchcancel', onTouchEnd: 'touchend', onTouchMove: 'touchmove', onTouchStart: 'touchstart', onWheel: 'wheel' } /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var forEachArray = __webpack_require__(23), forEachObject = __webpack_require__(25); /** * # ForEach * * A fast `.forEach()` implementation. * * @param {Array|Object} subject The array or object to iterate over. * @param {Function} fn The visitor function. * @param {Object} thisContext The context for the visitor. */ module.exports = function fastForEach (subject, fn, thisContext) { if (subject instanceof Array) { return forEachArray(subject, fn, thisContext); } else { return forEachObject(subject, fn, thisContext); } }; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var bindInternal3 = __webpack_require__(24); /** * # For Each * * A fast `.forEach()` implementation. * * @param {Array} subject The array (or array-like) to iterate over. * @param {Function} fn The visitor function. * @param {Object} thisContext The context for the visitor. */ module.exports = function fastForEach (subject, fn, thisContext) { var length = subject.length, iterator = thisContext !== undefined ? bindInternal3(fn, thisContext) : fn, i; for (i = 0; i < length; i++) { iterator(subject[i], i, subject); } }; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Internal helper to bind a function known to have 3 arguments * to a given context. */ module.exports = function bindInternal3 (func, thisContext) { return function (a, b, c) { return func.call(thisContext, a, b, c); }; }; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var bindInternal3 = __webpack_require__(24); /** * # For Each * * A fast object `.forEach()` implementation. * * @param {Object} subject The object to iterate over. * @param {Function} fn The visitor function. * @param {Object} thisContext The context for the visitor. */ module.exports = function fastForEachObject (subject, fn, thisContext) { var keys = Object.keys(subject), length = keys.length, iterator = thisContext !== undefined ? bindInternal3(fn, thisContext) : fn, key, i; for (i = 0; i < length; i++) { key = keys[i]; iterator(subject[key], key, subject); } }; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Analogue of Object.assign(). * Copies properties from one or more source objects to * a target object. Existing keys on the target object will be overwritten. * * > Note: This differs from spec in some important ways: * > 1. Will throw if passed non-objects, including `undefined` or `null` values. * > 2. Does not support the curious Exception handling behavior, exceptions are thrown immediately. * > For more details, see: * > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign * * * * @param {Object} target The target object to copy properties to. * @param {Object} source, ... The source(s) to copy properties from. * @return {Object} The updated target object. */ module.exports = function fastAssign (target) { var totalArgs = arguments.length, source, i, totalKeys, keys, key, j; for (i = 1; i < totalArgs; i++) { source = arguments[i]; keys = Object.keys(source); totalKeys = keys.length; for (j = 0; j < totalKeys; j++) { key = keys[j]; target[key] = source[key]; } } return target; }; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var reduceArray = __webpack_require__(28), reduceObject = __webpack_require__(30); /** * # Reduce * * A fast `.reduce()` implementation. * * @param {Array|Object} subject The array or object to reduce over. * @param {Function} fn The reducer function. * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0]. * @param {Object} thisContext The context for the reducer. * @return {Array|Object} The array or object containing the results. */ module.exports = function fastReduce (subject, fn, initialValue, thisContext) { if (subject instanceof Array) { return reduceArray(subject, fn, initialValue, thisContext); } else { return reduceObject(subject, fn, initialValue, thisContext); } }; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var bindInternal4 = __webpack_require__(29); /** * # Reduce * * A fast `.reduce()` implementation. * * @param {Array} subject The array (or array-like) to reduce. * @param {Function} fn The reducer function. * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0]. * @param {Object} thisContext The context for the reducer. * @return {mixed} The final result. */ module.exports = function fastReduce (subject, fn, initialValue, thisContext) { var length = subject.length, iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn, i, result; if (initialValue === undefined) { i = 1; result = subject[0]; } else { i = 0; result = initialValue; } for (; i < length; i++) { result = iterator(result, subject[i], i, subject); } return result; }; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Internal helper to bind a function known to have 4 arguments * to a given context. */ module.exports = function bindInternal4 (func, thisContext) { return function (a, b, c, d) { return func.call(thisContext, a, b, c, d); }; }; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var bindInternal4 = __webpack_require__(29); /** * # Reduce * * A fast object `.reduce()` implementation. * * @param {Object} subject The object to reduce over. * @param {Function} fn The reducer function. * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0]. * @param {Object} thisContext The context for the reducer. * @return {mixed} The final result. */ module.exports = function fastReduceObject (subject, fn, initialValue, thisContext) { var keys = Object.keys(subject), length = keys.length, iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn, i, key, result; if (initialValue === undefined) { i = 1; result = subject[keys[0]]; } else { i = 0; result = initialValue; } for (; i < length; i++) { key = keys[i]; result = iterator(result, subject[key], key, subject); } return result; }; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { module.exports = isPromise; function isPromise(obj) { return obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var utils = __webpack_require__(11) var events = __webpack_require__(21) var defaults = utils.defaults /** * Expose `stringify`. */ module.exports = function (app) { if (!app.element) { throw new Error('No element mounted') } /** * Render to string. * * @param {Component} component * @param {Object} [props] * @return {String} */ function stringify (component, optProps) { var propTypes = component.propTypes || {} var props = defaults(optProps || {}, component.defaultProps || {}) var state = component.initialState ? component.initialState(props) : {} for (var name in propTypes) { var options = propTypes[name] if (options.source) { props[name] = app.sources[options.source] } } if (component.beforeMount) component.beforeMount({ props: props, state: state }) if (component.beforeRender) component.beforeRender({ props: props, state: state }) var node = component.render({ props: props, state: state }) return stringifyNode(node, '0') } /** * Render a node to a string * * @param {Node} node * @param {Tree} tree * * @return {String} */ function stringifyNode (node, path) { switch (node.type) { case 'text': return node.data case 'element': var children = node.children var attributes = node.attributes var tagName = node.tagName var innerHTML = attributes.innerHTML var str = '<' + tagName + attrs(attributes) + '>' if (innerHTML) { str += innerHTML } else { for (var i = 0, n = children.length; i < n; i++) { str += stringifyNode(children[i], path + '.' + i) } } str += '</' + tagName + '>' return str case 'component': return stringify(node.component, node.props) } throw new Error('Invalid type') } return stringifyNode(app.element, '0') } /** * HTML attributes to string. * * @param {Object} attributes * @return {String} * @api private */ function attrs (attributes) { var str = '' for (var key in attributes) { if (key === 'innerHTML') continue if (events[key]) continue str += attr(key, attributes[key]) } return str } /** * HTML attribute to string. * * @param {String} key * @param {String} val * @return {String} * @api private */ function attr (key, val) { return ' ' + key + '="' + val + '"' } /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { /** * Module dependencies. */ var type = __webpack_require__(18) var slice = __webpack_require__(34) var flatten = __webpack_require__(36) /** * This function lets us create virtual nodes using a simple * syntax. It is compatible with JSX transforms so you can use * JSX to write nodes that will compile to this function. * * let node = virtual('div', { id: 'foo' }, [ * virtual('a', { href: 'http://google.com' }, 'Google') * ]) * * You can leave out the attributes or the children if either * of them aren't needed and it will figure out what you're * trying to do. */ module.exports = virtual /** * Create virtual DOM trees. * * This creates the nicer API for the user. * It translates that friendly API into an actual tree of nodes. * * @param {String|Function} type * @param {Object} props * @param {Array} children * @return {Node} * @api public */ function virtual (type, props, children) { // Default to div with no args if (!type) { throw new Error('deku: Element needs a type. Read more: http://cl.ly/b0KZ') } // Skipped adding attributes and we're passing // in children instead. if (arguments.length === 2 && (typeof props === 'string' || Array.isArray(props))) { children = props props = {} } // Account for JSX putting the children as multiple arguments. // This is essentially just the ES6 rest param if (arguments.length > 2 && Array.isArray(arguments[2]) === false) { children = slice(arguments, 2) } children = children || [] props = props || {} // passing in a single child, you can skip // using the array if (!Array.isArray(children)) { children = [ children ] } children = flatten(children, 1).reduce(normalize, []) // pull the key out from the data. var key = 'key' in props ? String(props.key) : null delete props['key'] // if you pass in a function, it's a `Component` constructor. // otherwise it's an element. var node if (typeof type === 'string') { node = new ElementNode(type, props, key, children) } else { node = new ComponentNode(type, props, key, children) } // set the unique ID node.index = 0 return node } /** * Parse nodes into real `Node` objects. * * @param {Mixed} node * @param {Integer} index * @return {Node} * @api private */ function normalize (acc, node) { if (node == null) { return acc } if (typeof node === 'string' || typeof node === 'number') { var newNode = new TextNode(String(node)) newNode.index = acc.length acc.push(newNode) } else { node.index = acc.length acc.push(node) } return acc } /** * Initialize a new `ComponentNode`. * * @param {Component} component * @param {Object} props * @param {String} key Used for sorting/replacing during diffing. * @param {Array} children Child virtual nodes * @api public */ function ComponentNode (component, props, key, children) { this.key = key this.props = props this.type = 'component' this.component = component this.props.children = children || [] } /** * Initialize a new `ElementNode`. * * @param {String} tagName * @param {Object} attributes * @param {String} key Used for sorting/replacing during diffing. * @param {Array} children Child virtual dom nodes. * @api public */ function ElementNode (tagName, attributes, key, children) { this.type = 'element' this.attributes = parseAttributes(attributes) this.tagName = tagName this.children = children || [] this.key = key } /** * Initialize a new `TextNode`. * * This is just a virtual HTML text object. * * @param {String} text * @api public */ function TextNode (text) { this.type = 'text' this.data = String(text) } /** * Parse attributes for some special cases. * * TODO: This could be more functional and allow hooks * into the processing of the attributes at a component-level * * @param {Object} attributes * * @return {Object} */ function parseAttributes (attributes) { // style: { 'text-align': 'left' } if (attributes.style) { attributes.style = parseStyle(attributes.style) } // class: { foo: true, bar: false, baz: true } // class: ['foo', 'bar', 'baz'] if (attributes.class) { attributes.class = parseClass(attributes.class) } // Remove attributes with false values var filteredAttributes = {} for (var key in attributes) { var value = attributes[key] if (value == null || value === false) continue filteredAttributes[key] = value } return filteredAttributes } /** * Parse a block of styles into a string. * * TODO: this could do a lot more with vendor prefixing, * number values etc. Maybe there's a way to allow users * to hook into this? * * @param {Object} styles * * @return {String} */ function parseStyle (styles) { if (type(styles) === 'string') { return styles } var str = '' for (var name in styles) { var value = styles[name] str = str + name + ':' + value + ';' } return str; } /** * Parse the class attribute so it's able to be * set in a more user-friendly way * * @param {String|Object|Array} value * * @return {String} */ function parseClass (value) { // { foo: true, bar: false, baz: true } if (type(value) === 'object') { var matched = [] for (var key in value) { if (value[key]) matched.push(key) } value = matched } // ['foo', 'bar', 'baz'] if (type(value) === 'array') { if (value.length === 0) { return } value = value.join(' ') } return value } /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { module.exports = exports = __webpack_require__(35); /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { /** * An Array.prototype.slice.call(arguments) alternative * * @param {Object} args something with a length * @param {Number} slice * @param {Number} sliceEnd * @api public */ module.exports = function (args, slice, sliceEnd) { var ret = []; var len = args.length; if (0 === len) return ret; var start = slice < 0 ? Math.max(0, slice + len) : slice || 0; if (sliceEnd !== undefined) { len = sliceEnd < 0 ? sliceEnd + len : sliceEnd } while (len-- > start) { ret[len - start] = args[len]; } return ret; } /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict' /** * Expose `arrayFlatten`. */ module.exports = arrayFlatten /** * Recursive flatten function with depth. * * @param {Array} array * @param {Array} result * @param {Number} depth * @return {Array} */ function flattenWithDepth (array, result, depth) { for (var i = 0; i < array.length; i++) { var value = array[i] if (depth > 0 && Array.isArray(value)) { flattenWithDepth(value, result, depth - 1) } else { result.push(value) } } return result } /** * Recursive flatten function. Omitting depth is slightly faster. * * @param {Array} array * @param {Array} result * @return {Array} */ function flattenForever (array, result) { for (var i = 0; i < array.length; i++) { var value = array[i] if (Array.isArray(value)) { flattenForever(value, result) } else { result.push(value) } } return result } /** * Flatten an array, with the ability to define a depth. * * @param {Array} array * @param {Number} depth * @return {Array} */ function arrayFlatten (array, depth) { if (depth == null) { return flattenForever(array, []) } return flattenWithDepth(array, [], depth) } /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var _soundcloudAudio = __webpack_require__(38); var _soundcloudAudio2 = _interopRequireDefault(_soundcloudAudio); var _dekuSoundplayerComponents = __webpack_require__(39); var _dekuSoundplayerAddons = __webpack_require__(47); var SoundCloudLogoSVG = _dekuSoundplayerComponents.Icons.SoundCloudLogoSVG; var Player = { propTypes: { duration: { type: 'number', optional: true }, currentTime: { type: 'number', optional: true }, playing: { type: 'boolean', optional: true }, seeking: { type: 'boolean', optional: true }, track: { type: 'object', optional: true }, soundCloudAudio: function soundCloudAudio(prop) { return prop instanceof _soundcloudAudio2['default']; } }, defaultProps: { duration: 0, currentTime: 0, seeking: false, playing: false }, render: function render(component) { var props = component.props; if (!props.track) { return (0, _deku.dom)('span', null); } if (props.track && !props.track.streamable) { return (0, _deku.dom)( 'div', { 'class': 'sb-soundplayer-widget-message' }, (0, _deku.dom)( 'a', { href: props.track.permalink_url, target: '_blank' }, props.track.title ), ' is not streamable!' ); } return (0, _deku.dom)( _dekuSoundplayerComponents.Cover, { artworkUrl: props.track.artwork_url.replace('large', 't500x500') }, (0, _deku.dom)('div', { 'class': 'sb-soundplayer-widget-overlay' }), (0, _deku.dom)( 'div', { 'class': 'sb-soundplayer-widget-track-info' }, (0, _deku.dom)( 'h3', { 'class': 'sb-soundplayer-widget-user' }, props.track.user.username ), (0, _deku.dom)( 'h2', { 'class': 'sb-soundplayer-widget-title' }, props.track.title ) ), (0, _deku.dom)( 'a', { href: props.track.permalink_url, target: '_blank' }, (0, _deku.dom)(SoundCloudLogoSVG, null) ), (0, _deku.dom)( 'div', { 'class': 'sb-soundplayer-widget-controls' }, (0, _deku.dom)(_dekuSoundplayerComponents.PlayButton, { playing: props.playing, soundCloudAudio: props.soundCloudAudio }), (0, _deku.dom)(_dekuSoundplayerComponents.Progress, { value: props.currentTime / props.duration * 100 || 0, soundCloudAudio: props.soundCloudAudio }), (0, _deku.dom)(_dekuSoundplayerComponents.Timer, { duration: props.track.duration / 1000, currentTime: props.currentTime }) ) ); } }; exports['default'] = { propTypes: { resolveUrl: { type: 'string' }, clientId: { type: 'string' } }, render: function render(component) { var props = component.props; return (0, _deku.dom)( _dekuSoundplayerAddons.SoundPlayerContainer, props, (0, _deku.dom)(Player, null) ); } }; module.exports = exports['default']; /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; function SoundCloud (clientId) { if (!(this instanceof SoundCloud)) { return new SoundCloud(clientId); } if (!clientId) { throw new Error('SoundCloud API clientId is required, get it - https://developers.soundcloud.com/'); } this._events = {}; this._clientId = clientId; this._baseUrl = 'http://api.soundcloud.com'; this.playing = false; this.duration = 0; this.audio = document.createElement('audio'); } SoundCloud.prototype.resolve = function (url, callback) { if (!url) { throw new Error('SoundCloud track or playlist url is required'); } url = this._baseUrl+'/resolve.json?url='+url+'&client_id='+this._clientId; this._jsonp(url, function (data) { if (data.tracks) { this._playlist = data; } else { this._track = data; } this.duration = data.duration/1000; // convert to seconds callback(data); }.bind(this)); }; SoundCloud.prototype._jsonp = function (url, callback) { var target = document.getElementsByTagName('script')[0] || document.head; var script = document.createElement('script'); var id = 'jsonp_callback_'+Math.round(100000*Math.random()); window[id] = function (data) { if (script.parentNode) { script.parentNode.removeChild(script); } window[id] = function () {}; callback(data); }; script.src = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'callback=' + id; target.parentNode.insertBefore(script, target); }; SoundCloud.prototype.on = function (e, fn) { this._events[e] = fn; this.audio.addEventListener(e, fn, false); }; SoundCloud.prototype.off = function (e, fn) { this._events[e] = null; this.audio.removeEventListener(e, fn); }; SoundCloud.prototype.unbindAll = function () { for (var e in this._events) { var fn = this._events[e]; if (fn) { this.off(e, fn); } } }; SoundCloud.prototype.preload = function (streamUrl) { this._track = {stream_url: streamUrl}; this.audio.src = streamUrl+'?client_id='+this._clientId; }; SoundCloud.prototype.play = function (options) { options = options || {}; var src; if (options.streamUrl) { src = options.streamUrl; } else if (this._playlist) { var length = this._playlist.tracks.length; if (length) { this._playlistIndex = options.playlistIndex || 0; // be silent if index is out of range if (this._playlistIndex >= length || this._playlistIndex < 0) { this._playlistIndex = 0; return; } src = this._playlist.tracks[this._playlistIndex].stream_url; } } else if (this._track) { src = this._track.stream_url; } if (!src) { throw new Error('There is no tracks to play, use `streamUrl` option or `load` method'); } src += '?client_id='+this._clientId; if (src !== this.audio.src) { this.audio.src = src; } this.playing = src; this.audio.play(); }; SoundCloud.prototype.pause = function () { this.audio.pause(); this.playing = false; }; SoundCloud.prototype.stop = function () { this.audio.pause(); this.audio.currentTime = 0; this.playing = false; }; SoundCloud.prototype.next = function () { var tracksLength = this._playlist.tracks.length; if (this._playlistIndex >= tracksLength-1) { return; } if (this._playlist && tracksLength) { this.play({playlistIndex: ++this._playlistIndex}); } }; SoundCloud.prototype.previous = function () { if (this._playlistIndex <= 0) { return; } if (this._playlist && this._playlist.tracks.length) { this.play({playlistIndex: --this._playlistIndex}); } }; SoundCloud.prototype.seek = function (e) { if (!this.audio.readyState) { return false; } var percent = e.offsetX / e.target.offsetWidth || (e.layerX - e.target.offsetLeft) / e.target.offsetWidth; this.audio.currentTime = percent * (this.audio.duration || 0); }; module.exports = SoundCloud; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(40); /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _PlayButton2 = __webpack_require__(41); var _PlayButton3 = _interopRequireDefault(_PlayButton2); exports.PlayButton = _PlayButton3['default']; var _Progress2 = __webpack_require__(43); var _Progress3 = _interopRequireDefault(_Progress2); exports.Progress = _Progress3['default']; var _Timer2 = __webpack_require__(44); var _Timer3 = _interopRequireDefault(_Timer2); exports.Timer = _Timer3['default']; var _Cover2 = __webpack_require__(45); var _Cover3 = _interopRequireDefault(_Cover2); exports.Cover = _Cover3['default']; var _Icons2 = __webpack_require__(42); var _Icons3 = _interopRequireDefault(_Icons2); exports.Icons = _Icons3['default']; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var _soundcloudAudio = __webpack_require__(38); var _soundcloudAudio2 = _interopRequireDefault(_soundcloudAudio); var _Icons = __webpack_require__(42); exports['default'] = { defaultProps: { playing: false, seeking: false }, propTypes: { playing: { type: 'boolean', optional: true }, seeking: { type: 'boolean', optional: true }, soundCloudAudio: function soundCloudAudio(prop) { return prop instanceof _soundcloudAudio2['default']; } }, render: function render(component) { var props = component.props; function handleClick(e) { e.preventDefault(); var playing = props.playing; var soundCloudAudio = props.soundCloudAudio; if (!playing) { soundCloudAudio && soundCloudAudio.play(); } else { soundCloudAudio && soundCloudAudio.pause(); } } return (0, _deku.dom)( 'button', { 'class': 'sb-soundplayer-play-btn', onClick: handleClick }, !props.playing ? (0, _deku.dom)(_Icons.PlayIconSVG, { onClick: handleClick }) : (0, _deku.dom)(_Icons.PauseIconSVG, { onClick: handleClick }) ); } }; module.exports = exports['default']; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var iconPropTypes = { onClick: { type: 'function', optional: true } }; // SoundCloud Logo var SoundCloudLogoSVG = { propTypes: iconPropTypes, shouldUpdate: function shouldUpdate() { return false; }, render: function render(component) { var props = component.props; return (0, _deku.dom)( 'svg', { 'class': 'sb-soundplayer-cover-logo', xmlns: 'http://www.w3.org/2000/svg', fill: 'currentColor', onClick: props.onClick }, (0, _deku.dom)('path', { d: 'M10.517 3.742c-.323 0-.49.363-.49.582 0 0-.244 3.591-.244 4.641 0 1.602.15 2.621.15 2.621 0 .222.261.401.584.401.321 0 .519-.179.519-.401 0 0 .398-1.038.398-2.639 0-1.837-.153-4.127-.284-4.592-.112-.395-.313-.613-.633-.613zm-1.996.268c-.323 0-.49.363-.49.582 0 0-.244 3.322-.244 4.372 0 1.602.119 2.621.119 2.621 0 .222.26.401.584.401.321 0 .581-.179.581-.401 0 0 .081-1.007.081-2.608 0-1.837-.206-4.386-.206-4.386 0-.218-.104-.581-.425-.581zm-2.021 1.729c-.324 0-.49.362-.49.582 0 0-.272 1.594-.272 2.644 0 1.602.179 2.559.179 2.559 0 .222.229.463.552.463.321 0 .519-.241.519-.463 0 0 .19-.944.19-2.546 0-1.837-.253-2.657-.253-2.657 0-.22-.104-.582-.425-.582zm-2.046-.358c-.323 0-.49.363-.49.582 0 0-.162 1.92-.162 2.97 0 1.602.069 2.496.069 2.496 0 .222.26.557.584.557.321 0 .581-.304.581-.526 0 0 .143-.936.143-2.538 0-1.837-.206-2.96-.206-2.96 0-.218-.198-.581-.519-.581zm-2.169 1.482c-.272 0-.232.218-.232.218v3.982s-.04.335.232.335c.351 0 .716-.832.716-2.348 0-1.245-.436-2.187-.716-2.187zm18.715-.976c-.289 0-.567.042-.832.116-.417-2.266-2.806-3.989-5.263-3.989-1.127 0-2.095.705-2.931 1.316v8.16s0 .484.5.484h8.526c1.655 0 3-1.55 3-3.155 0-1.607-1.346-2.932-3-2.932zm10.17.857c-1.077-.253-1.368-.389-1.368-.815 0-.3.242-.611.97-.611.621 0 1.106.253 1.542.699l.981-.951c-.641-.669-1.417-1.067-2.474-1.067-1.339 0-2.425.757-2.425 1.99 0 1.338.873 1.736 2.124 2.026 1.281.291 1.513.486 1.513.923 0 .514-.379.738-1.184.738-.65 0-1.26-.223-1.736-.777l-.98.873c.514.757 1.504 1.232 2.639 1.232 1.853 0 2.668-.873 2.668-2.163 0-1.477-1.193-1.845-2.27-2.097zm6.803-2.745c-1.853 0-2.949 1.435-2.949 3.502s1.096 3.501 2.949 3.501c1.852 0 2.949-1.434 2.949-3.501s-1.096-3.502-2.949-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.096 0 1.551.94 1.551 2.153.001 1.213-.454 2.153-1.551 2.153zm8.939-1.736c0 1.086-.533 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.897h-1.358v3.916c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.754-1.136 2.754-3.103v-3.897h-1.358v3.916zm8.142-.89l.019 1.485c-.087-.174-.31-.515-.475-.768l-2.703-3.692h-1.362v6.894h1.401v-2.988l-.02-1.484c.088.175.311.514.475.767l2.79 3.705h1.213v-6.894h-1.339v2.975zm5.895-2.923h-2.124v6.791h2.027c1.746 0 3.474-1.01 3.474-3.395 0-2.484-1.437-3.396-3.377-3.396zm-.097 5.472h-.67v-4.152h.719c1.436 0 2.028.688 2.028 2.076 0 1.242-.651 2.076-2.077 2.076zm7.909-4.229c.611 0 1 .271 1.242.737l1.26-.582c-.426-.883-1.202-1.503-2.483-1.503-1.775 0-3.016 1.435-3.016 3.502 0 2.143 1.191 3.501 2.968 3.501 1.232 0 2.047-.572 2.513-1.533l-1.145-.68c-.358.602-.718.864-1.329.864-1.019 0-1.611-.932-1.611-2.153-.001-1.261.583-2.153 1.601-2.153zm5.17-1.192h-1.359v6.791h4.083v-1.338h-2.724v-5.453zm6.396-.157c-1.854 0-2.949 1.435-2.949 3.502s1.095 3.501 2.949 3.501c1.853 0 2.95-1.434 2.95-3.501s-1.097-3.502-2.95-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.095 0 1.55.94 1.55 2.153.001 1.213-.454 2.153-1.55 2.153zm8.557-1.736c0 1.086-.532 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.794h-1.358v3.813c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.755-1.136 2.755-3.103v-3.794h-1.36v3.813zm5.449-3.907h-2.318v6.978h2.211c1.908 0 3.789-1.037 3.789-3.489 0-2.552-1.565-3.489-3.682-3.489zm-.108 5.623h-.729v-4.266h.783c1.565 0 2.21.706 2.21 2.133.001 1.276-.707 2.133-2.264 2.133z' }) ); } }; // Player Button Icons var ButtonIconSVG = { propTypes: iconPropTypes, render: function render(component) { var props = component.props; return (0, _deku.dom)( 'svg', { 'class': 'sb-soundplayer-button-icon', xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 32 32', fill: 'currentColor', onClick: props.onClick }, props.children ); } }; // |> Play var PlayIconSVG = { propTypes: iconPropTypes, shouldUpdate: function shouldUpdate() { return false; }, render: function render(component) { var props = component.props; return (0, _deku.dom)( ButtonIconSVG, props, (0, _deku.dom)('path', { d: 'M0 0 L32 16 L0 32 z' }) ); } }; // || Pause var PauseIconSVG = { propTypes: iconPropTypes, shouldUpdate: function shouldUpdate() { return false; }, render: function render(component) { var props = component.props; return (0, _deku.dom)( ButtonIconSVG, props, (0, _deku.dom)('path', { d: 'M0 0 H12 V32 H0 z M20 0 H32 V32 H20 z' }) ); } }; // |>| Next var NextIconSVG = { propTypes: { onClick: { type: 'function', optional: true } }, shouldUpdate: function shouldUpdate() { return false; }, render: function render(component) { var props = component.props; return (0, _deku.dom)( ButtonIconSVG, props, (0, _deku.dom)('path', { d: 'M4 4 L24 14 V4 H28 V28 H24 V18 L4 28 z ' }) ); } }; // |<| Prev var PrevIconSVG = { propTypes: { onClick: { type: 'function', optional: true } }, shouldUpdate: function shouldUpdate() { return false; }, render: function render(component) { var props = component.props; return (0, _deku.dom)( ButtonIconSVG, props, (0, _deku.dom)('path', { d: 'M4 4 H8 V14 L28 4 V28 L8 18 V28 H4 z ' }) ); } }; exports['default'] = { SoundCloudLogoSVG: SoundCloudLogoSVG, PlayIconSVG: PlayIconSVG, PauseIconSVG: PauseIconSVG, NextIconSVG: NextIconSVG, PrevIconSVG: PrevIconSVG }; module.exports = exports['default']; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var _soundcloudAudio = __webpack_require__(38); var _soundcloudAudio2 = _interopRequireDefault(_soundcloudAudio); exports['default'] = { defaultProps: { value: 0 }, propTypes: { value: { type: 'number' }, soundCloudAudio: function soundCloudAudio(prop) { return prop instanceof _soundcloudAudio2['default']; } }, render: function render(component) { var props = component.props; var value = props.value; var soundCloudAudio = props.soundCloudAudio; if (value < 0) { value = 0; } if (value > 100) { value = 100; } var style = { width: '' + value + '%' }; function handleSeekTrack(e) { var xPos = (e.pageX - e.delegateTarget.getBoundingClientRect().left) / e.delegateTarget.offsetWidth; if (soundCloudAudio && !isNaN(soundCloudAudio.audio.duration)) { soundCloudAudio.audio.currentTime = xPos * soundCloudAudio.audio.duration; } } return (0, _deku.dom)( 'div', { 'class': 'sb-soundplayer-progress-container', onClick: handleSeekTrack }, (0, _deku.dom)('div', { 'class': 'sb-soundplayer-progress-inner', style: style }) ); } }; module.exports = exports['default']; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars function prettyTime(time) { var hours = Math.floor(time / 3600); var mins = '0' + Math.floor(time % 3600 / 60); var secs = '0' + Math.floor(time % 60); mins = mins.substr(mins.length - 2); secs = secs.substr(secs.length - 2); if (!isNaN(secs)) { if (hours) { return '' + hours + ':' + mins + ':' + secs; } else { return '' + mins + ':' + secs; } } else { return '00:00'; } } exports['default'] = { defaultProps: { duration: 0, currentTime: 0 }, propTypes: { duration: { type: 'number' }, currentTime: { type: 'number' } }, render: function render(component) { var props = component.props; return (0, _deku.dom)( 'div', { 'class': 'sb-soundplayer-timer' }, prettyTime(props.currentTime), ' / ', prettyTime(props.duration) ); } }; module.exports = exports['default']; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var _classnames = __webpack_require__(46); var _classnames2 = _interopRequireDefault(_classnames); exports['default'] = { propTypes: { artworkUrl: { type: 'string' } }, render: function render(component) { var props = component.props; var classNames = (0, _classnames2['default'])('sb-soundplayer-cover', props['class']); return (0, _deku.dom)( 'div', { 'class': classNames, style: { 'background-image': 'url(' + props.artworkUrl + ')' } }, props.children ); } }; module.exports = exports['default']; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ (function () { 'use strict'; function classNames () { var classes = ''; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if ('string' === argType || 'number' === argType) { classes += ' ' + arg; } else if (Array.isArray(arg)) { classes += ' ' + classNames.apply(null, arg); } else if ('object' === argType) { for (var key in arg) { if (arg.hasOwnProperty(key) && arg[key]) { classes += ' ' + key; } } } } return classes.substr(1); } if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } else if (true){ // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return classNames; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { window.classNames = classNames; } }()); /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(48); /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _SoundPlayerContainer2 = __webpack_require__(49); var _SoundPlayerContainer3 = _interopRequireDefault(_SoundPlayerContainer2); exports.SoundPlayerContainer = _SoundPlayerContainer3['default']; /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { /** @jsx dom */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _deku = __webpack_require__(7); // eslint-disable-line no-unused-vars var _objectAssign = __webpack_require__(50); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _soundcloudAudio = __webpack_require__(38); var _soundcloudAudio2 = _interopRequireDefault(_soundcloudAudio); var _utilsAudioStore = __webpack_require__(51); exports['default'] = { propTypes: { resolveUrl: { type: 'string' }, clientId: { type: 'string' } }, initialState: function initialState() { return { duration: 0, currentTime: 0, seeking: false, playing: false }; }, beforeMount: function beforeMount(component) { var props = component.props; var state = component.state; var id = component.id; var clientId = props.clientId; if (!clientId) { throw new Error('You need to get clientId from SoundCloud\n https://github.com/soundblogs/react-soundplayer#usage'); } if ('undefined' !== typeof window) { var soundCloudAudio = new _soundcloudAudio2['default'](clientId); (0, _utilsAudioStore.addToRegistry)(id, soundCloudAudio); } }, afterMount: function afterMount(component, el, setState) { var props = component.props; var state = component.state; var id = component.id; var resolveUrl = props.resolveUrl; var streamUrl = props.streamUrl; var soundCloudAudio = (0, _utilsAudioStore.getFromRegistry)(id); if (streamUrl) { soundCloudAudio.preload(streamUrl); } else if (resolveUrl) { soundCloudAudio.resolve(resolveUrl, function (data) { // TBD: support for playlists var track = data.tracks ? data.tracks[0] : data; setState({ track: track }); }); } function onAudioStarted() { setState({ playing: true }); (0, _utilsAudioStore.stopAllOther)(soundCloudAudio.playing); (0, _utilsAudioStore.addToPlayedStore)(soundCloudAudio); } function getCurrentTime() { setState({ currentTime: soundCloudAudio.audio.currentTime }); } function getDuration() { setState({ duration: soundCloudAudio.audio.duration }); } function onSeekingTrack() { setState({ seeking: true }); } function onSeekedTrack() { setState({ seeking: false }); } function onAudioEnded() { setState({ playing: false }); } // https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events soundCloudAudio.on('playing', onAudioStarted); soundCloudAudio.on('timeupdate', getCurrentTime); soundCloudAudio.on('loadedmetadata', getDuration); soundCloudAudio.on('seeking', onSeekingTrack); soundCloudAudio.on('seeked', onSeekedTrack); soundCloudAudio.on('pause', onAudioEnded); soundCloudAudio.on('ended', onAudioEnded); }, afterUpdate: function afterUpdate(component, prevProps, prevState, setState) { var props = component.props; var state = component.state; var id = component.id; var resolveUrl = props.resolveUrl; var streamUrl = props.streamUrl; var soundCloudAudio = (0, _utilsAudioStore.getFromRegistry)(id); var playedBefore = state.playing; function restartIfPlayed() { if (playedBefore) { soundCloudAudio.play(); } } if (streamUrl !== prevProps.streamUrl) { soundCloudAudio.stop(); soundCloudAudio.preload(streamUrl); restartIfPlayed(); } else if (resolveUrl !== prevProps.resolveUrl) { soundCloudAudio.stop(); soundCloudAudio.resolve(resolveUrl, function (data) { // TBD: support for playlists var track = data.tracks ? data.tracks[0] : data; setState({ track: track }); restartIfPlayed(); }); } }, beforeUnmount: function beforeUnmount(component) { var soundCloudAudio = (0, _utilsAudioStore.getFromRegistry)(component.id); soundCloudAudio.unbindAll(); }, render: function render(component) { var props = component.props; var state = component.state; var id = component.id; var soundCloudAudio = (0, _utilsAudioStore.getFromRegistry)(id); function wrapChild(child) { var cloneElement = (0, _objectAssign2['default'])({}, child); if (cloneElement.props) { cloneElement.props = (0, _objectAssign2['default'])({}, cloneElement.props, state, { soundCloudAudio: soundCloudAudio }); } return cloneElement; } return (0, _deku.dom)( 'span', null, props.children.map(wrapChild) ); } }; module.exports = exports['default']; /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function ToObject(val) { if (val == null) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function ownEnumerableKeys(obj) { var keys = Object.getOwnPropertyNames(obj); if (Object.getOwnPropertySymbols) { keys = keys.concat(Object.getOwnPropertySymbols(obj)); } return keys.filter(function (key) { return propIsEnumerable.call(obj, key); }); } module.exports = Object.assign || function (target, source) { var from; var keys; var to = ToObject(target); for (var s = 1; s < arguments.length; s++) { from = arguments[s]; keys = ownEnumerableKeys(Object(from)); for (var i = 0; i < keys.length; i++) { to[keys[i]] = from[keys[i]]; } } return to; }; /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { // handling multiple audio on the page helpers "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stopAllOther = stopAllOther; exports.addToPlayedStore = addToPlayedStore; exports.addToRegistry = addToRegistry; exports.getFromRegistry = getFromRegistry; var _playedAudios = []; var _audioRegistry = {}; function stopAllOther(playing) { _playedAudios.forEach(function (soundCloudAudio) { if (soundCloudAudio.playing && soundCloudAudio.playing !== playing) { soundCloudAudio.stop(); } }); } function addToPlayedStore(soundCloudAudio) { var isPresent = false; for (var i = 0, len = _playedAudios.length; i < len; i++) { var _soundCloudAudio = _playedAudios[i]; if (_soundCloudAudio.playing === soundCloudAudio.playing) { isPresent = true; break; } } if (!isPresent) { _playedAudios.push(soundCloudAudio); } } function addToRegistry(componentId, soundCloudAudio) { _audioRegistry[componentId] = soundCloudAudio; } function getFromRegistry(componentId) { return _audioRegistry[componentId]; } /***/ } /******/ ]);
docs/pages/CustomComponents/AlternativeMedia/Icon.js
jossmac/react-images
// @flow // @jsx glam import glam from 'glam' import React from 'react' type IconProps = { size: number, type: 'play' | 'pause' } const Icon = ({ size = 64, type }: IconProps) => { const get = { play: ( <path d="M12 20.016c4.406 0 8.016-3.609 8.016-8.016s-3.609-8.016-8.016-8.016-8.016 3.609-8.016 8.016 3.609 8.016 8.016 8.016zM12 2.016c5.531 0 9.984 4.453 9.984 9.984s-4.453 9.984-9.984 9.984-9.984-4.453-9.984-9.984 4.453-9.984 9.984-9.984zM9.984 16.5v-9l6 4.5z" /> ), pause: ( <path d="M12.984 15.984v-7.969h2.016v7.969h-2.016zM12 20.016c4.406 0 8.016-3.609 8.016-8.016s-3.609-8.016-8.016-8.016-8.016 3.609-8.016 8.016 3.609 8.016 8.016 8.016zM12 2.016c5.531 0 9.984 4.453 9.984 9.984s-4.453 9.984-9.984 9.984-9.984-4.453-9.984-9.984 4.453-9.984 9.984-9.984zM9 15.984v-7.969h2.016v7.969h-2.016z" /> ), } return ( <svg role="presentation" viewBox="0 0 24 24" css={{ display: 'inline-block', fill: 'currentColor', height: size, stroke: 'currentColor', strokeWidth: 0, width: size, }} > {get[type]} </svg> ) } export default Icon
src/components/ActionBar/index.js
mother/oio
import PropTypes from 'prop-types' import React from 'react' import classNames from 'classnames' import styles from './styles.less' const ActionBar = ({ children, flush }) => { const actionBarStyles = [styles.actionBar] if (flush) { actionBarStyles.push(styles.flush) } return ( <div className={classNames(actionBarStyles)}>{children}</div> ) } ActionBar.propTypes = { children: PropTypes.node, flush: PropTypes.bool } export default ActionBar
packages/material-ui-icons/src/ArrowDropDownCircleSharp.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 13l-4-4h8l-4 4z" /></React.Fragment> , 'ArrowDropDownCircleSharp');
src/svg-icons/navigation/arrow-drop-down-circle.js
barakmitz/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NavigationArrowDropDownCircle = (props) => ( <SvgIcon {...props}> <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12l-4-4h8l-4 4z"/> </SvgIcon> ); NavigationArrowDropDownCircle = pure(NavigationArrowDropDownCircle); NavigationArrowDropDownCircle.displayName = 'NavigationArrowDropDownCircle'; NavigationArrowDropDownCircle.muiName = 'SvgIcon'; export default NavigationArrowDropDownCircle;
js/bootstrap-3.0.0/js/tests/vendor/jquery.js
say2joe/fedkit
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license //@ sourceMappingURL=jquery-1.10.2.min.map */ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
src/components/index.js
romarioraffington/react-mybooks
// External Dependencies import React, { Component } from 'react'; import { Route } from 'react-router-dom'; // Our Dependencies import { track } from '../util/analytics'; import * as BooksAPI from '../BooksAPI'; // Components import ShelfContainer from './ShelfContainer'; import BookDetail from './BookDetail'; import Search from './Search'; export default class App extends Component { state = { books: [], isFetching: true, isUpdatingShelf: false, } componentDidMount() { BooksAPI.getAll().then(books => { this.setState({ books, isFetching: false }); }); track(window); } shelfChange = (book, shelf) => { // istanbul ignore next this.setState({ isUpdatingShelf: true }); // istanbul ignore next BooksAPI.update(book, shelf).then(data => { this.setState(({ books }) => { // Check if book was added from // the search screen const isPresent = books.find(b => ( b.id === book.id )); // If book was previously selected // find book and only change the shelf if (!! isPresent) { return { isUpdatingShelf: false, books: books.filter(b => b.id === book.id ? b.shelf = shelf : b ) } } // If books was not previously selected, // update shelf and add it to the list return { isUpdatingShelf: false, books: books.concat( Object.assign({}, book, { shelf: shelf }) ) } }); }); } render() { const { books, isFetching, isUpdatingShelf } = this.state; // istanbul ignore next return ( <div className="app"> <Route exact path='/' render={({ history }) => ( <div className="list-books"> <div className="list-books-title"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/romarioraffington/react-mybooks"> <div className="fork-me-ribbon"></div> </a> <h1>My<span>Reads</span></h1> </div> <ShelfContainer books={books} isFetching={isFetching} isUpdatingShelf={isUpdatingShelf} onShelfChange={this.shelfChange} onBookClick={(book) => ( history.push(`book/${book.id}`) )} /> <div className="open-search"> <a onClick={() => { localStorage.lastQuery = ''; history.push('/search')} }> Add a book </a> </div> </div> )} /> <Route path='/search' render={({ history }) => ( <Search books={books} onShelfChange={this.shelfChange} isFetching={isFetching} onBackClick={() => history.push('/') } onBookClick={(book) => ( history.push(`book/${book.id}`) )} /> )} /> <Route path='/book/:id' render={({ history, match }) => ( <BookDetail bookId={match.params.id} history={history} isUpdatingShelf={isUpdatingShelf} onShelfChange={this.shelfChange} /> )} /> </div> ) } }
src/svg-icons/device/wifi-tethering.js
owencm/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceWifiTethering = (props) => ( <SvgIcon {...props}> <path d="M12 11c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 2c0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.48-.81 2.75-2 3.45l1 1.74c1.79-1.04 3-2.97 3-5.19zM12 3C6.48 3 2 7.48 2 13c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 18.53 4 15.96 4 13c0-4.42 3.58-8 8-8s8 3.58 8 8c0 2.96-1.61 5.53-4 6.92l1 1.73c2.99-1.73 5-4.95 5-8.65 0-5.52-4.48-10-10-10z"/> </SvgIcon> ); DeviceWifiTethering = pure(DeviceWifiTethering); DeviceWifiTethering.displayName = 'DeviceWifiTethering'; DeviceWifiTethering.muiName = 'SvgIcon'; export default DeviceWifiTethering;
client/src/app/primitives/__tests__/TabLinksSpec.js
camunda/bpmn-io-modeler
/** * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. * * Camunda licenses this file to you under the MIT; you may not use this file * except in compliance with the MIT License. */ /* global sinon */ import React from 'react'; import { mount } from 'enzyme'; import TabLinks from '../TabLinks'; import { defaultActiveTab, defaultTabs } from './mocks'; const [ tab1, tab2, tab3, tab4 ] = defaultTabs; const { spy } = sinon; describe('<TabLinks>', function() { describe('dirty state', function() { it('should be dirty if dirty OR unsaved', function() { // given const { tabLinks } = renderTabLinks({ dirtyTabs: { tab1: false, tab2: false, tab3: true, tab4: true }, unsavedTabs: { tab1: false, tab2: true, tab3: false, tab4: true } }); // when const tab1Dirty = tabLinks.isDirty(tab1), tab2Dirty = tabLinks.isDirty(tab2), tab3Dirty = tabLinks.isDirty(tab3), tab4Dirty = tabLinks.isDirty(tab4); // then expect(tab1Dirty).to.be.false; expect(tab2Dirty).to.be.true; expect(tab3Dirty).to.be.true; expect(tab4Dirty).to.be.true; }); }); describe('title', function() { it('should display tab title', function() { const { tree } = renderTabLinks(); // when const node = tree.find('.tab[data-tab-id="tab1"]').getDOMNode(); // then expect(node.title).to.eql(tab1.title); }); }); describe('placeholder', function() { it('should display empty tab handle', function() { const clickSpy = spy(); const placeholder = { onClick: clickSpy, title: 'CREATE STUFF', label: '+' }; const { tree } = renderTabLinks({ placeholder }); // when const tab = tree.find('.tab.placeholder'); // then expect(tab.exists()).to.be.true; // and when tab.simulate('click'); // then expect(clickSpy).to.have.been.calledOnce; }); it('should hide empty tab handle', function() { const { tree } = renderTabLinks(); // when const tab = tree.find('.tab.placeholder'); // then expect(tab.exists()).to.be.false; }); }); describe('scrolling', function() { it('should handle scroll', function() { // given const selectSpy = spy(); const { tree, tabLinks } = renderTabLinks({ onSelect: selectSpy }); const node = tree.find('.tab[data-tab-id="tab2"]').getDOMNode(); // when tabLinks.handleScroll(node); // then expect(selectSpy).to.have.been.calledWith(defaultTabs[1]); }); }); describe('dragging', function() { it('should handle dragstart', function() { // given const onSelectSpy = spy(); const { tree, tabLinks } = renderTabLinks({ onSelect: onSelectSpy }); const node = tree.find('.tab[data-tab-id="tab2"]').getDOMNode(); // when tabLinks.handleDragStart({ dragTab: node }); // then expect(onSelectSpy).to.have.been.calledWith(defaultTabs[1]); }); it('should handle drag', function() { // given const moveTabSpy = spy(); const { tree, tabLinks } = renderTabLinks({ onMoveTab: moveTabSpy }); const node = tree.find('.tab[data-tab-id="tab2"]').getDOMNode(); // when tabLinks.handleDrag({ dragTab: node, newIndex: 0 }); // then expect(moveTabSpy).to.have.been.calledWith(defaultTabs[1], 0); }); }); }); function noop() {} function renderTabLinks(options = {}) { const { activeTab, tabs, onMoveTab, onSelect, dirtyTabs, unsavedTabs, placeholder } = options; const tree = mount( <TabLinks activeTab={ activeTab || defaultActiveTab } tabs={ tabs || defaultTabs } onMoveTab={ onMoveTab || noop } onSelect={ onSelect || noop } dirtyTabs={ dirtyTabs || {} } unsavedTabs={ unsavedTabs || {} } placeholder={ placeholder } /> ); const tabLinks = tree.instance(); return { tree, tabLinks }; }
packages/material-ui-icons/src/PanoramaFishEyeSharp.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g></React.Fragment> , 'PanoramaFishEyeSharp');
app/ui/src/components/NavbarCharacterInfo.js
pequalsnp/eve-isk-tracker
import React from 'react'; import { connect } from 'react-redux'; import { gql, graphql, } from 'react-apollo'; import { withRouter } from 'react-router'; import { NavDropdown, Nav, MenuItem, NavItem } from 'react-bootstrap'; import Logout from './Logout'; const profileQuery = gql` query ProfileQuery { profile { mainCharacter { id name portraitURLs } additionalCharacters { id name portraitURLs } } } `; const NavbarCharacterInfoLoggedIn = ({data: {loading, error, profile}}) => { if (loading) { return <p>Loading ...</p>; } if (error) { return <Logout />; } return ( <Nav pullRight> <NavDropdown title={profile.mainCharacter.name} id="character-nav"> <MenuItem href="/logout">Logout</MenuItem> </NavDropdown> </Nav> ); } const NavbarCharacterInfoLoggedInWithData = graphql(profileQuery)(NavbarCharacterInfoLoggedIn) const NavbarCharacterInfoLoggedOut = () => { return ( <Nav pullRight> <NavItem href="/login">Login</NavItem> </Nav> ); } const mapStateToProps = state => { return { isLoggedIn: state.app.loggedIn } } const NavbarCharacterInfo = ({isLoggedIn}) => { console.log("isLoggedIn " + JSON.stringify(isLoggedIn)); return isLoggedIn ? <NavbarCharacterInfoLoggedInWithData /> : <NavbarCharacterInfoLoggedOut /> } export default withRouter(connect(mapStateToProps, null)(NavbarCharacterInfo));
ajax/libs/iCheck/1.0.1/demo/js/jquery.js
jakubfiala/cdnjs
/*! * jQuery v1.8.3 jquery.com | jquery.org/license */ (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
RNTester/js/AnimatedGratuitousApp/AnExApp.js
cpunion/react-native
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule AnExApp * @flow */ 'use strict'; var React = require('react'); var ReactNative = require('react-native'); var { Animated, LayoutAnimation, PanResponder, StyleSheet, View, } = ReactNative; var AnExSet = require('AnExSet'); var CIRCLE_SIZE = 80; var CIRCLE_MARGIN = 18; var NUM_CIRCLES = 30; class Circle extends React.Component { state: any; props: any; longTimer: number; _onLongPress: () => void; _toggleIsActive: () => void; constructor(props: Object): void { super(); this._onLongPress = this._onLongPress.bind(this); this._toggleIsActive = this._toggleIsActive.bind(this); this.state = { isActive: false, pan: new Animated.ValueXY(), // Vectors reduce boilerplate. (step1: uncomment) pop: new Animated.Value(0), // Initial value. (step2a: uncomment) }; } _onLongPress(): void { var config = {tension: 40, friction: 3}; this.state.pan.addListener((value) => { // Async listener for state changes (step1: uncomment) this.props.onMove && this.props.onMove(value); }); Animated.spring(this.state.pop, { toValue: 1, // Pop to larger size. (step2b: uncomment) ...config, // Reuse config for convenient consistency (step2b: uncomment) }).start(); this.setState({panResponder: PanResponder.create({ onPanResponderMove: Animated.event([ null, // native event - ignore (step1: uncomment) {dx: this.state.pan.x, dy: this.state.pan.y}, // links pan to gestureState (step1: uncomment) ]), onPanResponderRelease: (e, gestureState) => { LayoutAnimation.easeInEaseOut(); // @flowfixme animates layout update as one batch (step3: uncomment) Animated.spring(this.state.pop, { toValue: 0, // Pop back to 0 (step2c: uncomment) ...config, }).start(); this.setState({panResponder: undefined}); this.props.onMove && this.props.onMove({ x: gestureState.dx + this.props.restLayout.x, y: gestureState.dy + this.props.restLayout.y, }); this.props.onDeactivate(); this.state.pan.removeAllListeners(); }, })}, () => { this.props.onActivate(); }); } render(): React.Element<any> { if (this.state.panResponder) { var handlers = this.state.panResponder.panHandlers; var dragStyle = { // Used to position while dragging position: 'absolute', // Hoist out of layout (step1: uncomment) ...this.state.pan.getLayout(), // Convenience converter (step1: uncomment) }; } else { handlers = { onStartShouldSetResponder: () => !this.state.isActive, onResponderGrant: () => { this.state.pan.setValue({x: 0, y: 0}); // reset (step1: uncomment) this.state.pan.setOffset(this.props.restLayout); // offset from onLayout (step1: uncomment) this.longTimer = setTimeout(this._onLongPress, 300); }, onResponderRelease: () => { if (!this.state.panResponder) { clearTimeout(this.longTimer); this._toggleIsActive(); } } }; } var animatedStyle: Object = { shadowOpacity: this.state.pop, // no need for interpolation (step2d: uncomment) transform: [ {scale: this.state.pop.interpolate({ inputRange: [0, 1], outputRange: [1, 1.3] // scale up from 1 to 1.3 (step2d: uncomment) })}, ], }; var openVal = this.props.openVal; if (this.props.dummy) { animatedStyle.opacity = 0; } else if (this.state.isActive) { var innerOpenStyle = [styles.open, { // (step4: uncomment) left: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.x, 0]}), top: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.y, 0]}), width: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.width]}), height: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.height]}), margin: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_MARGIN, 0]}), borderRadius: openVal.interpolate({inputRange: [-0.15, 0, 0.5, 1], outputRange: [0, CIRCLE_SIZE / 2, CIRCLE_SIZE * 1.3, 0]}), }]; } return ( <Animated.View onLayout={this.props.onLayout} style={[styles.dragView, dragStyle, animatedStyle, this.state.isActive ? styles.open : null]} {...handlers}> <Animated.View style={[styles.circle, innerOpenStyle]}> <AnExSet containerLayout={this.props.containerLayout} id={this.props.id} isActive={this.state.isActive} openVal={this.props.openVal} onDismiss={this._toggleIsActive} /> </Animated.View> </Animated.View> ); } _toggleIsActive(velocity) { var config = {tension: 30, friction: 7}; if (this.state.isActive) { Animated.spring(this.props.openVal, {toValue: 0, ...config}).start(() => { // (step4: uncomment) this.setState({isActive: false}, this.props.onDeactivate); }); // (step4: uncomment) } else { this.props.onActivate(); this.setState({isActive: true, panResponder: undefined}, () => { // this.props.openVal.setValue(1); // (step4: comment) Animated.spring(this.props.openVal, {toValue: 1, ...config}).start(); // (step4: uncomment) }); } } } class AnExApp extends React.Component { state: any; props: any; static title = 'Animated - Gratuitous App'; static description = 'Bunch of Animations - tap a circle to ' + 'open a view with more animations, or longPress and drag to reorder circles.'; _onMove: (position: Point) => void; constructor(props: any): void { super(props); var keys = []; for (var idx = 0; idx < NUM_CIRCLES; idx++) { keys.push('E' + idx); } this.state = { keys, restLayouts: [], openVal: new Animated.Value(0), }; this._onMove = this._onMove.bind(this); } render(): React.Element<any> { var circles = this.state.keys.map((key, idx) => { if (key === this.state.activeKey) { return <Circle key={key + 'd'} dummy={true} />; } else { if (!this.state.restLayouts[idx]) { var onLayout = function(index, e) { var layout = e.nativeEvent.layout; this.setState((state) => { state.restLayouts[index] = layout; return state; }); }.bind(this, idx); } return ( <Circle key={key} id={key} openVal={this.state.openVal} onLayout={onLayout} restLayout={this.state.restLayouts[idx]} onActivate={this.setState.bind(this, { activeKey: key, activeInitialLayout: this.state.restLayouts[idx], })} /> ); } }); if (this.state.activeKey) { circles.push( <Animated.View key="dark" style={[styles.darkening, {opacity: this.state.openVal}]} /> ); circles.push( <Circle openVal={this.state.openVal} key={this.state.activeKey} id={this.state.activeKey} restLayout={this.state.activeInitialLayout} containerLayout={this.state.layout} onMove={this._onMove} onDeactivate={() => { this.setState({activeKey: undefined}); }} /> ); } return ( <View style={styles.container}> <View style={styles.grid} onLayout={(e) => this.setState({layout: e.nativeEvent.layout})}> {circles} </View> </View> ); } _onMove(position: Point): void { var newKeys = moveToClosest(this.state, position); if (newKeys !== this.state.keys) { LayoutAnimation.easeInEaseOut(); // animates layout update as one batch (step3: uncomment) this.setState({keys: newKeys}); } } } type Point = {x: number, y: number}; function distance(p1: Point, p2: Point): number { var dx = p1.x - p2.x; var dy = p1.y - p2.y; return dx * dx + dy * dy; } function moveToClosest({activeKey, keys, restLayouts}, position) { var activeIdx = -1; var closestIdx = activeIdx; var minDist = Infinity; var newKeys = []; keys.forEach((key, idx) => { var dist = distance(position, restLayouts[idx]); if (key === activeKey) { idx = activeIdx; } else { newKeys.push(key); } if (dist < minDist) { minDist = dist; closestIdx = idx; } }); if (closestIdx === activeIdx) { return keys; // nothing changed } else { newKeys.splice(closestIdx, 0, activeKey); return newKeys; } } var styles = StyleSheet.create({ container: { flex: 1, }, grid: { flex: 1, justifyContent: 'center', flexDirection: 'row', flexWrap: 'wrap', backgroundColor: 'transparent', }, circle: { width: CIRCLE_SIZE, height: CIRCLE_SIZE, borderRadius: CIRCLE_SIZE / 2, borderWidth: 1, borderColor: 'black', margin: CIRCLE_MARGIN, overflow: 'hidden', }, dragView: { shadowRadius: 10, shadowColor: 'rgba(0,0,0,0.7)', shadowOffset: {height: 8}, alignSelf: 'flex-start', backgroundColor: 'transparent', }, open: { position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, width: undefined, // unset value from styles.circle height: undefined, // unset value from styles.circle borderRadius: 0, // unset value from styles.circle }, darkening: { backgroundColor: 'black', position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, }, }); module.exports = AnExApp;
ajax/libs/material-ui/4.11.3-deprecations.0/AppBar/AppBar.js
cdnjs/cdnjs
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.styles = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _clsx = _interopRequireDefault(require("clsx")); var _withStyles = _interopRequireDefault(require("../styles/withStyles")); var _capitalize = _interopRequireDefault(require("../utils/capitalize")); var _Paper = _interopRequireDefault(require("../Paper")); var styles = function styles(theme) { var backgroundColorDefault = theme.palette.type === 'light' ? theme.palette.grey[100] : theme.palette.grey[900]; return { /* Styles applied to the root element. */ root: { display: 'flex', flexDirection: 'column', width: '100%', boxSizing: 'border-box', // Prevent padding issue with the Modal and fixed positioned AppBar. zIndex: theme.zIndex.appBar, flexShrink: 0 }, /* Styles applied to the root element if `position="fixed"`. */ positionFixed: { position: 'fixed', top: 0, left: 'auto', right: 0, '@media print': { // Prevent the app bar to be visible on each printed page. position: 'absolute' } }, /* Styles applied to the root element if `position="absolute"`. */ positionAbsolute: { position: 'absolute', top: 0, left: 'auto', right: 0 }, /* Styles applied to the root element if `position="sticky"`. */ positionSticky: { // ⚠️ sticky is not supported by IE 11. position: 'sticky', top: 0, left: 'auto', right: 0 }, /* Styles applied to the root element if `position="static"`. */ positionStatic: { position: 'static' }, /* Styles applied to the root element if `position="relative"`. */ positionRelative: { position: 'relative' }, /* Styles applied to the root element if `color="default"`. */ colorDefault: { backgroundColor: backgroundColorDefault, color: theme.palette.getContrastText(backgroundColorDefault) }, /* Styles applied to the root element if `color="primary"`. */ colorPrimary: { backgroundColor: theme.palette.primary.main, color: theme.palette.primary.contrastText }, /* Styles applied to the root element if `color="secondary"`. */ colorSecondary: { backgroundColor: theme.palette.secondary.main, color: theme.palette.secondary.contrastText }, /* Styles applied to the root element if `color="inherit"`. */ colorInherit: { color: 'inherit' }, /* Styles applied to the root element if `color="transparent"`. */ colorTransparent: { backgroundColor: 'transparent', color: 'inherit' } }; }; exports.styles = styles; var AppBar = /*#__PURE__*/React.forwardRef(function AppBar(props, ref) { var classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'primary' : _props$color, _props$position = props.position, position = _props$position === void 0 ? 'fixed' : _props$position, other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "color", "position"]); return /*#__PURE__*/React.createElement(_Paper.default, (0, _extends2.default)({ square: true, component: "header", elevation: 4, className: (0, _clsx.default)(classes.root, classes["position".concat((0, _capitalize.default)(position))], classes["color".concat((0, _capitalize.default)(color))], className, position === 'fixed' && 'mui-fixed'), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? AppBar.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * The content of the component. */ children: _propTypes.default.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: _propTypes.default.object, /** * @ignore */ className: _propTypes.default.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: _propTypes.default.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent']), /** * The positioning type. The behavior of the different options is described * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning). * Note: `sticky` is not universally supported and will fall back to `static` when unavailable. */ position: _propTypes.default.oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']) } : void 0; var _default = (0, _withStyles.default)(styles, { name: 'MuiAppBar' })(AppBar); exports.default = _default;
app/javascript/mastodon/features/report/category.js
cobodo/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import Button from 'mastodon/components/button'; import Option from './components/option'; const messages = defineMessages({ dislike: { id: 'report.reasons.dislike', defaultMessage: 'I don\'t like it' }, dislike_description: { id: 'report.reasons.dislike_description', defaultMessage: 'It is not something you want to see' }, spam: { id: 'report.reasons.spam', defaultMessage: 'It\'s spam' }, spam_description: { id: 'report.reasons.spam_description', defaultMessage: 'Malicious links, fake engagement, or repetitive replies' }, violation: { id: 'report.reasons.violation', defaultMessage: 'It violates server rules' }, violation_description: { id: 'report.reasons.violation_description', defaultMessage: 'You are aware that it breaks specific rules' }, other: { id: 'report.reasons.other', defaultMessage: 'It\'s something else' }, other_description: { id: 'report.reasons.other_description', defaultMessage: 'The issue does not fit into other categories' }, status: { id: 'report.category.title_status', defaultMessage: 'post' }, account: { id: 'report.category.title_account', defaultMessage: 'profile' }, }); const mapStateToProps = state => ({ rules: state.get('rules'), }); export default @connect(mapStateToProps) @injectIntl class Category extends React.PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, rules: ImmutablePropTypes.list, category: PropTypes.string, onChangeCategory: PropTypes.func.isRequired, startedFrom: PropTypes.oneOf(['status', 'account']), intl: PropTypes.object.isRequired, }; handleNextClick = () => { const { onNextStep, category } = this.props; switch(category) { case 'dislike': onNextStep('thanks'); break; case 'violation': onNextStep('rules'); break; default: onNextStep('statuses'); break; } }; handleCategoryToggle = (value, checked) => { const { onChangeCategory } = this.props; if (checked) { onChangeCategory(value); } }; render () { const { category, startedFrom, rules, intl } = this.props; const options = rules.size > 0 ? [ 'dislike', 'spam', 'violation', 'other', ] : [ 'dislike', 'spam', 'other', ]; return ( <React.Fragment> <h3 className='report-dialog-modal__title'><FormattedMessage id='report.category.title' defaultMessage="Tell us what's going on with this {type}" values={{ type: intl.formatMessage(messages[startedFrom]) }} /></h3> <p className='report-dialog-modal__lead'><FormattedMessage id='report.category.subtitle' defaultMessage='Choose the best match' /></p> <div> {options.map(item => ( <Option key={item} name='category' value={item} checked={category === item} onToggle={this.handleCategoryToggle} label={intl.formatMessage(messages[item])} description={intl.formatMessage(messages[`${item}_description`])} /> ))} </div> <div className='flex-spacer' /> <div className='report-dialog-modal__actions'> <Button onClick={this.handleNextClick} disabled={category === null}><FormattedMessage id='report.next' defaultMessage='Next' /></Button> </div> </React.Fragment> ); } }
src/svg-icons/device/battery-full.js
pomerantsev/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceBatteryFull = (props) => ( <SvgIcon {...props}> <path d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z"/> </SvgIcon> ); DeviceBatteryFull = pure(DeviceBatteryFull); DeviceBatteryFull.displayName = 'DeviceBatteryFull'; DeviceBatteryFull.muiName = 'SvgIcon'; export default DeviceBatteryFull;
docs/src/pages/system/display/Print.js
lgollut/material-ui
import React from 'react'; import Box from '@material-ui/core/Box'; export default function Print() { return ( <div style={{ width: '100%' }}> <Box display="block" displayPrint="none" m={1}> Screen Only (Hide on print only) </Box> <Box display="none" displayPrint="block" m={1}> Print Only (Hide on screen only) </Box> </div> ); }
packages/containers/src/SubHeaderBar/SubHeaderBar.stories.js
Talend/ui
import React from 'react'; import SubHeaderBar from '.'; const viewSubHeader = { title: 'MyTitle', actionCreatorCancel: 'subheaderbar:cancel', actionCreatorSubmit: 'subheaderbar:submit', actionCreatorChange: 'subheaderbar:change', actionCreatorGoBack: 'subheaderbar:goback', }; const injectedComponentsCenter = { center: [ { component: 'FilterBar', center: true, navbar: true, docked: false, dockable: false, }, ], }; const injectedComponentsRight = { right: [ { actionId: 'subheaderbar:sharing', component: 'Action', right: true, }, { actionId: 'subheaderbar:bubbles', component: 'Action', right: true, }, ], }; const props = { ...viewSubHeader, }; export default { title: 'SubHeaderBar', }; export const Default = () => <SubHeaderBar {...props} />; export const Subtitle = () => <SubHeaderBar subTitle="mySubTitle" {...props} />; export const Icon = () => <SubHeaderBar iconId="talend-file-csv-o" {...props} />; export const Editable = () => <SubHeaderBar {...props} editable />; export const InProgress = () => <SubHeaderBar {...props} editable inProgress />; export const Loading = () => <SubHeaderBar {...props} loading />; export const RightActions = () => <SubHeaderBar {...props} components={injectedComponentsRight} />; export const CenterActions = () => ( <SubHeaderBar {...props} components={injectedComponentsCenter} /> ); export const all = () => ( <SubHeaderBar {...props} components={{ ...injectedComponentsCenter, ...injectedComponentsRight }} iconId="talend-file-csv-o" subTitle="mySubTitle" editable /> );
ajax/libs/react-dom/16.8.6/cjs/react-dom-unstable-fire.profiling.min.js
joeyparrish/cdnjs
/** @license React v16.8.6 * react-dom-unstable-fire.profiling.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* Modernizr 3.0.0pre (Custom Build) | MIT */ 'use strict';var aa=require("react"),n=require("object-assign"),r=require("scheduler"),v=require("scheduler/tracing");function ba(a,b,c,d,e,f,g,h){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} function x(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;d<b;d++)c+="&args[]="+encodeURIComponent(arguments[d+1]);ba(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",c)}aa?void 0:x("227");function ca(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}} var da=!1,ea=null,fa=!1,ha=null,ia={onError:function(a){da=!0;ea=a}};function ja(a,b,c,d,e,f,g,h,k){da=!1;ea=null;ca.apply(ia,arguments)}function ka(a,b,c,d,e,f,g,h,k){ja.apply(this,arguments);if(da){if(da){var l=ea;da=!1;ea=null}else x("198"),l=void 0;fa||(fa=!0,ha=l)}}var la=null,ma={}; function na(){if(la)for(var a in ma){var b=ma[a],c=la.indexOf(a);-1<c?void 0:x("96",a);if(!oa[c]){b.extractEvents?void 0:x("97",a);oa[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;pa.hasOwnProperty(h)?x("99",h):void 0;pa[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&qa(k[e],g,h);e=!0}else f.registrationName?(qa(f.registrationName,g,h),e=!0):e=!1;e?void 0:x("98",d,a)}}}} function qa(a,b,c){ra[a]?x("100",a):void 0;ra[a]=b;sa[a]=b.eventTypes[c].dependencies}var oa=[],pa={},ra={},sa={},ta=null,ua=null,va=null;function wa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=va(c);ka(d,b,void 0,a);a.currentTarget=null}function xa(a,b){null==b?x("30"):void 0;if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]} function ya(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var za=null;function Aa(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)wa(a,b[d],c[d]);else b&&wa(a,b,c);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}} var Ba={injectEventPluginOrder:function(a){la?x("101"):void 0;la=Array.prototype.slice.call(a);na()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];ma.hasOwnProperty(c)&&ma[c]===d||(ma[c]?x("102",c):void 0,ma[c]=d,b=!0)}b&&na()}}; function Ca(a,b){var c=a.stateNode;if(!c)return null;var d=ta(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;c&&"function"!==typeof c?x("231",b,typeof c):void 0; return c}function Da(a){null!==a&&(za=xa(za,a));a=za;za=null;if(a&&(ya(a,Aa),za?x("95"):void 0,fa))throw a=ha,fa=!1,ha=null,a;}var Ea=Math.random().toString(36).slice(2),Fa="__reactInternalInstance$"+Ea,Ga="__reactEventHandlers$"+Ea;function Ha(a){if(a[Fa])return a[Fa];for(;!a[Fa];)if(a.parentNode)a=a.parentNode;else return null;a=a[Fa];return 5===a.tag||6===a.tag?a:null}function Ia(a){a=a[Fa];return!a||5!==a.tag&&6!==a.tag?null:a} function Ja(a){if(5===a.tag||6===a.tag)return a.stateNode;x("33")}function Ka(a){return a[Ga]||null}function Ma(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function Na(a,b,c){if(b=Ca(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a)} function Oa(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Ma(b);for(b=c.length;0<b--;)Na(c[b],"captured",a);for(b=0;b<c.length;b++)Na(c[b],"bubbled",a)}}function Pa(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Ca(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a))}function Qa(a){a&&a.dispatchConfig.registrationName&&Pa(a._targetInst,null,a)} function Ra(a){ya(a,Oa)}var Sa=!("undefined"===typeof window||!window.document||!window.document.createElement);function Ta(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var Ua={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionend:Ta("Transition","TransitionEnd")},Va={},Wa={}; Sa&&(Wa=document.createElement("div").style,"AnimationEvent"in window||(delete Ua.animationend.animation,delete Ua.animationiteration.animation,delete Ua.animationstart.animation),"TransitionEvent"in window||delete Ua.transitionend.transition);function Xa(a){if(Va[a])return Va[a];if(!Ua[a])return a;var b=Ua[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Wa)return Va[a]=b[c];return a} var Ya=Xa("animationend"),Za=Xa("animationiteration"),$a=Xa("animationstart"),ab=Xa("transitionend"),bb="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cb=null,db=null,eb=null; function fb(){if(eb)return eb;var a,b=db,c=b.length,d,e="value"in cb?cb.value:cb.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return eb=e.slice(a,1<d?1-d:void 0)}function hb(){return!0}function ib(){return!1} function y(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?hb:ib;this.isPropagationStopped=ib;return this} n(y.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=hb)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=hb)},persist:function(){this.isPersistent=hb},isPersistent:ib,destructor:function(){var a=this.constructor.Interface, b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=ib;this._dispatchInstances=this._dispatchListeners=null}});y.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null}; y.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;n(e,c.prototype);c.prototype=e;c.prototype.constructor=c;c.Interface=n({},d.Interface,a);c.extend=d.extend;jb(c);return c};jb(y);function kb(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}function lb(a){a instanceof this?void 0:x("279");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)} function jb(a){a.eventPool=[];a.getPooled=kb;a.release=lb}var mb=y.extend({data:null}),nb=y.extend({data:null}),ob=[9,13,27,32],pb=Sa&&"CompositionEvent"in window,qb=null;Sa&&"documentMode"in document&&(qb=document.documentMode); var rb=Sa&&"TextEvent"in window&&!qb,sb=Sa&&(!pb||qb&&8<qb&&11>=qb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1; function wb(a,b){switch(a){case "keyup":return-1!==ob.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function xb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var yb=!1;function zb(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}} function Ab(a,b){if(yb)return"compositionend"===a||!pb&&wb(a,b)?(a=fb(),eb=db=cb=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return sb&&"ko"!==b.locale?null:b.data;default:return null}} var Bb={eventTypes:ub,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(pb)b:{switch(a){case "compositionstart":e=ub.compositionStart;break b;case "compositionend":e=ub.compositionEnd;break b;case "compositionupdate":e=ub.compositionUpdate;break b}e=void 0}else yb?wb(a,c)&&(e=ub.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=ub.compositionStart);e?(sb&&"ko"!==c.locale&&(yb||e!==ub.compositionStart?e===ub.compositionEnd&&yb&&(f=fb()):(cb=d,db="value"in cb?cb.value:cb.textContent,yb= !0)),e=mb.getPooled(e,b,c,d),f?e.data=f:(f=xb(c),null!==f&&(e.data=f)),Ra(e),f=e):f=null;(a=rb?zb(a,c):Ab(a,c))?(b=nb.getPooled(ub.beforeInput,b,c,d),b.data=a,Ra(b)):b=null;return null===f?b:null===b?f:[f,b]}},Cb=null,Db=null,Eb=null;function Fb(a){if(a=ua(a)){"function"!==typeof Cb?x("280"):void 0;var b=ta(a.stateNode);Cb(a.stateNode,a.type,b)}}function Gb(a){Db?Eb?Eb.push(a):Eb=[a]:Db=a}function Hb(){if(Db){var a=Db,b=Eb;Eb=Db=null;Fb(a);if(b)for(a=0;a<b.length;a++)Fb(b[a])}} function Ib(a,b){return a(b)}function Jb(a,b,c){return a(b,c)}function Kb(){}var Lb=!1;function Mb(a,b){if(Lb)return a(b);Lb=!0;try{return Ib(a,b)}finally{if(Lb=!1,null!==Db||null!==Eb)Kb(),Hb()}}var Ob={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pb(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Ob[a.type]:"textarea"===b?!0:!1} function Qb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function Rb(a){if(!Sa)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function Sb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)} function Tb(a){var b=Sb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= null;delete a[b]}}}}function Ub(a){a._valueTracker||(a._valueTracker=Tb(a))}function Vb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Sb(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}var Wb=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wb.hasOwnProperty("ReactCurrentDispatcher")||(Wb.ReactCurrentDispatcher={current:null}); var Xb=/^(.*)[\\\/]/,A="function"===typeof Symbol&&Symbol.for,Yb=A?Symbol.for("react.element"):60103,Zb=A?Symbol.for("react.portal"):60106,$b=A?Symbol.for("react.fragment"):60107,ac=A?Symbol.for("react.strict_mode"):60108,bc=A?Symbol.for("react.profiler"):60114,cc=A?Symbol.for("react.provider"):60109,dc=A?Symbol.for("react.context"):60110,ec=A?Symbol.for("react.concurrent_mode"):60111,fc=A?Symbol.for("react.forward_ref"):60112,gc=A?Symbol.for("react.suspense"):60113,hc=A?Symbol.for("react.memo"): 60115,ic=A?Symbol.for("react.lazy"):60116,jc="function"===typeof Symbol&&Symbol.iterator;function kc(a){if(null===a||"object"!==typeof a)return null;a=jc&&a[jc]||a["@@iterator"];return"function"===typeof a?a:null} function lc(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ec:return"ConcurrentMode";case $b:return"Fragment";case Zb:return"Portal";case bc:return"Profiler";case ac:return"StrictMode";case gc:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case dc:return"Context.Consumer";case cc:return"Context.Provider";case fc:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+ ")":"ForwardRef");case hc:return lc(a.type);case ic:if(a=1===a._status?a._result:null)return lc(a)}return null}function mc(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=lc(a.type);c=null;d&&(c=lc(d.type));d=f;f="";e?f=" (at "+e.fileName.replace(Xb,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")");c="\n in "+(d||"Unknown")+f}b+=c;a=a.return}while(a);return b} var nc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,oc=Object.prototype.hasOwnProperty,pc={},qc={}; function rc(a){if(oc.call(qc,a))return!0;if(oc.call(pc,a))return!1;if(nc.test(a))return qc[a]=!0;pc[a]=!0;return!1}function sc(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} function tc(a,b,c,d){if(null===b||"undefined"===typeof b||sc(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function B(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var C={}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){C[a]=new B(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];C[b]=new B(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){C[a]=new B(a,2,!1,a.toLowerCase(),null)}); ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){C[a]=new B(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){C[a]=new B(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){C[a]=new B(a,3,!0,a,null)}); ["capture","download"].forEach(function(a){C[a]=new B(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){C[a]=new B(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){C[a]=new B(a,5,!1,a.toLowerCase(),null)});var uc=/[\-:]([a-z])/g;function vc(a){return a[1].toUpperCase()} "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(uc, vc);C[b]=new B(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(uc,vc);C[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(uc,vc);C[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});["tabIndex","crossOrigin"].forEach(function(a){C[a]=new B(a,1,!1,a.toLowerCase(),null)}); function wc(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1]?!1:!0;f||(tc(b,c,e,d)&&(c=null),d||null===e?rc(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))} function xc(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return""}}function yc(a,b){var c=b.checked;return n({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})} function zc(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=xc(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Ac(a,b){b=b.checked;null!=b&&wc(a,"checked",b,!1)} function Bc(a,b){Ac(a,b);var c=xc(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?Cc(a,b.type,c):b.hasOwnProperty("defaultValue")&&Cc(a,b.type,xc(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)} function Dc(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)} function Cc(a,b,c){if("number"!==b||a.ownerDocument.activeElement!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var Ec={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Fc(a,b,c){a=y.getPooled(Ec.change,a,b,c);a.type="change";Gb(c);Ra(a);return a}var Gc=null,Hc=null;function Ic(a){Da(a)} function Jc(a){var b=Ja(a);if(Vb(b))return a}function Kc(a,b){if("change"===a)return b}var Lc=!1;Sa&&(Lc=Rb("input")&&(!document.documentMode||9<document.documentMode));function Mc(){Gc&&(Gc.detachEvent("onpropertychange",Nc),Hc=Gc=null)}function Nc(a){"value"===a.propertyName&&Jc(Hc)&&(a=Fc(Hc,a,Qb(a)),Mb(Ic,a))}function Oc(a,b,c){"focus"===a?(Mc(),Gc=b,Hc=c,Gc.attachEvent("onpropertychange",Nc)):"blur"===a&&Mc()}function Pc(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return Jc(Hc)} function Qc(a,b){if("click"===a)return Jc(b)}function Rc(a,b){if("input"===a||"change"===a)return Jc(b)} var Sc={eventTypes:Ec,_isInputEventSupported:Lc,extractEvents:function(a,b,c,d){var e=b?Ja(b):window,f=void 0,g=void 0,h=e.nodeName&&e.nodeName.toLowerCase();"select"===h||"input"===h&&"file"===e.type?f=Kc:Pb(e)?Lc?f=Rc:(f=Pc,g=Oc):(h=e.nodeName)&&"input"===h.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)&&(f=Qc);if(f&&(f=f(a,b)))return Fc(f,c,d);g&&g(a,e,b);"blur"===a&&(a=e._wrapperState)&&a.controlled&&"number"===e.type&&Cc(e,"number",e.value)}},Tc=y.extend({view:null,detail:null}),Uc={Alt:"altKey", Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vc(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Uc[a])?!!b[a]:!1}function Wc(){return Vc} var Xc=0,Yc=0,Zc=!1,$c=!1,ad=Tc.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Wc,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=Xc;Xc=a.screenX;return Zc?"mousemove"===a.type?a.screenX-b:0:(Zc=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY; var b=Yc;Yc=a.screenY;return $c?"mousemove"===a.type?a.screenY-b:0:($c=!0,0)}}),bd=ad.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),cd={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave", dependencies:["pointerout","pointerover"]}},dd={eventTypes:cd,extractEvents:function(a,b,c,d){var e="mouseover"===a||"pointerover"===a,f="mouseout"===a||"pointerout"===a;if(e&&(c.relatedTarget||c.fromElement)||!f&&!e)return null;e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;f?(f=b,b=(b=c.relatedTarget||c.toElement)?Ha(b):null):f=null;if(f===b)return null;var g=void 0,h=void 0,k=void 0,l=void 0;if("mouseout"===a||"mouseover"===a)g=ad,h=cd.mouseLeave,k=cd.mouseEnter,l="mouse"; else if("pointerout"===a||"pointerover"===a)g=bd,h=cd.pointerLeave,k=cd.pointerEnter,l="pointer";var m=null==f?e:Ja(f);e=null==b?e:Ja(b);a=g.getPooled(h,f,c,d);a.type=l+"leave";a.target=m;a.relatedTarget=e;c=g.getPooled(k,b,c,d);c.type=l+"enter";c.target=e;c.relatedTarget=m;d=b;if(f&&d)a:{b=f;e=d;l=0;for(g=b;g;g=Ma(g))l++;g=0;for(k=e;k;k=Ma(k))g++;for(;0<l-g;)b=Ma(b),l--;for(;0<g-l;)e=Ma(e),g--;for(;l--;){if(b===e||b===e.alternate)break a;b=Ma(b);e=Ma(e)}b=null}else b=null;e=b;for(b=[];f&&f!==e;){l= f.alternate;if(null!==l&&l===e)break;b.push(f);f=Ma(f)}for(f=[];d&&d!==e;){l=d.alternate;if(null!==l&&l===e)break;f.push(d);d=Ma(d)}for(d=0;d<b.length;d++)Pa(b[d],"bubbled",a);for(d=f.length;0<d--;)Pa(f[d],"captured",c);return[a,c]}};function ed(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var fd=Object.prototype.hasOwnProperty; function gd(a,b){if(ed(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!fd.call(b,c[d])||!ed(a[c[d]],b[c[d]]))return!1;return!0}function hd(a){var b=a;if(a.alternate)for(;b.return;)b=b.return;else{if(0!==(b.effectTag&2))return 1;for(;b.return;)if(b=b.return,0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function id(a){2!==hd(a)?x("188"):void 0} function jd(a){var b=a.alternate;if(!b)return b=hd(a),3===b?x("188"):void 0,1===b?null:a;for(var c=a,d=b;;){var e=c.return,f=e?e.alternate:null;if(!e||!f)break;if(e.child===f.child){for(var g=e.child;g;){if(g===c)return id(e),a;if(g===d)return id(e),b;g=g.sibling}x("188")}if(c.return!==d.return)c=e,d=f;else{g=!1;for(var h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}g? void 0:x("189")}}c.alternate!==d?x("190"):void 0}3!==c.tag?x("188"):void 0;return c.stateNode.current===c?a:b}function kd(a){a=jd(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null} var ld=y.extend({animationName:null,elapsedTime:null,pseudoElement:null}),md=y.extend({clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),nd=Tc.extend({relatedTarget:null});function od(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0} var pd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",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:"NumLock",145:"ScrollLock",224:"Meta"},rd=Tc.extend({key:function(a){if(a.key){var b=pd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=od(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?qd[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Wc,charCode:function(a){return"keypress"=== a.type?od(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?od(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),sd=ad.extend({dataTransfer:null}),td=Tc.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Wc}),ud=y.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),vd=ad.extend({deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),wd=[["abort","abort"],[Ya,"animationEnd"],[Za,"animationIteration"],[$a,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"], ["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"], ["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[ab,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],xd={},yd={};function zd(a,b){var c=a[0];a=a[1];var d="on"+(a[0].toUpperCase()+a.slice(1));b={phasedRegistrationNames:{bubbled:d,captured:d+"Capture"},dependencies:[c],isInteractive:b};xd[a]=b;yd[c]=b} [["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["auxclick","auxClick"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"], ["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(a){zd(a,!0)});wd.forEach(function(a){zd(a,!1)}); var Ad={eventTypes:xd,isInteractiveTopLevelEventType:function(a){a=yd[a];return void 0!==a&&!0===a.isInteractive},extractEvents:function(a,b,c,d){var e=yd[a];if(!e)return null;switch(a){case "keypress":if(0===od(c))return null;case "keydown":case "keyup":a=rd;break;case "blur":case "focus":a=nd;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=ad;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a= sd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=td;break;case Ya:case Za:case $a:a=ld;break;case ab:a=ud;break;case "scroll":a=Tc;break;case "wheel":a=vd;break;case "copy":case "cut":case "paste":a=md;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=bd;break;default:a=y}b=a.getPooled(e,b,c,d);Ra(b);return b}},Bd=Ad.isInteractiveTopLevelEventType, Cd=[];function Dd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d;for(d=c;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo;if(!d)break;a.ancestors.push(c);c=Ha(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=Qb(a.nativeEvent);d=a.topLevelType;for(var f=a.nativeEvent,g=null,h=0;h<oa.length;h++){var k=oa[h];k&&(k=k.extractEvents(d,b,f,e))&&(g=xa(g,k))}Da(g)}}var Ed=!0; function D(a,b){if(!b)return null;var c=(Bd(a)?Fd:Gd).bind(null,a);b.addEventListener(a,c,!1)}function Hd(a,b){if(!b)return null;var c=(Bd(a)?Fd:Gd).bind(null,a);b.addEventListener(a,c,!0)}function Fd(a,b){Jb(Gd,a,b)} function Gd(a,b){if(Ed){var c=Qb(b);c=Ha(c);null===c||"number"!==typeof c.tag||2===hd(c)||(c=null);if(Cd.length){var d=Cd.pop();d.topLevelType=a;d.nativeEvent=b;d.targetInst=c;a=d}else a={topLevelType:a,nativeEvent:b,targetInst:c,ancestors:[]};try{Mb(Dd,a)}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,10>Cd.length&&Cd.push(a)}}}var Id={},Jd=0,Kd="_reactListenersID"+(""+Math.random()).slice(2); function Ld(a){Object.prototype.hasOwnProperty.call(a,Kd)||(a[Kd]=Jd++,Id[a[Kd]]={});return Id[a[Kd]]}function Md(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Nd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} function Od(a,b){var c=Nd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Nd(c)}}function Pd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Pd(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} function Qd(){for(var a=window,b=Md();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Md(a.document)}return b}function Rd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} function Sd(){var a=Qd();if(Rd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(U){b=null;break a}var f=0,g=-1,h=-1,k=0,l=0,m=a,p=null;b:for(;;){for(var w;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length); if(null===(w=m.firstChild))break;p=m;m=w}for(;;){if(m===a)break b;p===b&&++k===d&&(g=f);p===e&&++l===c&&(h=f);if(null!==(w=m.nextSibling))break;m=p;p=m.parentNode}m=w}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}} function Td(a){var b=Qd(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Pd(c.ownerDocument.documentElement,c)){if(null!==d&&Rd(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Od(c,f);var g=Od(c, d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}} var Ud=Sa&&"documentMode"in document&&11>=document.documentMode,Vd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Wd=null,Xd=null,Yd=null,Zd=!1; function $d(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Zd||null==Wd||Wd!==Md(c))return null;c=Wd;"selectionStart"in c&&Rd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Yd&&gd(Yd,c)?null:(Yd=c,a=y.getPooled(Vd.select,Xd,a,b),a.type="select",a.target=Wd,Ra(a),a)} var ae={eventTypes:Vd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Ld(e);f=sa.onSelect;for(var g=0;g<f.length;g++){var h=f[g];if(!e.hasOwnProperty(h)||!e[h]){e=!1;break a}}e=!0}f=!e}if(f)return null;e=b?Ja(b):window;switch(a){case "focus":if(Pb(e)||"true"===e.contentEditable)Wd=e,Xd=b,Yd=null;break;case "blur":Yd=Xd=Wd=null;break;case "mousedown":Zd=!0;break;case "contextmenu":case "mouseup":case "dragend":return Zd=!1,$d(c,d);case "selectionchange":if(Ud)break; case "keydown":case "keyup":return $d(c,d)}return null}};Ba.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));ta=Ka;ua=Ia;va=Ja;Ba.injectEventPluginsByName({SimpleEventPlugin:Ad,EnterLeaveEventPlugin:dd,ChangeEventPlugin:Sc,SelectEventPlugin:ae,BeforeInputEventPlugin:Bb});function be(a){var b="";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b} function ce(a,b){a=n({children:void 0},b);if(b=be(b.children))a.children=b;return a}function de(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+xc(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}} function ee(a,b){null!=b.dangerouslySetInnerHTML?x("91"):void 0;return n({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function fe(a,b){var c=b.value;null==c&&(c=b.defaultValue,b=b.children,null!=b&&(null!=c?x("92"):void 0,Array.isArray(b)&&(1>=b.length?void 0:x("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:xc(c)}} function ge(a,b){var c=xc(b.value),d=xc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function he(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var ie={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; function je(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ke(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?je(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} var le=void 0,me=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==ie.svg||"innerHTML"in a)a.innerHTML=b;else{le=le||document.createElement("div");le.innerHTML="<svg>"+b+"</svg>";for(b=le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); function ne(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} var oe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0, floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];Object.keys(oe).forEach(function(a){pe.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);oe[b]=oe[a]})});function qe(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||oe.hasOwnProperty(a)&&oe[a]?(""+b).trim():b+"px"} function re(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=qe(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var se=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); function te(a,b){b&&(se[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?x("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?x("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:x("61")),null!=b.style&&"object"!==typeof b.style?x("62",""):void 0)} function ue(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}} function ve(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Ld(a);b=sa[b];for(var d=0;d<b.length;d++){var e=b[d];if(!c.hasOwnProperty(e)||!c[e]){switch(e){case "scroll":Hd("scroll",a);break;case "focus":case "blur":Hd("focus",a);Hd("blur",a);c.blur=!0;c.focus=!0;break;case "cancel":case "close":Rb(e)&&Hd(e,a);break;case "invalid":case "submit":case "reset":break;default:-1===bb.indexOf(e)&&D(e,a)}c[e]=!0}}}function we(){}var xe=null,ye=null; function ze(a,b){switch(a){case "button":case "input":case "select":case "textarea":return!!b.autoFocus}return!1}function Ae(a,b){return"textarea"===a||"option"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html} var Be="function"===typeof setTimeout?setTimeout:void 0,Ce="function"===typeof clearTimeout?clearTimeout:void 0,De=r.unstable_scheduleCallback,Ee=r.unstable_cancelCallback; function Fe(a,b,c,d,e){a[Ga]=e;"input"===c&&"radio"===e.type&&null!=e.name&&Ac(a,e);ue(c,d);d=ue(c,e);for(var f=0;f<b.length;f+=2){var g=b[f],h=b[f+1];"style"===g?re(a,h):"dangerouslySetInnerHTML"===g?me(a,h):"children"===g?ne(a,h):wc(a,g,h,d)}switch(c){case "input":Bc(a,e);break;case "textarea":ge(a,e);break;case "select":b=a._wrapperState.wasMultiple,a._wrapperState.wasMultiple=!!e.multiple,c=e.value,null!=c?de(a,!!e.multiple,c,!1):b!==!!e.multiple&&(null!=e.defaultValue?de(a,!!e.multiple,e.defaultValue, !0):de(a,!!e.multiple,e.multiple?[]:"",!1))}}function Ge(a){for(a=a.nextSibling;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a}function He(a){for(a=a.firstChild;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a}new Set;var Ie=[],Je=-1;function E(a){0>Je||(a.current=Ie[Je],Ie[Je]=null,Je--)}function F(a,b){Je++;Ie[Je]=a.current;a.current=b}var Ke={},G={current:Ke},H={current:!1},Le=Ke; function Me(a,b){var c=a.type.contextTypes;if(!c)return Ke;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function I(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ne(a){E(H,a);E(G,a)}function Oe(a){E(H,a);E(G,a)} function Pe(a,b,c){G.current!==Ke?x("168"):void 0;F(G,b,a);F(H,c,a)}function Qe(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x("108",lc(b)||"Unknown",e);return n({},c,d)}function Re(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Ke;Le=G.current;F(G,b,a);F(H,H.current,a);return!0} function Se(a,b,c){var d=a.stateNode;d?void 0:x("169");c?(b=Qe(a,b,Le),d.__reactInternalMemoizedMergedChildContext=b,E(H,a),E(G,a),F(G,b,a)):E(H,a);F(H,c,a)}var Te=null,Ue=null;function Ve(a){return function(b){try{return a(b)}catch(c){}}}var We="undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; function Xe(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Te=Ve(function(a){return b.onCommitFiberRoot(c,a)});Ue=Ve(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0} function Ye(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null;this.treeBaseDuration=this.selfBaseDuration=this.actualStartTime=this.actualDuration=Number.NaN; this.actualDuration=0;this.actualStartTime=-1;this.treeBaseDuration=this.selfBaseDuration=0}function J(a,b,c,d){return new Ye(a,b,c,d)}function Ze(a){a=a.prototype;return!(!a||!a.isReactComponent)}function $e(a){if("function"===typeof a)return Ze(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===fc)return 11;if(a===hc)return 14}return 2} function af(a,b){var c=a.alternate;null===c?(c=J(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.contextDependencies= a.contextDependencies;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;c.selfBaseDuration=a.selfBaseDuration;c.treeBaseDuration=a.treeBaseDuration;return c} function bf(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Ze(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case $b:return cf(c.children,e,f,b);case ec:return df(c,e|3,f,b);case ac:return df(c,e|2,f,b);case bc:return a=J(12,c,b,e|4),a.elementType=bc,a.type=bc,a.expirationTime=f,a;case gc:return a=J(13,c,b,e),a.elementType=gc,a.type=gc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case cc:g=10;break a;case dc:g=9;break a;case fc:g=11;break a;case hc:g= 14;break a;case ic:g=16;d=null;break a}x("130",null==a?a:typeof a,"")}b=J(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function cf(a,b,c,d){a=J(7,a,d,b);a.expirationTime=c;return a}function df(a,b,c,d){a=J(8,a,d,b);b=0===(b&1)?ac:ec;a.elementType=b;a.type=b;a.expirationTime=c;return a}function ef(a,b,c){a=J(6,a,null,b);a.expirationTime=c;return a} function ff(a,b,c){b=J(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function gf(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:c<b?a.earliestPendingTime=b:a.latestPendingTime>b&&(a.latestPendingTime=b);hf(b,a)} function jf(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{b<a.latestPingedTime&&(a.latestPingedTime=0);var c=a.latestPendingTime;0!==c&&(c>b?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?gf(a,b):b<a.latestSuspendedTime?(a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0,gf(a,b)): b>c&&gf(a,b)}hf(0,a)}function kf(a,b){var c=a.latestPendingTime,d=a.latestSuspendedTime;a=a.latestPingedTime;return 0!==c&&c<b||0!==d&&d<b||0!==a&&a<b} function lf(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:c<b?a.earliestSuspendedTime=b:d>b&&(a.latestSuspendedTime=b);hf(b,a)}function mf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b} function hf(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||d<a)&&(e=d);a=e;0!==a&&c>a&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function K(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b} function nf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var of=(new aa.Component).refs; function pf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)} var yf={isMounted:function(a){return(a=a._reactInternalFiber)?2===hd(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=qf();d=rf(d,a);var e=sf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);tf();uf(a,e);vf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=qf();d=rf(d,a);var e=sf(d);e.tag=wf;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);tf();uf(a,e);vf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=qf();c=rf(c,a);var d=sf(c);d.tag= xf;void 0!==b&&null!==b&&(d.callback=b);tf();uf(a,d);vf(a,c)}};function zf(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!gd(c,d)||!gd(e,f):!0} function Af(a,b,c){var d=!1,e=Ke;var f=b.contextType;"object"===typeof f&&null!==f?f=L(f):(e=I(b)?Le:G.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Me(a,e):Ke);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=yf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} function Bf(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&yf.enqueueReplaceState(b,b.state,null)} function Cf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=of;var f=b.contextType;"object"===typeof f&&null!==f?e.context=L(f):(f=I(b)?Le:G.current,e.context=Me(a,f));f=a.updateQueue;null!==f&&(Df(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(pf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!== typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&yf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Df(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var Ef=Array.isArray; function Ff(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x("309"):void 0,d=c.stateNode);d?void 0:x("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===of&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?x("284"):void 0;c._owner?void 0:x("290",a)}return a} function Gf(a,b){"textarea"!==a.type&&x("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")} function Hf(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=af(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag= 2,c):d;b.effectTag=2;return c}function g(b){a&&null===b.alternate&&(b.effectTag=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=ef(c,a.mode,d),b.return=a,b;b=e(b,c,d);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props,d),d.ref=Ff(a,b,c),d.return=a,d;d=bf(c.type,c.key,c.props,null,a.mode,d);d.ref=Ff(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!== c.implementation)return b=ff(c,a.mode,d),b.return=a,b;b=e(b,c.children||[],d);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=cf(c,a.mode,d,f),b.return=a,b;b=e(b,c,d);b.return=a;return b}function p(a,b,c){if("string"===typeof b||"number"===typeof b)return b=ef(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case Yb:return c=bf(b.type,b.key,b.props,null,a.mode,c),c.ref=Ff(a,null,b),c.return=a,c;case Zb:return b=ff(b,a.mode,c),b.return=a,b}if(Ef(b)|| kc(b))return b=cf(b,a.mode,c,null),b.return=a,b;Gf(a,b)}return null}function w(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case Yb:return c.key===e?c.type===$b?m(a,b,c.props.children,d,e):k(a,b,c,d):null;case Zb:return c.key===e?l(a,b,c,d):null}if(Ef(c)||kc(c))return null!==e?null:m(a,b,c,d,null);Gf(a,c)}return null}function U(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a= a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case Yb:return a=a.get(null===d.key?c:d.key)||null,d.type===$b?m(b,a,d.props.children,e,d.key):k(b,a,d,e);case Zb:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Ef(d)||kc(d))return a=a.get(c)||null,m(b,a,d,e,null);Gf(b,d)}return null}function Nb(e,g,h,k){for(var l=null,m=null,q=g,u=g=0,z=null;null!==q&&u<h.length;u++){q.index>u?(z=q,q=null):z=q.sibling;var t=w(e,q,h[u],k);if(null===t){null===q&&(q=z);break}a&& q&&null===t.alternate&&b(e,q);g=f(t,g,u);null===m?l=t:m.sibling=t;m=t;q=z}if(u===h.length)return c(e,q),l;if(null===q){for(;u<h.length;u++)if(q=p(e,h[u],k))g=f(q,g,u),null===m?l=q:m.sibling=q,m=q;return l}for(q=d(e,q);u<h.length;u++)if(z=U(q,e,u,h[u],k))a&&null!==z.alternate&&q.delete(null===z.key?u:z.key),g=f(z,g,u),null===m?l=z:m.sibling=z,m=z;a&&q.forEach(function(a){return b(e,a)});return l}function La(e,g,h,k){var l=kc(h);"function"!==typeof l?x("150"):void 0;h=l.call(h);null==h?x("151"):void 0; for(var m=l=null,q=g,u=g=0,z=null,t=h.next();null!==q&&!t.done;u++,t=h.next()){q.index>u?(z=q,q=null):z=q.sibling;var gb=w(e,q,t.value,k);if(null===gb){q||(q=z);break}a&&q&&null===gb.alternate&&b(e,q);g=f(gb,g,u);null===m?l=gb:m.sibling=gb;m=gb;q=z}if(t.done)return c(e,q),l;if(null===q){for(;!t.done;u++,t=h.next())t=p(e,t.value,k),null!==t&&(g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);return l}for(q=d(e,q);!t.done;u++,t=h.next())t=U(q,e,u,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null=== t.key?u:t.key),g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===$b&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Yb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===$b:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===$b?f.props.children:f.props,h);d.ref=Ff(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a, k);k=k.sibling}f.type===$b?(d=cf(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=bf(f.type,f.key,f.props,null,a.mode,h),h.ref=Ff(a,d,f),h.return=a,a=h)}return g(a);case Zb:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ff(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"=== typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=ef(f,a.mode,h),d.return=a,a=d),g(a);if(Ef(f))return Nb(a,d,f,h);if(kc(f))return La(a,d,f,h);l&&Gf(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x("152",h.displayName||h.name||"Component")}return c(a,d)}}var If=Hf(!0),Jf=Hf(!1),Kf={},M={current:Kf},Lf={current:Kf},Mf={current:Kf};function Nf(a){a===Kf?x("174"):void 0;return a} function Of(a,b){F(Mf,b,a);F(Lf,a,a);F(M,Kf,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:ke(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=ke(b,c)}E(M,a);F(M,b,a)}function Pf(a){E(M,a);E(Lf,a);E(Mf,a)}function Qf(a){Nf(Mf.current);var b=Nf(M.current);var c=ke(b,a.type);b!==c&&(F(Lf,a,a),F(M,c,a))}function Rf(a){Lf.current===a&&(E(M,a),E(Lf,a))} var Sf=0,Tf=2,Uf=4,Vf=8,Wf=16,Xf=32,Yf=64,Zf=128,$f=Wb.ReactCurrentDispatcher,ag=0,bg=null,N=null,O=null,cg=null,P=null,dg=null,eg=0,fg=null,gg=0,hg=!1,ig=null,jg=0;function kg(){x("321")}function lg(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!ed(a[c],b[c]))return!1;return!0} function mg(a,b,c,d,e,f){ag=f;bg=b;O=null!==a?a.memoizedState:null;$f.current=null===O?ng:og;b=c(d,e);if(hg){do hg=!1,jg+=1,O=null!==a?a.memoizedState:null,dg=cg,fg=P=N=null,$f.current=og,b=c(d,e);while(hg);ig=null;jg=0}$f.current=pg;a=bg;a.memoizedState=cg;a.expirationTime=eg;a.updateQueue=fg;a.effectTag|=gg;a=null!==N&&null!==N.next;ag=0;dg=P=cg=O=N=bg=null;eg=0;fg=null;gg=0;a?x("300"):void 0;return b}function qg(){$f.current=pg;ag=0;dg=P=cg=O=N=bg=null;eg=0;fg=null;gg=0;hg=!1;ig=null;jg=0} function rg(){var a={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};null===P?cg=P=a:P=P.next=a;return P}function sg(){if(null!==dg)P=dg,dg=P.next,N=O,O=null!==N?N.next:null;else{null===O?x("310"):void 0;N=O;var a={memoizedState:N.memoizedState,baseState:N.baseState,queue:N.queue,baseUpdate:N.baseUpdate,next:null};P=null===P?cg=a:P.next=a;O=N.next}return P}function tg(a,b){return"function"===typeof b?b(a):b} function ug(a){var b=sg(),c=b.queue;null===c?x("311"):void 0;c.lastRenderedReducer=a;if(0<jg){var d=c.dispatch;if(null!==ig){var e=ig.get(c);if(void 0!==e){ig.delete(c);var f=b.memoizedState;do f=a(f,e.action),e=e.next;while(null!==e);ed(f,b.memoizedState)||(vg=!0);b.memoizedState=f;b.baseUpdate===c.last&&(b.baseState=f);c.lastRenderedState=f;return[f,d]}}return[b.memoizedState,d]}d=c.last;var g=b.baseUpdate;f=b.baseState;null!==g?(null!==d&&(d.next=null),d=g.next):d=null!==d?d.next:null;if(null!== d){var h=e=null,k=d,l=!1;do{var m=k.expirationTime;m<ag?(l||(l=!0,h=g,e=f),m>eg&&(eg=m)):f=k.eagerReducer===a?k.eagerState:a(f,k.action);g=k;k=k.next}while(null!==k&&k!==d);l||(h=g,e=f);ed(f,b.memoizedState)||(vg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]} function wg(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===fg?(fg={lastEffect:null},fg.lastEffect=a.next=a):(b=fg.lastEffect,null===b?fg.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,fg.lastEffect=a));return a}function xg(a,b,c,d){var e=rg();gg|=a;e.memoizedState=wg(b,c,void 0,void 0===d?null:d)} function yg(a,b,c,d){var e=sg();d=void 0===d?null:d;var f=void 0;if(null!==N){var g=N.memoizedState;f=g.destroy;if(null!==d&&lg(d,g.deps)){wg(Sf,c,f,d);return}}gg|=a;e.memoizedState=wg(b,c,f,d)}function zg(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ag(){} function Bg(a,b,c){25>jg?void 0:x("301");var d=a.alternate;if(a===bg||null!==d&&d===bg)if(hg=!0,a={expirationTime:ag,action:c,eagerReducer:null,eagerState:null,next:null},null===ig&&(ig=new Map),c=ig.get(b),void 0===c)ig.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{tf();var e=qf();e=rf(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null=== d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(ed(l,k))return}catch(m){}finally{}vf(a,e)}} var pg={readContext:L,useCallback:kg,useContext:kg,useEffect:kg,useImperativeHandle:kg,useLayoutEffect:kg,useMemo:kg,useReducer:kg,useRef:kg,useState:kg,useDebugValue:kg},ng={readContext:L,useCallback:function(a,b){rg().memoizedState=[a,void 0===b?null:b];return a},useContext:L,useEffect:function(a,b){return xg(516,Zf|Yf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return xg(4,Uf|Xf,zg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return xg(4,Uf|Xf,a,b)}, useMemo:function(a,b){var c=rg();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=rg();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Bg.bind(null,bg,a);return[d.memoizedState,a]},useRef:function(a){var b=rg();a={current:a};return b.memoizedState=a},useState:function(a){var b=rg();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null, lastRenderedReducer:tg,lastRenderedState:a};a=a.dispatch=Bg.bind(null,bg,a);return[b.memoizedState,a]},useDebugValue:Ag},og={readContext:L,useCallback:function(a,b){var c=sg();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lg(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:L,useEffect:function(a,b){return yg(516,Zf|Yf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return yg(4,Uf|Xf,zg.bind(null,b,a),c)},useLayoutEffect:function(a, b){return yg(4,Uf|Xf,a,b)},useMemo:function(a,b){var c=sg();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lg(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:ug,useRef:function(){return sg().memoizedState},useState:function(a){return ug(tg,a)},useDebugValue:Ag},Cg=0,Dg=-1;function Eg(a){Dg=r.unstable_now();0>a.actualStartTime&&(a.actualStartTime=r.unstable_now())} function Fg(a,b){if(0<=Dg){var c=r.unstable_now()-Dg;a.actualDuration+=c;b&&(a.selfBaseDuration=c);Dg=-1}}var Gg=null,Hg=null,Ig=!1;function Jg(a,b){var c=J(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c} function Kg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}function Lg(a){if(Ig){var b=Hg;if(b){var c=b;if(!Kg(a,b)){b=Ge(c);if(!b||!Kg(a,b)){a.effectTag|=2;Ig=!1;Gg=a;return}Jg(Gg,c)}Gg=a;Hg=He(b)}else a.effectTag|=2,Ig=!1,Gg=a}} function Mg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;Gg=a}function Ng(a){if(a!==Gg)return!1;if(!Ig)return Mg(a),Ig=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ae(b,a.memoizedProps))for(b=Hg;b;)Jg(a,b),b=Ge(b);Mg(a);Hg=Gg?Ge(a.stateNode):null;return!0}function Og(){Hg=Gg=null;Ig=!1}var Pg=Wb.ReactCurrentOwner,vg=!1;function Q(a,b,c,d){b.child=null===a?Jf(b,null,c,d):If(b,a.child,c,d)} function Qg(a,b,c,d,e){c=c.render;var f=b.ref;Rg(b,e);d=mg(a,b,c,d,f,e);if(null!==a&&!vg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Sg(a,b,e);b.effectTag|=1;Q(a,b,d,e);return b.child} function Tg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Ze(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Ug(a,b,g,d,e,f);a=bf(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e<f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:gd,c(e,d)&&a.ref===b.ref))return Sg(a,b,f);b.effectTag|=1;a=af(g,d,f);a.ref=b.ref;a.return=b;return b.child=a} function Ug(a,b,c,d,e,f){return null!==a&&gd(a.memoizedProps,d)&&a.ref===b.ref&&(vg=!1,e<f)?Sg(a,b,f):Vg(a,b,c,d,f)}function Wg(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function Vg(a,b,c,d,e){var f=I(c)?Le:G.current;f=Me(b,f);Rg(b,e);c=mg(a,b,c,d,f,e);if(null!==a&&!vg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Sg(a,b,e);b.effectTag|=1;Q(a,b,c,e);return b.child} function Xg(a,b,c,d,e){if(I(c)){var f=!0;Re(b)}else f=!1;Rg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),Af(b,c,d,e),Cf(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=L(l):(l=I(c)?Le:G.current,l=Me(b,l));var m=c.getDerivedStateFromProps,p="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;p||"function"!==typeof g.UNSAFE_componentWillReceiveProps&& "function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Bf(b,g,d,l);Yg=!1;var w=b.memoizedState;k=g.state=w;var U=b.updateQueue;null!==U&&(Df(b,U,d,g,e),k=b.memoizedState);h!==d||w!==k||H.current||Yg?("function"===typeof m&&(pf(b,c,m,d),k=b.memoizedState),(h=Yg||zf(b,c,h,d,w,k,l))?(p||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&& g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.effectTag|=4)):("function"===typeof g.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.effectTag|=4),d=!1)}else g=b.stateNode,h=b.memoizedProps,g.props=b.type===b.elementType?h:K(b.type,h),k=g.context,l=c.contextType,"object"===typeof l&&null!==l?l=L(l):(l=I(c)?Le:G.current,l=Me(b,l)),m=c.getDerivedStateFromProps,(p="function"=== typeof m||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Bf(b,g,d,l),Yg=!1,k=b.memoizedState,w=g.state=k,U=b.updateQueue,null!==U&&(Df(b,U,d,g,e),w=b.memoizedState),h!==d||k!==w||H.current||Yg?("function"===typeof m&&(pf(b,c,m,d),w=b.memoizedState),(m=Yg||zf(b,c,h,d,k,w,l))?(p||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"=== typeof g.componentWillUpdate&&g.componentWillUpdate(d,w,l),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,w,l)),"function"===typeof g.componentDidUpdate&&(b.effectTag|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=d,b.memoizedState= w),g.props=d,g.state=w,g.context=l,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return Zg(a,b,c,d,f,e)} function Zg(a,b,c,d,e,f){Wg(a,b);var g=0!==(b.effectTag&64);if(!d&&!g)return e&&Se(b,c,!1),Sg(a,b,f);d=b.stateNode;Pg.current=b;if(g&&"function"!==typeof c.getDerivedStateFromError){var h=null;Dg=-1}else h=d.render();b.effectTag|=1;null!==a&&g?(g=h,b.child=If(b,a.child,null,f),b.child=If(b,null,g,f)):Q(a,b,h,f);b.memoizedState=d.state;e&&Se(b,c,!0);return b.child} function $g(a){var b=a.stateNode;b.pendingContext?Pe(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Pe(a,b.context,!1);Of(a,b.containerInfo)} function ah(a,b,c){var d=b.mode,e=b.pendingProps,f=b.memoizedState;if(0===(b.effectTag&64)){f=null;var g=!1}else f={timedOutAt:null!==f?f.timedOutAt:0},g=!0,b.effectTag&=-65;if(null===a)if(g){var h=e.fallback;a=cf(null,d,0,null);0===(b.mode&1)&&(a.child=null!==b.memoizedState?b.child.child:b.child);c=cf(h,d,c,null);a.sibling=c;d=a;d.return=c.return=b}else d=c=Jf(b,null,e.children,c);else{if(null!==a.memoizedState)if(h=a.child,d=h.sibling,g){e=e.fallback;c=af(h,h.pendingProps,0);0===(b.mode&1)&&(g= null!==b.memoizedState?b.child.child:b.child,g!==h.child&&(c.child=g));if(b.mode&4){h=0;for(g=c.child;null!==g;)h+=g.treeBaseDuration,g=g.sibling;c.treeBaseDuration=h}h=c.sibling=af(d,e,d.expirationTime);d=c;c.childExpirationTime=0;c=h;d.return=c.return=b}else d=c=If(b,h.child,e.children,c);else{var k=a.child;if(g){e=e.fallback;h=cf(null,d,0,null);h.child=k;0===(b.mode&1)&&(h.child=null!==b.memoizedState?b.child.child:b.child);if(b.mode&4){g=0;for(k=h.child;null!==k;)g+=k.treeBaseDuration,k=k.sibling; h.treeBaseDuration=g}c=h.sibling=cf(e,d,c,null);c.effectTag|=2;d=h;h.childExpirationTime=0;d.return=c.return=b}else c=d=If(b,k,e.children,c)}b.stateNode=a.stateNode}b.memoizedState=f;b.child=d;return c} function Sg(a,b,c){null!==a&&(b.contextDependencies=a.contextDependencies);Dg=-1;if(b.childExpirationTime<c)return null;null!==a&&b.child!==a.child?x("153"):void 0;if(null!==b.child){a=b.child;c=af(a,a.pendingProps,a.expirationTime);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=af(a,a.pendingProps,a.expirationTime),c.return=b;c.sibling=null}return b.child} function bh(a,b,c){var d=b.expirationTime;if(null!==a)if(a.memoizedProps!==b.pendingProps||H.current)vg=!0;else{if(d<c){vg=!1;switch(b.tag){case 3:$g(b);Og();break;case 5:Qf(b);break;case 1:I(b.type)&&Re(b);break;case 4:Of(b,b.stateNode.containerInfo);break;case 10:ch(b,b.memoizedProps.value);break;case 12:b.effectTag|=4;break;case 13:if(null!==b.memoizedState){d=b.child.childExpirationTime;if(0!==d&&d>=c)return ah(a,b,c);b=Sg(a,b,c);return null!==b?b.sibling:null}}return Sg(a,b,c)}}else vg=!1;b.expirationTime= 0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Me(b,G.current);Rg(b,c);e=mg(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;qg();if(I(d)){var f=!0;Re(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&pf(b,d,g,a);e.updater=yf;b.stateNode=e;e._reactInternalFiber=b;Cf(b, d,a,c);b=Zg(null,b,d,!0,f,c)}else b.tag=0,Q(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=nf(e);b.type=a;e=b.tag=$e(a);f=K(a,f);g=void 0;switch(e){case 0:g=Vg(null,b,a,f,c);break;case 1:g=Xg(null,b,a,f,c);break;case 11:g=Qg(null,b,a,f,c);break;case 14:g=Tg(null,b,a,K(a.type,f),d,c);break;default:x("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Vg(a,b,d,e,c);case 1:return d= b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Xg(a,b,d,e,c);case 3:$g(b);d=b.updateQueue;null===d?x("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;Df(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Og(),b=Sg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)Hg=He(b.stateNode.containerInfo),Gg=b,e=Ig=!0;e?(b.effectTag|=2,b.child=Jf(b,null,d,c)):(Q(a,b,d,c),Og());b=b.child}return b;case 5:return Qf(b),null===a&&Lg(b),d=b.type,e=b.pendingProps,f=null!== a?a.memoizedProps:null,g=e.children,Ae(d,e)?g=null:null!==f&&Ae(d,f)&&(b.effectTag|=16),Wg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(Q(a,b,g,c),b=b.child),b;case 6:return null===a&&Lg(b),null;case 13:return ah(a,b,c);case 4:return Of(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=If(b,null,d,c):Q(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Qg(a,b,d,e,c);case 7:return Q(a,b,b.pendingProps,c),b.child; case 8:return Q(a,b,b.pendingProps.children,c),b.child;case 12:return b.effectTag|=4,Q(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;ch(b,f);if(null!==g){var h=g.value;f=ed(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!H.current){b=Sg(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.contextDependencies;if(null!==k){g= h.child;for(var l=k.first;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=sf(c),l.tag=xf,uf(h,l));h.expirationTime<c&&(h.expirationTime=c);l=h.alternate;null!==l&&l.expirationTime<c&&(l.expirationTime=c);l=c;for(var m=h.return;null!==m;){var p=m.alternate;if(m.childExpirationTime<l)m.childExpirationTime=l,null!==p&&p.childExpirationTime<l&&(p.childExpirationTime=l);else if(null!==p&&p.childExpirationTime<l)p.childExpirationTime=l;else break;m=m.return}k.expirationTime<c&&(k.expirationTime= c);break}l=l.next}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return}h=g}}Q(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,Rg(b,c),e=L(e,f.unstable_observedBits),d=d(e),b.effectTag|=1,Q(a,b,d,c),b.child;case 14:return e=b.type,f=K(e,b.pendingProps),f=K(e.type,f),Tg(a,b,e,f,d,c);case 15:return Ug(a,b,b.type,b.pendingProps, d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,I(d)?(a=!0,Re(b)):a=!1,Rg(b,c),Af(b,d,e,c),Cf(b,d,e,c),Zg(null,b,d,!0,a,c)}x("156")}var dh={current:null},eh=null,fh=null,gh=null;function ch(a,b){var c=a.type._context;F(dh,c._currentValue,a);c._currentValue=b}function hh(a){var b=dh.current;E(dh,a);a.type._context._currentValue=b} function Rg(a,b){eh=a;gh=fh=null;var c=a.contextDependencies;null!==c&&c.expirationTime>=b&&(vg=!0);a.contextDependencies=null}function L(a,b){if(gh!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)gh=a,b=1073741823;b={context:a,observedBits:b,next:null};null===fh?(null===eh?x("308"):void 0,fh=b,eh.contextDependencies={first:b,expirationTime:0}):fh=fh.next=b}return a._currentValue}var ih=0,wf=1,xf=2,jh=3,Yg=!1; function kh(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function lh(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} function sf(a){return{expirationTime:a,tag:ih,payload:null,callback:null,next:null,nextEffect:null}}function mh(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)} function uf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=kh(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=kh(a.memoizedState),e=c.updateQueue=kh(c.memoizedState)):d=a.updateQueue=lh(e):null===e&&(e=c.updateQueue=lh(d));null===e||d===e?mh(d,b):null===d.lastUpdate||null===e.lastUpdate?(mh(d,b),mh(e,b)):(mh(d,b),e.lastUpdate=b)} function nh(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=kh(a.memoizedState):oh(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function oh(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=lh(b));return b} function ph(a,b,c,d,e,f){switch(c.tag){case wf:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case jh:a.effectTag=a.effectTag&-2049|64;case ih:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case xf:Yg=!0}return d} function Df(a,b,c,d,e){Yg=!1;b=oh(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;m<e?(null===g&&(g=k,f=l),h<m&&(h=m)):(l=ph(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=k:(b.lastEffect.nextEffect=k,b.lastEffect=k)));k=k.next}m=null;for(k=b.firstCapturedUpdate;null!==k;){var p=k.expirationTime;p<e?(null===m&&(m=k,null===g&&(f=l)),h<p&&(h=p)):(l=ph(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|= 32,k.nextEffect=null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=k:(b.lastCapturedEffect.nextEffect=k,b.lastCapturedEffect=k)));k=k.next}null===g&&(b.lastUpdate=null);null===m?b.lastCapturedUpdate=null:a.effectTag|=32;null===g&&null===m&&(f=l);b.baseState=f;b.firstUpdate=g;b.firstCapturedUpdate=m;a.expirationTime=h;a.memoizedState=l} function qh(a,b,c){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null);rh(b.firstEffect,c);b.firstEffect=b.lastEffect=null;rh(b.firstCapturedEffect,c);b.firstCapturedEffect=b.lastCapturedEffect=null}function rh(a,b){for(;null!==a;){var c=a.callback;if(null!==c){a.callback=null;var d=b;"function"!==typeof c?x("191",c):void 0;c.call(d)}a=a.nextEffect}} function sh(a,b){return{value:a,source:b,stack:mc(b)}}function th(a){a.effectTag|=4}var uh=void 0,vh=void 0,wh=void 0,xh=void 0;uh=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};vh=function(){}; wh=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;Nf(M.current);a=null;switch(c){case "input":f=yc(g,f);d=yc(g,d);a=[];break;case "option":f=ce(g,f);d=ce(g,d);a=[];break;case "select":f=n({},f,{value:void 0});d=n({},d,{value:void 0});a=[];break;case "textarea":f=ee(g,f);d=ee(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=we)}te(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"=== c){var k=f[c];for(g in k)k.hasOwnProperty(g)&&(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(ra.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(g in k)!k.hasOwnProperty(g)||l&&l.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in l)l.hasOwnProperty(g)&&k[g]!==l[g]&&(h|| (h={}),h[g]=l[g])}else h||(a||(a=[]),a.push(c,h)),h=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(ra.hasOwnProperty(c)?(null!=l&&ve(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&th(b)}};xh=function(a,b,c,d){c!==d&&th(b)}; var yh="function"===typeof WeakSet?WeakSet:Set;function zh(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=mc(c));null!==c&&lc(c.type);b=b.value;null!==a&&1===a.tag&&lc(a.type);try{console.error(b)}catch(e){setTimeout(function(){throw e;})}}function Ah(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){Bh(a,c)}else b.current=null} function Ch(a,b,c){c=c.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do{if((d.tag&a)!==Sf){var e=d.destroy;d.destroy=void 0;void 0!==e&&e()}(d.tag&b)!==Sf&&(e=d.create,d.destroy=e());d=d.next}while(d!==c)}} function Dh(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d.style.display="none";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null;d.style.display=qe("display",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?"":c.memoizedProps;else if(13===c.tag&&null!==c.memoizedState){d=c.child.sibling;d.return=c;c=d;continue}else if(null!==c.child){c.child.return=c;c=c.child;continue}if(c===a)break;for(;null===c.sibling;){if(null===c.return|| c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}} function Eh(a){"function"===typeof Ue&&Ue(a);switch(a.tag){case 0:case 11:case 14:case 15:var b=a.updateQueue;if(null!==b&&(b=b.lastEffect,null!==b)){var c=b=b.next;do{var d=c.destroy;if(void 0!==d){var e=a;try{d()}catch(f){Bh(e,f)}}c=c.next}while(c!==b)}break;case 1:Ah(a);b=a.stateNode;if("function"===typeof b.componentWillUnmount)try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(f){Bh(a,f)}break;case 5:Ah(a);break;case 4:Fh(a)}} function Gh(a){return 5===a.tag||3===a.tag||4===a.tag} function Hh(a){a:{for(var b=a.return;null!==b;){if(Gh(b)){var c=b;break a}b=b.return}x("160");c=void 0}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:x("161")}c.effectTag&16&&(ne(b,""),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Gh(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.effectTag& 2)continue b;if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)if(c)if(d){var f=b,g=e.stateNode,h=c;8===f.nodeType?f.parentNode.insertBefore(g,h):f.insertBefore(g,h)}else b.insertBefore(e.stateNode,c);else d?(g=b,h=e.stateNode,8===g.nodeType?(f=g.parentNode,f.insertBefore(h,g)):(f=g,f.appendChild(h)),g=g._reactRootContainer,null!==g&&void 0!==g||null!==f.onclick||(f.onclick=we)):b.appendChild(e.stateNode); else if(4!==e.tag&&null!==e.child){e.child.return=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return;e=e.sibling}} function Fh(a){for(var b=a,c=!1,d=void 0,e=void 0;;){if(!c){c=b.return;a:for(;;){null===c?x("160"):void 0;switch(c.tag){case 5:d=c.stateNode;e=!1;break a;case 3:d=c.stateNode.containerInfo;e=!0;break a;case 4:d=c.stateNode.containerInfo;e=!0;break a}c=c.return}c=!0}if(5===b.tag||6===b.tag){a:for(var f=b,g=f;;)if(Eh(g),null!==g.child&&4!==g.tag)g.child.return=g,g=g.child;else{if(g===f)break;for(;null===g.sibling;){if(null===g.return||g.return===f)break a;g=g.return}g.sibling.return=g.return;g=g.sibling}e? (f=d,g=b.stateNode,8===f.nodeType?f.parentNode.removeChild(g):f.removeChild(g)):d.removeChild(b.stateNode)}else if(4===b.tag){if(null!==b.child){d=b.stateNode.containerInfo;e=!0;b.child.return=b;b=b.child;continue}}else if(Eh(b),null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return;b=b.return;4===b.tag&&(c=!1)}b.sibling.return=b.return;b=b.sibling}} function Ih(a,b){switch(b.tag){case 0:case 11:case 14:case 15:Ch(Uf,Vf,b);break;case 1:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&Fe(c,f,e,a,d,b)}break;case 6:null===b.stateNode?x("162"):void 0;b.stateNode.nodeValue=b.memoizedProps;break;case 3:break;case 12:break;case 13:c=b.memoizedState;d=void 0;a=b;null===c?d=!1:(d=!0,a=b.child,0===c.timedOutAt&&(c.timedOutAt=qf()));null!==a&&Dh(a,d);c= b.updateQueue;if(null!==c){b.updateQueue=null;var g=b.stateNode;null===g&&(g=b.stateNode=new yh);c.forEach(function(a){var c=Jh.bind(null,b,a);c=v.unstable_wrap(c);g.has(a)||(g.add(a),a.then(c,c))})}break;case 17:break;default:x("163")}}var Kh="function"===typeof WeakMap?WeakMap:Map;function Lh(a,b,c){c=sf(c);c.tag=jh;c.payload={element:null};var d=b.value;c.callback=function(){Mh(d);zh(a,b)};return c} function Nh(a,b,c){c=sf(c);c.tag=jh;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===Oh?Oh=new Set([this]):Oh.add(this));var c=b.value,e=b.stack;zh(a,b);this.componentDidCatch(c,{componentStack:null!==e?e:""})});return c} function Ph(a,b,c,d,e){c.effectTag|=1024;c.firstEffect=c.lastEffect=null;if(null!==d&&"object"===typeof d&&"function"===typeof d.then){var f=d;d=b;var g=-1,h=-1;do{if(13===d.tag){var k=d.alternate;if(null!==k&&(k=k.memoizedState,null!==k)){h=10*(1073741822-k.timedOutAt);break}k=d.pendingProps.maxDuration;if("number"===typeof k)if(0>=k)g=0;else if(-1===g||k<g)g=k}d=d.return}while(null!==d);d=b;do{if(k=13===d.tag)k=void 0===d.memoizedProps.fallback?!1:null===d.memoizedState;if(k){b=d.updateQueue;null=== b?(b=new Set,b.add(f),d.updateQueue=b):b.add(f);if(0===(d.mode&1)){d.effectTag|=64;c.effectTag&=-1957;1===c.tag&&(null===c.alternate?c.tag=17:(e=sf(1073741823),e.tag=xf,uf(c,e)));c.expirationTime=1073741823;return}c=a;b=e;var l=c.pingCache;null===l?(l=c.pingCache=new Kh,k=new Set,l.set(f,k)):(k=l.get(f),void 0===k&&(k=new Set,l.set(f,k)));k.has(b)||(k.add(b),c=Qh.bind(null,c,f,b),c=v.unstable_wrap(c),f.then(c,c));-1===g?a=1073741823:(-1===h&&(h=10*(1073741822-mf(a,e))-5E3),a=h+g);0<=a&&Rh<a&&(Rh= a);d.effectTag|=2048;d.expirationTime=e;return}d=d.return}while(null!==d);d=Error((lc(c.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+mc(c))}Sh=!0;d=sh(d,c);a=b;do{switch(a.tag){case 3:a.effectTag|=2048;a.expirationTime=e;e=Lh(a,d,e);nh(a,e);return;case 1:if(g=d,h=a.type,c=a.stateNode,0===(a.effectTag&64)&&("function"===typeof h.getDerivedStateFromError|| null!==c&&"function"===typeof c.componentDidCatch&&(null===Oh||!Oh.has(c)))){a.effectTag|=2048;a.expirationTime=e;e=Nh(a,g,e);nh(a,e);return}}a=a.return}while(null!==a)} function Th(a){switch(a.tag){case 1:I(a.type)&&Ne(a);var b=a.effectTag;return b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return Pf(a),Oe(a),b=a.effectTag,0!==(b&64)?x("285"):void 0,a.effectTag=b&-2049|64,a;case 5:return Rf(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 18:return null;case 4:return Pf(a),null;case 10:return hh(a),null;default:return null}}var Uh=Wb.ReactCurrentDispatcher,Vh=Wb.ReactCurrentOwner; null==v.__interactionsRef||null==v.__interactionsRef.current?x("302"):void 0;var Wh=1073741822,Xh=!1,R=null,Yh=null,S=0,Rh=-1,Sh=!1,T=null,Zh=!1,$h=null,ai=null,bi=null,Oh=null;function ci(){if(null!==R)for(var a=R.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&Ne(b);break;case 3:Pf(b);Oe(b);break;case 5:Rf(b);break;case 4:Pf(b);break;case 10:hh(b)}a=a.return}Yh=null;S=0;Rh=-1;Sh=!1;R=null} function di(){for(;null!==T;){var a=T.effectTag;a&16&&ne(T.stateNode,"");if(a&128){var b=T.alternate;null!==b&&(b=b.ref,null!==b&&("function"===typeof b?b(null):b.current=null))}switch(a&14){case 2:Hh(T);T.effectTag&=-3;break;case 6:Hh(T);T.effectTag&=-3;Ih(T.alternate,T);break;case 4:Ih(T.alternate,T);break;case 8:a=T,Fh(a),a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null,a=a.alternate,null!==a&&(a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null)}T=T.nextEffect}} function ei(){for(;null!==T;){if(T.effectTag&256)a:{var a=T.alternate,b=T;switch(b.tag){case 0:case 11:case 15:Ch(Tf,Sf,b);break a;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:K(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}break a;case 3:case 5:case 6:case 4:case 17:break a;default:x("163")}}T=T.nextEffect}} function fi(a,b){for(;null!==T;){var c=T.effectTag;if(c&36){var d=a,e=T.alternate,f=T,g=b;switch(f.tag){case 0:case 11:case 15:Ch(Wf,Xf,f);break;case 1:d=f.stateNode;if(f.effectTag&4)if(null===e)d.componentDidMount();else{var h=f.elementType===f.type?e.memoizedProps:K(f.type,e.memoizedProps);d.componentDidUpdate(h,e.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}e=f.updateQueue;null!==e&&qh(f,e,d,g);break;case 3:e=f.updateQueue;if(null!==e){d=null;if(null!==f.child)switch(f.child.tag){case 5:d= f.child.stateNode;break;case 1:d=f.child.stateNode}qh(f,e,d,g)}break;case 5:g=f.stateNode;null===e&&f.effectTag&4&&ze(f.type,f.memoizedProps)&&g.focus();break;case 6:break;case 4:break;case 12:g=f.memoizedProps.onRender;g(f.memoizedProps.id,null===e?"mount":"update",f.actualDuration,f.treeBaseDuration,f.actualStartTime,Cg,d.memoizedInteractions);break;case 13:break;case 17:break;default:x("163")}}c&128&&(f=T.ref,null!==f&&(g=T.stateNode,"function"===typeof f?f(g):f.current=g));c&512&&($h=a);T=T.nextEffect}} function gi(a,b){bi=ai=$h=null;var c=V;V=!0;do{if(b.effectTag&512){var d=!1,e=void 0;try{var f=b;Ch(Zf,Sf,f);Ch(Sf,Yf,f)}catch(g){d=!0,e=g}d&&Bh(b,e)}b=b.nextEffect}while(null!==b);V=c;c=a.expirationTime;0!==c&&hi(a,c);W||V||ii(1073741823,!1)}function tf(){null!==ai&&Ee(ai);null!==bi&&bi()} function ji(a,b){Zh=Xh=!0;a.current===b?x("177"):void 0;var c=a.pendingCommitExpirationTime;0===c?x("261"):void 0;a.pendingCommitExpirationTime=0;var d=b.expirationTime,e=b.childExpirationTime;jf(a,e>d?e:d);d=null;d=v.__interactionsRef.current;v.__interactionsRef.current=a.memoizedInteractions;Vh.current=null;e=void 0;1<b.effectTag?null!==b.lastEffect?(b.lastEffect.nextEffect=b,e=b.firstEffect):e=b:e=b.firstEffect;xe=Ed;ye=Sd();Ed=!1;for(T=e;null!==T;){var f=!1,g=void 0;try{ei()}catch(p){f=!0,g=p}f&& (null===T?x("178"):void 0,Bh(T,g),null!==T&&(T=T.nextEffect))}Cg=r.unstable_now();for(T=e;null!==T;){f=!1;g=void 0;try{di()}catch(p){f=!0,g=p}f&&(null===T?x("178"):void 0,Bh(T,g),null!==T&&(T=T.nextEffect))}Td(ye);ye=null;Ed=!!xe;xe=null;a.current=b;for(T=e;null!==T;){f=!1;g=void 0;try{fi(a,c)}catch(p){f=!0,g=p}f&&(null===T?x("178"):void 0,Bh(T,g),null!==T&&(T=T.nextEffect))}if(null!==e&&null!==$h){var h=gi.bind(null,a,e);h=v.unstable_wrap(h);ai=r.unstable_runWithPriority(r.unstable_NormalPriority, function(){return De(h)});bi=h}Xh=Zh=!1;"function"===typeof Te&&Te(b.stateNode);e=b.expirationTime;b=b.childExpirationTime;var k=b>e?b:e;0===k&&(Oh=null);ki(a,k);v.__interactionsRef.current=d;var l=void 0;try{if(l=v.__subscriberRef.current,null!==l&&0<a.memoizedInteractions.size)l.onWorkStopped(a.memoizedInteractions,1E3*c+a.interactionThreadID)}catch(p){X||(X=!0,li=p)}finally{var m=a.pendingInteractionMap;m.forEach(function(a,b){b>k&&(m.delete(b),a.forEach(function(a){a.__count--;if(null!==l&&0=== a.__count)try{l.onInteractionScheduledWorkCompleted(a)}catch(Nb){X||(X=!0,li=Nb)}}))})}} function mi(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){R=a;a.mode&4&&Eg(a);a:{var e=b;b=a;var f=S;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:I(b.type)&&Ne(b);break;case 3:Pf(b);Oe(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Ng(b),b.effectTag&=-3;vh(b);break;case 5:Rf(b);var h=Nf(Mf.current);f=b.type;if(null!==e&&null!=b.stateNode)wh(e,b,f,g,h),e.ref!== b.ref&&(b.effectTag|=128);else if(g){var k=Nf(M.current);if(Ng(b)){g=b;e=g.stateNode;var l=g.type,m=g.memoizedProps,p=h;e[Fa]=g;e[Ga]=m;f=void 0;h=l;switch(h){case "iframe":case "object":D("load",e);break;case "video":case "audio":for(l=0;l<bb.length;l++)D(bb[l],e);break;case "source":D("error",e);break;case "img":case "image":case "link":D("error",e);D("load",e);break;case "form":D("reset",e);D("submit",e);break;case "details":D("toggle",e);break;case "input":zc(e,m);D("invalid",e);ve(p,"onChange"); break;case "select":e._wrapperState={wasMultiple:!!m.multiple};D("invalid",e);ve(p,"onChange");break;case "textarea":fe(e,m),D("invalid",e),ve(p,"onChange")}te(h,m);l=null;for(f in m)m.hasOwnProperty(f)&&(k=m[f],"children"===f?"string"===typeof k?e.textContent!==k&&(l=["children",k]):"number"===typeof k&&e.textContent!==""+k&&(l=["children",""+k]):ra.hasOwnProperty(f)&&null!=k&&ve(p,f));switch(h){case "input":Ub(e);Dc(e,m,!0);break;case "textarea":Ub(e);he(e,m);break;case "select":case "option":break; default:"function"===typeof m.onClick&&(e.onclick=we)}f=l;g.updateQueue=f;g=null!==f?!0:!1;g&&th(b)}else{m=b;p=f;e=g;l=9===h.nodeType?h:h.ownerDocument;k===ie.html&&(k=je(p));k===ie.html?"script"===p?(e=l.createElement("div"),e.innerHTML="<script>\x3c/script>",l=e.removeChild(e.firstChild)):"string"===typeof e.is?l=l.createElement(p,{is:e.is}):(l=l.createElement(p),"select"===p&&(p=l,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):l=l.createElementNS(k,p);e=l;e[Fa]=m;e[Ga]=g;uh(e,b,!1,!1);p=e; l=f;m=g;var w=h,U=ue(l,m);switch(l){case "iframe":case "object":D("load",p);h=m;break;case "video":case "audio":for(h=0;h<bb.length;h++)D(bb[h],p);h=m;break;case "source":D("error",p);h=m;break;case "img":case "image":case "link":D("error",p);D("load",p);h=m;break;case "form":D("reset",p);D("submit",p);h=m;break;case "details":D("toggle",p);h=m;break;case "input":zc(p,m);h=yc(p,m);D("invalid",p);ve(w,"onChange");break;case "option":h=ce(p,m);break;case "select":p._wrapperState={wasMultiple:!!m.multiple}; h=n({},m,{value:void 0});D("invalid",p);ve(w,"onChange");break;case "textarea":fe(p,m);h=ee(p,m);D("invalid",p);ve(w,"onChange");break;default:h=m}te(l,h);k=void 0;var Nb=l,La=p,u=h;for(k in u)if(u.hasOwnProperty(k)){var q=u[k];"style"===k?re(La,q):"dangerouslySetInnerHTML"===k?(q=q?q.__html:void 0,null!=q&&me(La,q)):"children"===k?"string"===typeof q?("textarea"!==Nb||""!==q)&&ne(La,q):"number"===typeof q&&ne(La,""+q):"suppressContentEditableWarning"!==k&&"suppressHydrationWarning"!==k&&"autoFocus"!== k&&(ra.hasOwnProperty(k)?null!=q&&ve(w,k):null!=q&&wc(La,k,q,U))}switch(l){case "input":Ub(p);Dc(p,m,!1);break;case "textarea":Ub(p);he(p,m);break;case "option":null!=m.value&&p.setAttribute("value",""+xc(m.value));break;case "select":h=p;h.multiple=!!m.multiple;p=m.value;null!=p?de(h,!!m.multiple,p,!1):null!=m.defaultValue&&de(h,!!m.multiple,m.defaultValue,!0);break;default:"function"===typeof h.onClick&&(p.onclick=we)}(g=ze(f,g))&&th(b);b.stateNode=e}null!==b.ref&&(b.effectTag|=128)}else null=== b.stateNode?x("166"):void 0;break;case 6:e&&null!=b.stateNode?xh(e,b,e.memoizedProps,g):("string"!==typeof g&&(null===b.stateNode?x("166"):void 0),e=Nf(Mf.current),Nf(M.current),Ng(b)?(g=b,f=g.stateNode,e=g.memoizedProps,f[Fa]=g,(g=f.nodeValue!==e)&&th(b)):(f=b,g=(9===e.nodeType?e:e.ownerDocument).createTextNode(g),g[Fa]=b,f.stateNode=g));break;case 11:break;case 13:g=b.memoizedState;if(0!==(b.effectTag&64)){b.expirationTime=f;R=b;break a}g=null!==g;f=null!==e&&null!==e.memoizedState;null!==e&&!g&& f&&(e=e.child.sibling,null!==e&&(h=b.firstEffect,null!==h?(b.firstEffect=e,e.nextEffect=h):(b.firstEffect=b.lastEffect=e,e.nextEffect=null),e.effectTag=8));if(g||f)b.effectTag|=4;break;case 7:break;case 8:break;case 12:break;case 4:Pf(b);vh(b);break;case 10:hh(b);break;case 9:break;case 14:break;case 17:I(b.type)&&Ne(b);break;case 18:break;default:x("156")}R=null}a.mode&4&&Fg(a,!1);b=a;if(1===S||1!==b.childExpirationTime){g=0;if(b.mode&4){f=b.actualDuration;e=b.selfBaseDuration;h=null===b.alternate|| b.child!==b.alternate.child;for(m=b.child;null!==m;)p=m.expirationTime,l=m.childExpirationTime,p>g&&(g=p),l>g&&(g=l),h&&(f+=m.actualDuration),e+=m.treeBaseDuration,m=m.sibling;b.actualDuration=f;b.treeBaseDuration=e}else for(f=b.child;null!==f;)e=f.expirationTime,h=f.childExpirationTime,e>g&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==R)return R;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect= a.firstEffect),c.lastEffect=a.lastEffect),1<a.effectTag&&(null!==c.lastEffect?c.lastEffect.nextEffect=a:c.firstEffect=a,c.lastEffect=a))}else{if(a.mode&4){Fg(a,!1);b=a.actualDuration;for(g=a.child;null!==g;)b+=g.actualDuration,g=g.sibling;a.actualDuration=b}a=Th(a,S);if(null!==a)return a.effectTag&=1023,a;null!==c&&(c.firstEffect=c.lastEffect=null,c.effectTag|=1024)}if(null!==d)return d;if(null!==c)a=c;else break}return null} function ni(a){var b=a.alternate;a.mode&4&&Eg(a);b=bh(b,a,S);a.memoizedProps=a.pendingProps;a.mode&4&&Fg(a,!0);null===b&&(b=mi(a));Vh.current=null;return b} function oi(a,b){Xh?x("243"):void 0;tf();Xh=!0;var c=Uh.current;Uh.current=pg;var d=a.nextExpirationTimeToWorkOn;if(d!==S||a!==Yh||null===R){ci();Yh=a;S=d;R=af(Yh.current,null,S);a.pendingCommitExpirationTime=0;var e=new Set;a.pendingInteractionMap.forEach(function(a,b){b>=d&&a.forEach(function(a){return e.add(a)})});a.memoizedInteractions=e;if(0<e.size){var f=v.__subscriberRef.current;if(null!==f){var g=1E3*d+a.interactionThreadID;try{f.onWorkStarted(e,g)}catch(l){X||(X=!0,li=l)}}}}f=null;f=v.__interactionsRef.current; v.__interactionsRef.current=a.memoizedInteractions;g=!1;do{try{if(b)for(;null!==R&&!pi();)R=ni(R);else for(;null!==R;)R=ni(R)}catch(l){if(gh=fh=eh=null,qg(),null===R)g=!0,Mh(l);else{R.mode&4&&Fg(R,!0);null===R?x("271"):void 0;var h=R,k=h.return;if(null===k)g=!0,Mh(l);else{Ph(a,k,h,l,S);R=mi(h);continue}}}break}while(1);v.__interactionsRef.current=f;Xh=!1;Uh.current=c;gh=fh=eh=null;qg();if(g)Yh=null,a.finishedWork=null;else if(null!==R)a.finishedWork=null;else{c=a.current.alternate;null===c?x("281"): void 0;Yh=null;if(Sh){if(kf(a,d)){lf(a,d);qi(a,c,d,a.expirationTime,-1);return}if(!a.didError&&b){a.didError=!0;b=a.nextExpirationTimeToWorkOn=d;f=a.expirationTime=1073741823;qi(a,c,b,f,-1);return}}b&&-1!==Rh?(lf(a,d),b=10*(1073741822-mf(a,d)),b<Rh&&(Rh=b),b=10*(1073741822-qf()),b=Rh-b,qi(a,c,d,a.expirationTime,0>b?0:b)):ri(a,c,d)}} function Bh(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Oh||!Oh.has(d))){a=sh(b,a);a=Nh(c,a,1073741823);uf(c,a);vf(c,1073741823);return}break;case 3:a=sh(b,a);a=Lh(c,a,1073741823);uf(c,a);vf(c,1073741823);return}c=c.return}3===a.tag&&(c=sh(b,a),c=Lh(a,c,1073741823),uf(a,c),vf(a,1073741823))} function rf(a,b){var c=r.unstable_getCurrentPriorityLevel(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Xh&&!Zh)d=S;else{switch(c){case r.unstable_ImmediatePriority:d=1073741823;break;case r.unstable_UserBlockingPriority:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case r.unstable_NormalPriority:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case r.unstable_LowPriority:case r.unstable_IdlePriority:d=1;break;default:x("313")}null!==Yh&&d===S&&--d}c===r.unstable_UserBlockingPriority&& (0===si||d<si)&&(si=d);return d}function Qh(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);if(null!==Yh&&S===c)Yh=null;else if(b=a.earliestSuspendedTime,d=a.latestSuspendedTime,0!==b&&c<=b&&c>=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;hf(c,a);c=a.expirationTime;0!==c&&hi(a,c)}}function Jh(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=qf();b=rf(b,a);a=ti(a,b);null!==a&&(gf(a,b),b=a.expirationTime,0!==b&&hi(a,b))} function ti(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){c=d.alternate;d.childExpirationTime<b&&(d.childExpirationTime=b);null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}if(null!==e&&(a=v.__interactionsRef.current,0<a.size)){c=e.pendingInteractionMap;var f=c.get(b);null!=f?a.forEach(function(a){f.has(a)|| a.__count++;f.add(a)}):(c.set(b,new Set(a)),a.forEach(function(a){a.__count++}));c=v.__subscriberRef.current;if(null!==c)c.onWorkScheduled(a,1E3*b+e.interactionThreadID)}return e}function vf(a,b){a=ti(a,b);null!==a&&(!Xh&&0!==S&&b>S&&ci(),gf(a,b),Xh&&!Zh&&Yh===a||hi(a,a.expirationTime),ui>vi&&(ui=0,x("185")))}function wi(a,b,c,d,e){return r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){return a(b,c,d,e)})} var xi=null,Y=null,yi=0,zi=void 0,V=!1,Ai=null,Z=0,si=0,X=!1,li=null,W=!1,Bi=!1,Ci=null,Di=r.unstable_now(),Ei=1073741822-(Di/10|0),Fi=Ei,vi=50,ui=0,Gi=null;function Hi(){Ei=1073741822-((r.unstable_now()-Di)/10|0)}function Ii(a,b){if(0!==yi){if(b<yi)return;null!==zi&&r.unstable_cancelCallback(zi)}yi=b;a=r.unstable_now()-Di;zi=r.unstable_scheduleCallback(Ji,{timeout:10*(1073741822-b)-a})}function ri(a,b,c){a.pendingCommitExpirationTime=c;a.finishedWork=b} function qi(a,b,c,d,e){a.expirationTime=d;0!==e||pi()?0<e&&(a.timeoutHandle=Be(Ki.bind(null,a,b,c),e)):(a.pendingCommitExpirationTime=c,a.finishedWork=b)}function Ki(a,b,c){a.pendingCommitExpirationTime=c;a.finishedWork=b;Hi();Fi=Ei;Li(a,c)}function ki(a,b){a.expirationTime=b;a.finishedWork=null}function qf(){if(V)return Fi;Mi();if(0===Z||1===Z)Hi(),Fi=Ei;return Fi} function hi(a,b){null===a.nextScheduledRoot?(a.expirationTime=b,null===Y?(xi=Y=a,a.nextScheduledRoot=a):(Y=Y.nextScheduledRoot=a,Y.nextScheduledRoot=xi)):b>a.expirationTime&&(a.expirationTime=b);V||(W?Bi&&(Ai=a,Z=1073741823,Ni(a,1073741823,!1)):1073741823===b?ii(1073741823,!1):Ii(a,b))} function Mi(){var a=0,b=null;if(null!==Y)for(var c=Y,d=xi;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===Y?x("244"):void 0;if(d===d.nextScheduledRoot){xi=Y=d.nextScheduledRoot=null;break}else if(d===xi)xi=e=d.nextScheduledRoot,Y.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===Y){Y=c;Y.nextScheduledRoot=xi;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===Y)break;if(1073741823=== a)break;c=d;d=d.nextScheduledRoot}}Ai=b;Z=a}var Oi=!1;function pi(){return Oi?!0:r.unstable_shouldYield()?Oi=!0:!1}function Ji(){try{if(!pi()&&null!==xi){Hi();var a=xi;do{var b=a.expirationTime;0!==b&&Ei<=b&&(a.nextExpirationTimeToWorkOn=Ei);a=a.nextScheduledRoot}while(a!==xi)}ii(0,!0)}finally{Oi=!1}} function ii(a,b){Mi();if(b)for(Hi(),Fi=Ei;null!==Ai&&0!==Z&&a<=Z&&!(Oi&&Ei>Z);)Ni(Ai,Z,Ei>Z),Mi(),Hi(),Fi=Ei;else for(;null!==Ai&&0!==Z&&a<=Z;)Ni(Ai,Z,!1),Mi();b&&(yi=0,zi=null);0!==Z&&Ii(Ai,Z);ui=0;Gi=null;if(null!==Ci)for(a=Ci,Ci=null,b=0;b<a.length;b++){var c=a[b];try{c._onComplete()}catch(d){X||(X=!0,li=d)}}if(X)throw a=li,li=null,X=!1,a;}function Li(a,b){V?x("253"):void 0;Ai=a;Z=b;Ni(a,b,!1);ii(1073741823,!1)} function Ni(a,b,c){V?x("245"):void 0;V=!0;if(c){var d=a.finishedWork;null!==d?Pi(a,d,b):(a.finishedWork=null,d=a.timeoutHandle,-1!==d&&(a.timeoutHandle=-1,Ce(d)),oi(a,c),d=a.finishedWork,null!==d&&(pi()?a.finishedWork=d:Pi(a,d,b)))}else d=a.finishedWork,null!==d?Pi(a,d,b):(a.finishedWork=null,d=a.timeoutHandle,-1!==d&&(a.timeoutHandle=-1,Ce(d)),oi(a,c),d=a.finishedWork,null!==d&&Pi(a,d,b));V=!1} function Pi(a,b,c){var d=a.firstBatch;if(null!==d&&d._expirationTime>=c&&(null===Ci?Ci=[d]:Ci.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Gi?ui++:(Gi=a,ui=0);r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){ji(a,b)})}function Mh(a){null===Ai?x("246"):void 0;Ai.expirationTime=0;X||(X=!0,li=a)}function Qi(a,b){var c=W;W=!0;try{return a(b)}finally{(W=c)||V||ii(1073741823,!1)}} function Ri(a,b){if(W&&!Bi){Bi=!0;try{return a(b)}finally{Bi=!1}}return a(b)}function Si(a,b,c){W||V||0===si||(ii(si,!1),si=0);var d=W;W=!0;try{return r.unstable_runWithPriority(r.unstable_UserBlockingPriority,function(){return a(b,c)})}finally{(W=d)||V||ii(1073741823,!1)}} function Ti(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===hd(c)&&1===c.tag?void 0:x("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(I(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);x("171");g=void 0}if(1===c.tag){var h=c.type;if(I(h)){c=Qe(c,h,g);break a}}c=g}else c=Ke;null===b.context?b.context=c:b.pendingContext=c;b=e;e=sf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b); tf();uf(f,e);vf(f,d);return d}function Ui(a,b,c,d){var e=b.current,f=qf();e=rf(f,e);return Ti(a,b,c,e,d)}function Vi(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Wi(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Zb,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}} Cb=function(a,b,c){switch(b){case "input":Bc(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Ka(d);e?void 0:x("90");Vb(d);Bc(d,e)}}}break;case "textarea":ge(a,c);break;case "select":b=c.value,null!=b&&de(a,!!c.multiple,b,!1)}}; function Xi(a){var b=1073741822-25*(((1073741822-qf()+500)/25|0)+1);b>=Wh&&(b=Wh-1);this._expirationTime=Wh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Xi.prototype.render=function(a){this._defer?void 0:x("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Yi;Ti(a,b,null,c,d._onCommit);return d}; Xi.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; Xi.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:x("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?x("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Li(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next= null,this._defer=!1};Xi.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++)(0,a[b])()}};function Yi(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}Yi.prototype.then=function(a){if(this._didCommit)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; Yi.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++){var c=a[b];"function"!==typeof c?x("191",c):void 0;c()}}}; function Zi(a,b,c){b=b?3:0;We&&(b|=4);b=J(3,null,null,b);a={current:b,containerInfo:a,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,pingCache:null,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null,interactionThreadID:v.unstable_getThreadID(),memoizedInteractions:new Set, pendingInteractionMap:new Map};this._internalRoot=b.stateNode=a}Zi.prototype.render=function(a,b){var c=this._internalRoot,d=new Yi;b=void 0===b?null:b;null!==b&&d.then(b);Ui(a,c,null,d._onCommit);return d};Zi.prototype.unmount=function(a){var b=this._internalRoot,c=new Yi;a=void 0===a?null:a;null!==a&&c.then(a);Ui(null,b,null,c._onCommit);return c}; Zi.prototype.legacy_renderSubtreeIntoContainer=function(a,b,c){var d=this._internalRoot,e=new Yi;c=void 0===c?null:c;null!==c&&e.then(c);Ui(b,d,a,e._onCommit);return e};Zi.prototype.createBatch=function(){var a=new Xi(this),b=a._expirationTime,c=this._internalRoot,d=c.firstBatch;if(null===d)c.firstBatch=a,a._next=null;else{for(c=null;null!==d&&d._expirationTime>=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a}; function $i(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Ib=Qi;Jb=Si;Kb=function(){V||0===si||(ii(si,!1),si=0)};function aj(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Zi(a,!1,b)} function bj(a,b,c,d,e){var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Vi(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=aj(c,d);if("function"===typeof e){var h=e;e=function(){var a=Vi(f._internalRoot);h.call(a)}}Ri(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Vi(f._internalRoot)} function cj(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;$i(b)?void 0:x("200");return Wi(a,b,null,c)} var ej={createPortal:cj,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?x("188"):x("268",Object.keys(a)));a=kd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!0,c)},render:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){$i(c)?void 0:x("200");null==a||void 0===a._reactInternalFiber? x("38"):void 0;return bj(a,b,c,!1,d)},unmountComponentAtNode:function(a){$i(a)?void 0:x("40");return a._reactRootContainer?(Ri(function(){bj(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return cj.apply(void 0,arguments)},unstable_batchedUpdates:Qi,unstable_interactiveUpdates:Si,flushSync:function(a,b){V?x("187"):void 0;var c=W;W=!0;try{return wi(a,b)}finally{W=c,ii(1073741823,!1)}},unstable_createRoot:dj,unstable_flushControlled:function(a){var b= W;W=!0;try{wi(a)}finally{(W=b)||V||ii(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ba.injectEventPluginsByName,pa,Ra,function(a){ya(a,Qa)},Gb,Hb,Gd,Da]}};function dj(a,b){$i(a)?void 0:x("299","unstable_createRoot");return new Zi(a,!0,null!=b&&!0===b.hydrate)} (function(a){var b=a.findFiberByHostInstance;return Xe(n({},a,{overrideProps:null,currentDispatcherRef:Wb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=kd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"});var fj={default:ej},gj=fj&&ej||fj;module.exports=gj.default||gj;
app/src/common/FloatingButton.js
BlackBoxVision/react-native-redux-todo
import React from 'react'; import PropTypes from 'prop-types'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { Fab } from 'native-base'; export default class FloatingButton extends React.Component { static propTypes = { onPress: PropTypes.func.isRequired, backgroundColor: PropTypes.string.isRequired, iconColor: PropTypes.string.isRequired, iconName: PropTypes.string.isRequired, direction: PropTypes.string.isRequired, position: PropTypes.string.isRequired, iconSize: PropTypes.number.isRequired, active: PropTypes.bool.isRequired, children: PropTypes.any }; static defaultProps = { active: false, direction: 'right', position: 'bottomRight', backgroundColor: '#E91E63', iconName: 'add', iconColor: '#FFFFFF', iconSize: 20 }; render() { const styles = this.getStyles(this.props); return ( <Fab active={this.props.active} direction={this.props.direction} position={this.props.position} onPress={this.props.onPress} containerStyle={styles.fabContainer} style={styles.fab} > <Icon name={this.props.iconName} size={this.props.iconSize} color={this.props.iconColor} /> {this.props.children} </Fab> ); } getStyles = props => ({ fabContainer: { bottom: 70 }, fab: { backgroundColor: props.backgroundColor } }); }